Monday, October 5, 2009

Enable Lustre quota on boot

As for the subject. This was written in manual, but I couldn't find it again and again.
tunefs.lustre --param mdt.quota_type=ug /dev/mds
tunefs.lustre --param ost.quota_type=ug /dev/ost

Monday, July 6, 2009

FreeNX installation on CentOS

ได้เวลาลง FreeNX บน CentOS อีกครั้ง ขอจดวิธีไว้ก่อนกันลืม
  1. เปิด Repo พวก addon extras ของ CentOS ใน /etc/yum.repos.d/CentOS-Base.repo (ใส่ enabled=1)
  2. สั่ง yum groupinstall "FreeNX and NX"
  3. สั่ง nxsetup --install หนึ่งครั้ง
  4. start freenx service (/etc/init.d/freenx-server start)
เป็นอันเรียบร้อย หา QTNX หรือ NX Client บน Windows มาลง แล้ว Connect มาที่เครื่องได้ทันที

(หมายเหตุ: FreeNX เป็น Remote Desktop solution ที่เร็วมาก สามารถทำงานได้แม้ในสภาพความเร็ว network ต่ำๆ ตัวโปรแกรมโม้ไว้ว่าทำงานได้ในความเร็วระดับโมเดม เท่าที่เคยลองถือว่าทำงานได้เร็วที่สุดเมื่อเทียบกับ VNC หรือ Remote Desktop อีกทั้งยังทำงานผ่าน SSH ทำให้ไม่ต้องรัน Server หรือเปิด Firewall เพิ่มเติมแต่อย่างใด)

Monday, May 18, 2009

Running StarCCM+ on Linux Cluster with GUI

StarCCM+ is another famous CFD package that our user has license. I have to integrate it to our SGE environment and make it as user friendly as possible. I know from my experience that using "-batch" option is not very "user-friendly" to them, so I found a way to start StarCCM+ in GUI mode while using SGE supplied machine file.
  • Graphically log-in to Cluster Frontend. I would recommend using XRDP. But VNC is ok too.
  • Run 'xhost +' once.
  • Create SGE job script like this. Change '-pe mpich 8' to desired number of CPU. Save the file as 'starccm.job'. Don't forget to replace frontend-name.local to actualy local (internal network) name of Frontend. For Rocks, it is safe to use 10.1.1.1 instead if you choose default Rocks-style IP addressing.
#!/bin/bash
#$ -pe mpich 8

export DISPLAY="frontend-name.local$1"
starccm+ -batchsystem sge
  • Submit the job
qsub starccm.job "$DISPLAY"
  • Wait a while, StarCCM+ GUI should appear. Don't terminate VNC or XRDP session yet while waiting
  • Now select "New simulation" and choose
    • Run mode: Parallel
    • Parallel Option: Specify parallel hosts
    • Detail/Controller: Controller on Local host
    • Do not specify any host here. Leave all blank
  • Click OK and wait, the message box below should show that starccm+ has start all workers on SGE supplied machine list.

Monday, March 30, 2009

MySQL Backup

MySQL มีคำสั่ง mysqldump สำหรับการแบ้คอัพฐานข้อมูล
shell> mysqldump [options] db_name [tables]
shell> mysqldump [options] --databases db_name1 [db_name2 db_name3...]
shell> mysqldump [options] --all-databases
ในการ restore ก็ใช้คำสั่ง mysql แล้ว redirect ไฟล์ sql ที่เคยแบ้คอัพไว้
shell> mysql -u root -p < backup_file.sql

ตัวอย่าง

#ดั้มพ์ทั้งฐานข้อมูลเก็บลงไฟล์ db.sql
mysqldump -u root -p mydatabase > db.sql

#ดั้มเฉพาะเทเบล stock
mysqldump -u root -p mydatabase -tables stock > db.sql

#ทุกดาต้าเบส+ล้อค+ซิปไฟล์+ลงเวลา
mysqldump -u root -p -all-database --lock-all-table | gzip -c > db_backup_$(date +%Y-%m-%d).sql.gz

#รีสโตร์อันข้างบน
gunzip -c db_backup.sql.gz | mysql -u root -p

Wednesday, March 18, 2009

MSA500 redundancy configuration

วันนี้นั่งมึนอยู่ทั้งวันกับการทำให้ Storage MSA500 ของ TERA กลับมาใช้งานได้บนระบบอีกครั้ง ทำให้ได้ความรู้เพิ่มเติมหลายอย่างเกี่ยวกับตัว HP Storage มาอีกหน่อย
  • ต้องลง hpsmh (อันนี้รู้แล้ว) ซอฟต์แวร์ตัวนี้เหมือนจะไม่ฟรี แต่จริงๆหาดาวน์โหลดได้ใน ftp ของ Compaq
  • ต้องลง hpasm ถ้าให้ดีลงตัวใหม่ก็ดี เหมือนจะแก้บั๊กตอน start failedๆไปแล้ว
  • ต้องลง cpqacuxe ตัวนี้คือ array configuration utility (acu) แบบ GUI บนเว็บ (ซึ่งคราวที่แล้วบอกไปแล้วว่าใช้ไม่ได้ถ้าไม่มี hpsmh)
  • ควรจะลง hpadu (array diagnostic utility) ด้วยก็ดี
  • เข้าเว็บไปที่ https://localhost:2381 ถ้าไม่มี link ไป ACU ก็ให้รัน cpqacuxe -R ทิ้งไว้ เดี๋ยวลิ้งค์จะโผล่มา
  • อันนี้จุดสำคัญ ถ้าจะให้เครื่องนั้นๆเห็น logical drive ที่คอนฟิกไว้แล้ว ต้องเข้าไปที่ Select Storage Presentation (SSP) เพื่อติ้ก enable ให้เห็นแต่ละ logical drive ที่สำคัญคือ หน้าเว็บนี้ใหญ่มาก บางทีอาจจะตกจอ ต้อง scroll ขวาถึงจะเห็น (นั่งงมอยู่นาน)
ในที่สุด storage-0-3 ก็กลับมาอีกครั้ง

Tuesday, March 17, 2009

DNS timeout problem on ROCKS

If a ROCKS cluster is set inside a private network without working DNS, everything in ROCKS will run much slower because every applications are trying to query for reverse-lookup.

I find a workaround on this. It is to set /etc/resolv.conf to have very little timeout and retry

options timeout:0 attempts:1


Now everything is faster, but not as fast as it should. I will look for a proper workaround for named.

Swapping order of network card with the same driver

If a Linux box has 2 network card, an easy way to swap the order, swapping eth0 and eth1, is to change the alias setting in /etc/modprobe.conf.

But how about the machine which has 2 cards using the same driver? The trick is to change MACADDRESS correspond to each card to your desire order. For CentOS, this can be set in /etc/sysconfig/network-scripts/ifcfg-eth*. Swap it, stop network (service network stop), remove driver, then start network again (service network start)