<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SpaLinux.com &#187; Cluster</title>
	<atom:link href="http://spalinux.com/category/cluster/feed" rel="self" type="application/rss+xml" />
	<link>http://spalinux.com</link>
	<description>Resources for Relaxing Linux System Administrators</description>
	<lastBuildDate>Sat, 21 Jan 2012 16:07:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>การใช้งานเบื้องต้น Sun Grid Engine</title>
		<link>http://spalinux.com/2011/01/how_to_use_sun_grid_engine</link>
		<comments>http://spalinux.com/2011/01/how_to_use_sun_grid_engine#comments</comments>
		<pubDate>Sat, 29 Jan 2011 09:22:25 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Cluster]]></category>
		<category><![CDATA[Grid]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Oracle Grid Engine]]></category>
		<category><![CDATA[Submit Job]]></category>
		<category><![CDATA[Sun Grid Engine]]></category>

		<guid isPermaLink="false">http://spalinux.com/?p=1245</guid>
		<description><![CDATA[หลังจากติดตั้ง Sun Grid ทั้งเครื่อง qmaster และ execd host เรียบร้อยแล้ว บทความนี้จะแนะนำวิธีการใช้งานเบื้องต้นของ Sun Grid Engine เพื่อดูสถานะของเครื่อง งานที่รัน และวิธีการส่งงานอย่างง่ายๆ ตั้งค่าตัวแปร setting.sh ต้องรัน source ไฟล์ /gridware/sge/MyCell/common/settings.sh เพื่อตั้งค่าตัวแปรของ sge ก่อนที่จะรันคำสั่ง วิธีการรัน ใช้คำสั่ง source หรือ . เว้นวรรคแล้วตามด้วยชื่อไฟล์ /gridware/sge/MyCell/common/settings.sh [root@cent55-sge ~]# . /gridware/sge/MyCell/common/settings.sh ลองรันคำสั่ง set เพื่อดูค่าตัวแปรที่ถูกตั้งค่า เกี่ยวกับ sge [root@cent55-sge ~]# set &#124; grep -i sge MANPATH=/gridware/sge/man:/usr/share/man/en:/usr/share/man:/usr/local/share/man PATH=/gridware/sge/bin/lx24-amd64:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin SGE_CELL=MyCell SGE_CLUSTER_NAME=MyCluster SGE_ROOT=/gridware/sge คำสั่ง qconf [...]]]></description>
			<content:encoded><![CDATA[<p>หลังจากติดตั้ง Sun Grid ทั้งเครื่อง qmaster และ execd host เรียบร้อยแล้ว บทความนี้จะแนะนำวิธีการใช้งานเบื้องต้นของ Sun Grid Engine เพื่อดูสถานะของเครื่อง งานที่รัน และวิธีการส่งงานอย่างง่ายๆ</p>
<p><span id="more-1245"></span></p>
<h4>ตั้งค่าตัวแปร setting.sh</h4>
<p>ต้องรัน source ไฟล์ /gridware/sge/MyCell/common/settings.sh เพื่อตั้งค่าตัวแปรของ sge ก่อนที่จะรันคำสั่ง</p>
<p>วิธีการรัน ใช้คำสั่ง source หรือ . เว้นวรรคแล้วตามด้วยชื่อไฟล์ /gridware/sge/MyCell/common/settings.sh</p>
<pre>[root@cent55-sge ~]# <strong>. /gridware/sge/MyCell/common/settings.sh</strong></pre>
<p>ลองรันคำสั่ง set เพื่อดูค่าตัวแปรที่ถูกตั้งค่า เกี่ยวกับ sge</p>
<pre>[root@cent55-sge ~]# <strong>set | grep -i sge
</strong>MANPATH=<span style="color: #0000ff;">/gridware/sge/man</span>:/usr/share/man/en:/usr/share/man:/usr/local/share/man
PATH=<span style="color: #0000ff;">/gridware/sge/bin/lx24-amd64</span>:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
<span style="color: #0000ff;">SGE_CELL=MyCell</span>
<span style="color: #0000ff;">SGE_CLUSTER_NAME=MyCluster</span>
<span style="color: #0000ff;">SGE_ROOT=/gridware/sge</span></pre>
<h4>คำสั่ง qconf ดูคอนฟิก</h4>
<p>ใช้คำสั่ง qconf ตามด้วยออปชั่น เพื่อดูค่าคอนฟิกต่างๆ ของ sge</p>
<p>รันคำสั่ง qconf -ss เพื่อดูชื่อเครื่องที่มีสิทธิส่งงานหรือใช้คำสั่ง qsub ได้ (show a list of all submit hosts)</p>
<pre>[root@cent55-sge ~]# <strong>qconf -ss
</strong>cent55-node1.spalinux.com
cent55-node2.spalinux.com
cent55-sge.spalinux.com</pre>
<p>รันคำสั่ง qconf -sel เพื่อดูชื่อเครื่องที่ทำหน้าที่รันงาน (show a list of all exec servers)</p>
<pre>[root@cent55-sge ~]# <strong>qconf -sel
</strong>cent55-node1.spalinux.com
cent55-node2.spalinux.com</pre>
<h4>คำสั่ง qstat ดูสถานะ</h4>
<p>ใช้คำสั่ง qstat ตามด้วยออปชั่น เพื่อดูสถานะของงาน (job) และ queue ในการรันงาน</p>
<p>รันคำสั่ง qstat -f เพื่อดูสถานะของเครื่อง execd host และงานที่รัน</p>
<pre>[root@cent55-sge ~]# <strong>qstat -f
</strong>queuename                      qtype resv/used/tot. load_avg arch          states
---------------------------------------------------------------------------------
all.q@cent55-node1.spalinux.co BIP   0/0/1          0.00     lx24-amd64
---------------------------------------------------------------------------------
all.q@cent55-node2.spalinux.co BIP   0/0/1          0.34     lx24-amd64</pre>
<h4>ทดสอบการส่ง job</h4>
<p>เริ่มต้นจะทดลองส่ง job แบบง่ายๆ รันไฟล์ simple.sh ที่มาจากการติดตั้งโปรแกรม Sun Grid Engine</p>
<p>ไฟล์ simple เป็น shell script ที่รันคำสั่ง date รอ (sleep) 20 วินาที แล้วรันคำสั่ง date อีกครั้ง</p>
<pre>[root@cent55-sge ~]# <strong>cat /gridware/sge/examples/jobs/simple.sh
</strong>#!/bin/sh
#
#
# (c) 2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.</pre>
<pre># This is a simple example of a SGE batch script</pre>
<pre># request Bourne shell as shell for job
#$ -S /bin/sh</pre>
<pre>#
# print date and time
date
# Sleep for 20 seconds
sleep 20
# print date and time again
date</pre>
<p>ใช้คำสั่ง qsub ตามด้วยชื่อไฟล์ที่ต้องการรัน</p>
<pre>[root@cent55-sge ~]# <strong>qsub /gridware/sge/examples/jobs/simple.sh
</strong>Your job <span style="color: #0000ff;">206</span> ("simple.sh") has been submitted</pre>
<p>ใช้คำสั่ง qstat -f เพื่อดูสถานะของ job</p>
<pre>[root@cent55-sge ~]# <strong>qstat -f
</strong>queuename                      qtype resv/used/tot. load_avg arch          states
---------------------------------------------------------------------------------
all.q@cent55-node1.spalinux.co BIP   0/0/1          0.00     lx24-amd64
---------------------------------------------------------------------------------
all.q@cent55-node2.spalinux.co BIP   0/0/1          0.09     lx24-amd64</pre>
<pre>############################################################################
 - PENDING JOBS - PENDING JOBS - PENDING JOBS - PENDING JOBS - PENDING JOBS
############################################################################
<span style="color: #0000ff;">    206 0.00000 simple.sh  root         qw    01/29/2011 15:43:06     1</span></pre>
<p>ทดลองพิมพ์คำสั่ง qstat -f ไปเรื่อยๆ ช่วงแรก job 206 จะอยู่ในสถานะ PENDING JOBS คือรอการรัน</p>
<p>ผ่านไปไม่นาน สถานะของ job 206 จะเริ่มรันบนเครื่อง execd host ในตัวอย่างนี้รันบนเครื่อง node1</p>
<pre>[root@cent55-sge ~]# <strong>qstat -f
</strong>queuename                      qtype resv/used/tot. load_avg arch          states
---------------------------------------------------------------------------------
all.q@cent55-node1.spalinux.co BIP   0/1/1          0.00     lx24-amd64
<span style="color: #0000ff;">    206 0.55500 simple.sh  root         r     01/29/2011 15:43:15     1
</span>---------------------------------------------------------------------------------
all.q@cent55-node2.spalinux.co BIP   0/0/1          0.09     lx24-amd64</pre>
<p>หากล็อกอินเครื่อง node1 แล้วใช้คำสั่ง ps  จะเห็นโปรเซสของ job 206</p>
<pre style="text-align: justify;">[root@cent55-node1 ~]# <strong>ps -ef
</strong>...
sgeadmin  2192  2129  0 15:43 ?        00:00:00 sge_shepherd-206 -bg
root      2193  2192  0 15:43 ?        00:00:00 <span style="color: #0000ff;">-sh /gridware/sge/MyCell/spool/cent55-node1/job_scripts/206
</span>root      2218  2193  0 15:43 ?        00:00:00 sleep 20
root      2221  1754  0 15:43 pts/0    00:00:00 ps -ef</pre>
<p>ดูไฟล์โปรเซสที่รันบนเครื่อง node1 ซึ่งก็คือไฟล์ simple.sh นั่นเอง</p>
<pre>[root@cent55-node1 ~]# cat /gridware/sge/MyCell/spool/cent55-node1/job_scripts/206
#!/bin/sh
#
#
# (c) 2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.</pre>
<pre># This is a simple example of a SGE batch script</pre>
<pre># request Bourne shell as shell for job
#$ -S /bin/sh</pre>
<pre>#
# print date and time
date
# Sleep for 20 seconds
sleep 20
# print date and time again
date</pre>
<p>หลังจากรันงานเสร็จสิ้น สถานะ job 206 ก็จะหายไปจากคำสั่ง qstat</p>
<pre>[root@cent55-sge ~]# <strong>qstat -f
</strong>queuename                      qtype resv/used/tot. load_avg arch          states
---------------------------------------------------------------------------------
all.q@cent55-node1.spalinux.co BIP   0/0/1          0.00     lx24-amd64
---------------------------------------------------------------------------------
all.q@cent55-node2.spalinux.co BIP   0/0/1          0.09     lx24-amd64</pre>
<p>ผลลัพธ์ที่ได้จากการรันไฟล์ simple.sh จะถูกเก็บไว้บนเครื่อง execd host ที่ทำหน้าที่รัน เช่นในที่นี้คือบน node1</p>
<p>ไฟล์ simple.sh.o206 เก็บผลลัพธ์ standard output จากการรัน job 206</p>
<pre>[root@cent55-node1 ~]# <strong>cat simple.sh.o206
</strong>Sat Jan 29 15:43:14 ICT 2011
Sat Jan 29 15:43:34 ICT 2011</pre>
<p>ไฟล์ simple.sh.e206 เก็บผลลัพธ์ standard error จากการรัน job</p>
<pre>[root@cent55-node1 ~]# <strong>cat simple.sh.e206</strong></pre>
<p>ในที่นี้ไม่มี error จากการรัน ไฟล์จึงว่างเปล่า</p>
<h4>ข้อมูลอ้างอิง</h4>
<ul>
<li><a href="http://spalinux.com/2011/01/install_sun_grid_engine_on_centos_5-5">ติดตั้ง Sun Grid Engine บน CentOS 5.5</a></li>
<li><a href="http://spalinux.com/2011/01/configure_sun_grid_engine_qmaster_host">คอนฟิก Sun Grid Engine qmaster host</a></li>
<li><a href="http://spalinux.com/2011/01/configure_sun_grid_engine_execd_host">คอนฟิก Sun Grid Engine execution (execd) host</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2011/01/how_to_use_sun_grid_engine/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>คอนฟิก Sun Grid Engine execution (execd) host</title>
		<link>http://spalinux.com/2011/01/configure_sun_grid_engine_execd_host</link>
		<comments>http://spalinux.com/2011/01/configure_sun_grid_engine_execd_host#comments</comments>
		<pubDate>Sat, 29 Jan 2011 07:45:11 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Cluster]]></category>
		<category><![CDATA[Grid]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Oracle Grid Engine]]></category>
		<category><![CDATA[Sun Grid Engine]]></category>

		<guid isPermaLink="false">http://spalinux.com/?p=1237</guid>
		<description><![CDATA[เช่นเดียวกับเครื่องที่ทำหน้าที่เป็น qmaster  การเริ่มคอนฟิกเครื่อง execd host ก็ต้อง ติดตั้ง Sun Grid Engine บน CentOS 5.5 ก่อนแล้วค่อยคอนฟิกให้ทำหน้าที่เป็น execd host หมายเหตุ ตัวอย่างในบทความนี้คอนฟิกบน node1 เครื่องเดียว ส่วนเครื่องอื่นๆ ที่จะทำหน้าที่เป็น execd host ด้วย ก็คอนฟิกแบบเดียวกัน หลังจากติดตั้ง Sun Grid Engine แล้ว cd ไปยังไดเรคทอรีที่ติดตั้ง sge [root@cent55-node1 sge6_2u5]# cd /gridware/sge/ [root@cent55-node1 sge]# ls -l total 136 drwxr-xr-x  2 root root  4096 Jan  8 22:25 3rd_party drwxr-xr-x  3 root root  [...]]]></description>
			<content:encoded><![CDATA[<p>เช่นเดียวกับเครื่องที่ทำหน้าที่เป็น qmaster  การเริ่มคอนฟิกเครื่อง execd host ก็ต้อง <a href="http://spalinux.com/2011/01/install_sun_grid_engine_on_centos_5-5">ติดตั้ง Sun Grid Engine บน CentOS 5.5</a> ก่อนแล้วค่อยคอนฟิกให้ทำหน้าที่เป็น execd host</p>
<p>หมายเหตุ ตัวอย่างในบทความนี้คอนฟิกบน node1 เครื่องเดียว ส่วนเครื่องอื่นๆ ที่จะทำหน้าที่เป็น execd host ด้วย ก็คอนฟิกแบบเดียวกัน</p>
<p><span id="more-1237"></span></p>
<p>หลังจากติดตั้ง Sun Grid Engine แล้ว cd ไปยังไดเรคทอรีที่ติดตั้ง sge</p>
<pre>[root@cent55-node1 sge6_2u5]# <strong>cd /gridware/sge/</strong></pre>
<pre>[root@cent55-node1 sge]# <strong>ls -l
</strong>total 136
drwxr-xr-x  2 root root  4096 Jan  8 22:25 3rd_party
drwxr-xr-x  3 root root  4096 Jan  8 22:25 bin
drwxr-xr-x  3 root root  4096 Jan  8 22:25 catman
drwxr-xr-x  2 root root  4096 Jan  8 22:25 ckpt
drwxr-xr-x  5 root root  4096 Jan  8 22:25 doc
drwxr-xr-x  2 root root  4096 Jan  8 22:25 dtrace
drwxr-xr-x  5 root root  4096 Jan  8 22:25 examples
drwxr-xr-x  2 root root  4096 Jan  8 22:25 hadoop
drwxr-xr-x  2 root root  4096 Jan  8 22:25 include
-rwxr-xr-x  1 root root   125 Dec 11  2009 install_execd
-rwxr-xr-x  1 root root   125 Dec 11  2009 install_qmaster
-rwxr-xr-x  1 root root 59960 Dec 11  2009 inst_sge
drwxr-xr-x  3 root root  4096 Jan  8 22:25 lib
drwxr-xr-x  6 root root  4096 Jan  8 22:25 man
drwxr-xr-x  4 root root  4096 Jan  8 22:25 mpi
drwxr-xr-x  3 root root  4096 Jan  8 22:25 pvm
drwxr-xr-x  3 root root  4096 Jan  8 22:25 qmon
-rwxr-xr-x  1 root root  1289 Dec 11  2009 start_gui_installer
drwxr-xr-x 10 root root  4096 Jan  8 22:25 util
drwxr-xr-x  3 root root  4096 Jan  8 22:25 utilbin</pre>
<p>ต้อง copy ไดเรคทอรี ของ cell ที่คอนฟิกไว้บนเครื่อง qmaster host</p>
<p>ล็อกอินเข้าเครื่อง sge แล้วรันคำสั่ง tar ใน /gridware/sge/ เพื่อรวมไฟล์ทั้งหมดที่อยู่ในไดเรคทอรีของ cell ในที่นี้เราตั้งชื่อเป็น MyCell</p>
<pre>[root@cent55-sge ~]# <strong>cd /gridware/sge/</strong></pre>
<pre>[root@cent55-sge sge]# <strong>tar jcvpf MyCell.tar.bz2 MyCell/
</strong>MyCell/
MyCell/spool/
MyCell/spool/qmaster/
MyCell/spool/qmaster/heartbeat
MyCell/spool/qmaster/arseqnum
MyCell/spool/qmaster/qmaster.pid
MyCell/spool/qmaster/messages
MyCell/spool/qmaster/job_scripts/
MyCell/spool/qmaster/jobseqnum
MyCell/spool/qmaster/lock
MyCell/spool/spooldb/
MyCell/spool/spooldb/__db.005
MyCell/spool/spooldb/__db.001
MyCell/spool/spooldb/sge_job
MyCell/spool/spooldb/__db.003
MyCell/spool/spooldb/log.0000000001
MyCell/spool/spooldb/__db.004
MyCell/spool/spooldb/__db.002
MyCell/spool/spooldb/sge
MyCell/spool/spooldb/__db.006
MyCell/common/
MyCell/common/settings.csh
MyCell/common/sgeexecd
MyCell/common/act_qmaster
MyCell/common/bootstrap
MyCell/common/sgemaster
MyCell/common/sge_aliases
MyCell/common/sge_request
MyCell/common/cluster_name
MyCell/common/qtask
MyCell/common/settings.sh</pre>
<p>copy ไฟล์ ไปยังเครื่อง node1 โดยอาจใช้คำสั่ง scp หรืออื่นๆ ก็ได้</p>
<pre>[root@cent55-sge sge]# <strong>scp MyCell.tar.bz2 cent55-node1:</strong></pre>
<p>กลับมายังเครื่อง node1 รันคำสั่ง tar เพื่อแตกไฟล์ ไว้ใน /gridware/sge/</p>
<pre>[root@cent55-node1 sge]# <strong>tar jxvf /root/MyCell.tar.bz2
</strong>MyCell/
MyCell/spool/
MyCell/spool/qmaster/
MyCell/spool/qmaster/heartbeat
MyCell/spool/qmaster/arseqnum
MyCell/spool/qmaster/qmaster.pid
MyCell/spool/qmaster/messages
MyCell/spool/qmaster/job_scripts/
MyCell/spool/qmaster/jobseqnum
MyCell/spool/qmaster/lock
MyCell/spool/spooldb/
MyCell/spool/spooldb/__db.005
MyCell/spool/spooldb/__db.001
MyCell/spool/spooldb/sge_job
MyCell/spool/spooldb/__db.003
MyCell/spool/spooldb/log.0000000001
MyCell/spool/spooldb/__db.004
MyCell/spool/spooldb/__db.002
MyCell/spool/spooldb/sge
MyCell/spool/spooldb/__db.006
MyCell/common/
MyCell/common/settings.csh
MyCell/common/sgeexecd
MyCell/common/act_qmaster
MyCell/common/bootstrap
MyCell/common/sgemaster
MyCell/common/sge_aliases
MyCell/common/sge_request
MyCell/common/cluster_name
MyCell/common/qtask
MyCell/common/settings.sh</pre>
<p>รันคำสั่ง ./install_execd หรือ ./inst_sge -x เพื่อติดตั้ง sge บนเครื่องนี้ให้ทำหน้าที่เป็น qmaster host</p>
<p>หน้าจอแสดงเริ่มต้นการติดตั้งเป็น sge execution host</p>
<pre>[root@cent55-node1 sge]# <strong>./inst_sge -x</strong></pre>
<pre>Welcome to the Grid Engine execution host installation
------------------------------------------------------</pre>
<pre>If you haven't installed the Grid Engine qmaster host yet, you must execute
this step (with &gt;install_qmaster&lt;) prior the execution host installation.</pre>
<pre>For a sucessfull installation you need a running Grid Engine qmaster. It is
also neccesary that this host is an administrative host.</pre>
<pre>You can verify your current list of administrative hosts with
the command:</pre>
<pre>   # qconf -sh</pre>
<pre>You can add an administrative host with the command:</pre>
<pre>   # qconf -ah &lt;hostname&gt;</pre>
<pre>The execution host installation will take approximately 5 minutes.</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>ตรวจสอบไดเรคทอรีหลัก</p>
<pre>Checking $SGE_ROOT directory
----------------------------</pre>
<pre>The Grid Engine root directory is:</pre>
<pre>   $SGE_ROOT = /gridware/sge</pre>
<pre>If this directory is not correct (e.g. it may contain an automounter
prefix) enter the correct path to this directory or hit &lt;RETURN&gt;
to use default [/gridware/sge] &gt;&gt;</pre>
<pre>Your $SGE_ROOT directory: /gridware/sge</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>ระบุชื่อ cell ที่คอนฟิกไว้บน qmaster ในที่นี้คือ MyCell</p>
<pre>Grid Engine cells
-----------------</pre>
<pre>Please enter cell name which you used for the qmaster
installation or press &lt;RETURN&gt; to use [default] &gt;&gt; MyCell</pre>
<pre>Using cell: &gt;<span style="color: #0000ff;">MyCell</span>&lt;</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>พอร์ตสำหรับรัน sge_execd</p>
<pre>Grid Engine TCP/IP communication service
----------------------------------------</pre>
<pre>The port for sge_execd is currently set as service.</pre>
<pre>   sge_execd service set to port 10501</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>หาก node นี้อยู่ใน administrative host บน sge qmaster แล้ว</p>
<pre>Checking hostname resolving
---------------------------</pre>
<pre>This hostname is known at qmaster as an administrative host.</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>คอนฟิกไดเรคทอรี spool</p>
<pre>Execd spool directory configuration
-----------------------------------</pre>
<pre>You defined a global spool directory when you installed the master host.
You can use that directory for spooling jobs from this execution host
or you can define a different spool directory for this execution host.</pre>
<pre>ATTENTION: For most operating systems, the spool directory does not have to
be located on a local disk. The spool directory can be located on a
network-accessible drive. However, using a local spool directory provides
better performance.</pre>
<pre>FOR WINDOWS USERS: On Windows systems, the spool directory MUST be located
on a local disk. If you install an execution daemon on a Windows system
without a local spool directory, the execution host is unusable.</pre>
<pre>The spool directory is currently set to:
&lt;&lt;<span style="color: #0000ff;">/gridware/sge/MyCell/spool/cent55-node1</span>&gt;&gt;</pre>
<pre>Do you want to configure a different spool directory
for this host (y/n) [n] &gt;&gt;</pre>
<pre>Creating local configuration
----------------------------
sgeadmin@cent55-node1.spalinux.com added "cent55-node1.spalinux.com" to configuration list
Local configuration for host &gt;cent55-node1.spalinux.com&lt; created.</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt; </pre>
<p>สร้างไฟล์สำหรับรัน sge execd ตอนบู๊ตเครื่อง</p>
<pre>execd startup script
--------------------</pre>
<pre>We can install the startup script that will
start execd at machine boot (y/n) [y] &gt;&gt;</pre>
<pre>cp /gridware/sge/MyCell/common/sgeexecd /etc/init.d/sgeexecd.MyCluster
/usr/lib/lsb/install_initd /etc/init.d/sgeexecd.MyCluster</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<pre>Grid Engine execution daemon startup
------------------------------------</pre>
<pre>Starting execution daemon. Please wait ...
   starting sge_execd</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>เพิ่ม queue</p>
<pre> Adding a queue for this host
----------------------------</pre>
<pre>We can now add a queue instance for this host:</pre>
<pre>   - it is added to the &gt;allhosts&lt; hostgroup
   - the queue provides 1 slot(s) for jobs in all queues
     referencing the &gt;allhosts&lt; hostgroup</pre>
<pre>You do not need to add this host now, but before running jobs on this host
it must be added to at least one queue.</pre>
<pre>Do you want to add a default queue instance for this host (y/n) [y] &gt;&gt;</pre>
<pre>root@cent55-node1.spalinux.com modified "@allhosts" in host group list
root@cent55-node1.spalinux.com modified "all.q" in cluster queue list</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>หน้าจอแสดงวิธีการใช้ sge</p>
<pre>Using Grid Engine
-----------------</pre>
<pre>You should now enter the command:</pre>
<pre>   source /gridware/sge/MyCell/common/settings.csh</pre>
<pre>if you are a csh/tcsh user or</pre>
<pre>   # . /gridware/sge/MyCell/common/settings.sh</pre>
<pre>if you are a sh/ksh user.</pre>
<pre>This will set or expand the following environment variables:</pre>
<pre>   - $SGE_ROOT         (always necessary)
   - $SGE_CELL         (if you are using a cell other than &gt;default&lt;)
   - $SGE_CLUSTER_NAME (always necessary)
   - $SGE_QMASTER_PORT (if you haven't added the service &gt;sge_qmaster&lt;)
   - $SGE_EXECD_PORT   (if you haven't added the service &gt;sge_execd&lt;)
   - $PATH/$path       (to find the Grid Engine binaries)
   - $MANPATH          (to access the manual pages)</pre>
<pre>Hit &lt;RETURN&gt; to see where Grid Engine logs messages &gt;&gt;</pre>
<pre>Grid Engine messages
--------------------</pre>
<pre>Grid Engine messages can be found at:</pre>
<pre>   /tmp/qmaster_messages (during qmaster startup)
   /tmp/execd_messages   (during execution daemon startup)</pre>
<pre>After startup the daemons log their messages in their spool directories.</pre>
<pre>   Qmaster:     /gridware/sge/MyCell/spool/qmaster/messages
   Exec daemon: &lt;execd_spool_dir&gt;/&lt;hostname&gt;/messages</pre>
<pre>Grid Engine startup scripts
---------------------------</pre>
<pre>Grid Engine startup scripts can be found at:</pre>
<pre>   /gridware/sge/MyCell/common/sgemaster (qmaster)
   /gridware/sge/MyCell/common/sgeexecd (execd)</pre>
<pre>Do you want to see previous screen about using Grid Engine again (y/n) [n] &gt;&gt;</pre>
<pre>Your execution daemon installation is now completed.</pre>
<p>ใช้คำสั่ง ps ตรวจสอบโปรเซส sge_execd</p>
<pre>[root@cent55-node1 sge]# <strong>ps -ef | grep sge
</strong>sgeadmin  2346     1  0 22:37 ?        00:00:00 /gridware/sge/bin/lx24-amd64/sge_execd
root      2414  1668  0 22:39 pts/0    00:00:00 grep sge</pre>
<h4> <br />
การเปิด/ปิด เซอร์วิส sge_execd</h4>
<p>การปิดเซอร์วิส sgeexecd</p>
<pre>[root@cent55-node1 sge]# <strong>/etc/init.d/sgeexecd.MyCluster stop
</strong>   Shutting down Grid Engine execution daemon</pre>
<p>การเปิดหรือรันเซอร์วิส sgeexecd</p>
<pre>[root@cent55-node1 sge]# <strong>/etc/init.d/sgeexecd.MyCluster start
</strong>   starting sge_execd</pre>
<h4> <br />
ข้อมูลอ้างอิง</h4>
<ul>
<li><a href="http://spalinux.com/2011/01/install_sun_grid_engine_on_centos_5-5">ติดตั้ง Sun Grid Engine บน CentOS 5.5</a></li>
<li><a href="http://spalinux.com/2011/01/configure_sun_grid_engine_qmaster_host">คอนฟิก Sun Grid Engine qmaster host</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2011/01/configure_sun_grid_engine_execd_host/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>คอนฟิก Sun Grid Engine qmaster host</title>
		<link>http://spalinux.com/2011/01/configure_sun_grid_engine_qmaster_host</link>
		<comments>http://spalinux.com/2011/01/configure_sun_grid_engine_qmaster_host#comments</comments>
		<pubDate>Sat, 15 Jan 2011 16:48:59 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Cluster]]></category>
		<category><![CDATA[Grid]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Oracle Grid Engine]]></category>
		<category><![CDATA[Sun Grid Engine]]></category>

		<guid isPermaLink="false">http://spalinux.com/?p=1231</guid>
		<description><![CDATA[หลังจาก ติดตั้ง Sun Grid Engine บน CentOS 5.5 แล้ว บทความนี้จะกล่าวถึงวิธีการคอนฟิก sge ให้ทำหน้าที่เป็น qmaster host สำหรับจัดการเรื่อง job เริ่มต้น ใช้คำสั่ง cd ไปยังไดเรคทอรีที่ติดตั้ง sge [root@cent55-sge sge6_2u5]# cd /gridware/sge/ [root@cent55-sge sge]# ls -l total 136 drwxr-xr-x  2 root root  4096 Jan  8 12:40 3rd_party drwxr-xr-x  3 root root  4096 Jan  8 12:48 bin drwxr-xr-x  3 root root  4096 Jan  [...]]]></description>
			<content:encoded><![CDATA[<p>หลังจาก <a href="http://spalinux.com/2011/01/install_sun_grid_engine_on_centos_5-5">ติดตั้ง Sun Grid Engine บน CentOS 5.5</a> แล้ว บทความนี้จะกล่าวถึงวิธีการคอนฟิก sge ให้ทำหน้าที่เป็น qmaster host สำหรับจัดการเรื่อง job</p>
<p><span id="more-1231"></span>เริ่มต้น ใช้คำสั่ง cd ไปยังไดเรคทอรีที่ติดตั้ง sge</p>
<pre>[root@cent55-sge sge6_2u5]# <strong>cd /gridware/sge/</strong></pre>
<pre>[root@cent55-sge sge]# <strong>ls -l
</strong>total 136
drwxr-xr-x  2 root root  4096 Jan  8 12:40 3rd_party
drwxr-xr-x  3 root root  4096 Jan  8 12:48 bin
drwxr-xr-x  3 root root  4096 Jan  8 12:40 catman
drwxr-xr-x  2 root root  4096 Jan  8 12:40 ckpt
drwxr-xr-x  5 root root  4096 Jan  8 12:40 doc
drwxr-xr-x  2 root root  4096 Jan  8 12:40 dtrace
drwxr-xr-x  5 root root  4096 Jan  8 12:48 examples
drwxr-xr-x  2 root root  4096 Jan  8 12:40 hadoop
drwxr-xr-x  2 root root  4096 Jan  8 12:40 include
-rwxr-xr-x  1 root root   125 Dec 11  2009 install_execd
-rwxr-xr-x  1 root root   125 Dec 11  2009 install_qmaster
-rwxr-xr-x  1 root root 59960 Dec 11  2009 inst_sge
drwxr-xr-x  3 root root  4096 Jan  8 12:48 lib
drwxr-xr-x  6 root root  4096 Jan  8 12:40 man
drwxr-xr-x  4 root root  4096 Jan  8 12:40 mpi
drwxr-xr-x  3 root root  4096 Jan  8 12:40 pvm
drwxr-xr-x  3 root root  4096 Jan  8 12:40 qmon
-rwxr-xr-x  1 root root  1289 Dec 11  2009 start_gui_installer
drwxr-xr-x 10 root root  4096 Jan  8 12:40 util
drwxr-xr-x  3 root root  4096 Jan  8 12:48 utilbin</pre>
<p>รันคำสั่ง ./install_qmaster หรือ ./inst_sge -m เพื่อเริ่มคอนฟิก sge บนเครื่องนี้ ให้ทำหน้าที่เป็น qmaster host</p>
<pre>[root@cent55-sge sge]# <strong>./inst_sge -m
</strong>Sun Microsystems, Inc. ("Sun") SOFTWARE LICENSE AGREEMENT</pre>
<pre>READ THE TERMS OF THIS AGREEMENT ("AGREEMENT") CAREFULLY BEFORE OPENING
SOFTWARE MEDIA PACKAGE. BY OPENING SOFTWARE MEDIA PACKAGE, YOU AGREE TO THE
TERMS OF THIS AGREEMENT. IF YOU ARE ACCESSING SOFTWARE ELECTRONICALLY,
INDICATE YOUR ACCEPTANCE OF THESE TERMS BY SELECTING THE "ACCEPT" (OR
EQUIVALENT) BUTTON AT THE END OF THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL
OF THE TERMS, PROMPTLY RETURN THE UNUSED SOFTWARE TO YOUR PLACE OF PURCHASE
FOR A REFUND OR, IF SOFTWARE IS ACCESSED ELECTRONICALLY, SELECT THE
"DECLINE" (OR "EXIT") BUTTON AT THE END OF THIS AGREEMENT. IF YOU HAVE
SEPARATELY AGREED TO LICENSE TERMS ("MASTER TERMS") FOR YOUR LICENSE TO THIS
SOFTWARE, THEN SECTIONS 1-6 OF THIS AGREEMENT ("SUPPLEMENTAL LICENSE TERMS")
SHALL SUPPLEMENT AND SUPERSEDE THE MASTER TERMS IN RELATION TO THIS
SOFTWARE.</pre>
<pre>...
...</pre>
<pre>17. Records and Documentation.? During the term of the SLA and Entitlement,
and for a period of three (3) years thereafter, You agree to keep proper
records and documentation of Your compliance with the SLA and Entitlement.
Upon Sun?s reasonable request, You will provide copies of such records and
documentation to Sun for the purpose of confirming Your compliance with the
terms and conditions of the SLA and Entitlement. This section will survive
any termination of the SLA and Entitlement. You may terminate this SLA and
Entitlement at any time by destroying all copies of the Software in which
case the obligations set forth in Section 7 of the SLA shall apply.</pre>
<pre>หน้าจอแสดง LICENSE AGREEMENT ตอบ "y" เพื่อยอมรับ</pre>
<pre>Do you agree with that license? (y/n) [n] &gt;&gt; <strong>y</strong></pre>
<p>หน้าแสดงการเริ่มต้นติดตั้ง</p>
<pre>Welcome to the Grid Engine installation
---------------------------------------</pre>
<pre>Grid Engine qmaster host installation
-------------------------------------</pre>
<pre>Before you continue with the installation please read these hints:</pre>
<pre>   - Your terminal window should have a size of at least
     80x24 characters</pre>
<pre>   - The INTR character is often bound to the key Ctrl-C.
     The term &gt;Ctrl-C&lt; is used during the installation if you
     have the possibility to abort the installation</pre>
<pre>The qmaster installation procedure will take approximately 5-10 minutes.</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>เลือก user ที่ไม่ใช่ root สำหรับรัน sge</p>
<pre>Grid Engine admin user account
------------------------------</pre>
<pre>The current directory</pre>
<pre>   /gridware/sge</pre>
<pre>is owned by user</pre>
<pre>   <span style="color: #0000ff;"><strong>sgeadmin</strong></span></pre>
<pre>If user &gt;root&lt; does not have write permissions in this directory on *all*
of the machines where Grid Engine will be installed (NFS partitions not
exported for user &gt;root&lt; with read/write permissions) it is recommended to
install Grid Engine that all spool files will be created under the user id
of user &gt;sgeadmin&lt;.</pre>
<pre>IMPORTANT NOTE: The daemons still have to be started by user &gt;root&lt;.</pre>
<pre>Do you want to install Grid Engine as admin user &gt;sgeadmin&lt; (y/n) [y] &gt;&gt;</pre>
<pre>Installing Grid Engine as admin user &gt;sgeadmin&lt;
Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>ไดเรคทอรีหลักของ sge</p>
<pre>Checking $SGE_ROOT directory
----------------------------</pre>
<pre>The Grid Engine root directory is:</pre>
<pre>   $SGE_ROOT = /gridware/sge</pre>
<pre>If this directory is not correct (e.g. it may contain an automounter
prefix) enter the correct path to this directory or hit &lt;RETURN&gt;
to use default [/gridware/sge] &gt;&gt;</pre>
<pre>Your $SGE_ROOT directory: <strong><span style="color: #0000ff;">/gridware/sge</span></strong></pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>เลือกหมายเลขพอร์ตสำหรับรัน sge_qmaster</p>
<pre>Grid Engine TCP/IP communication service
----------------------------------------</pre>
<pre>The port for sge_qmaster is currently set as service.</pre>
<pre><span style="color: #0000ff;">   sge_qmaster service set to port 10500</span></pre>
<pre>Now you have the possibility to set/change the communication ports by using the
&gt;shell environment&lt; or you may configure it via a network service, configured
in local &gt;/etc/service&lt;, &gt;NIS&lt; or &gt;NIS+&lt;, adding an entry in the form</pre>
<pre>    sge_qmaster &lt;port_number&gt;/tcp</pre>
<pre>to your services database and make sure to use an unused port number.</pre>
<pre>How do you want to configure the Grid Engine communication ports?</pre>
<pre>Using the &gt;shell environment&lt;:                           [1]</pre>
<pre>Using a network service like &gt;/etc/service&lt;, &gt;NIS/NIS+&lt;: [2]</pre>
<pre>(default: 2) &gt;&gt;</pre>
<pre>Grid Engine TCP/IP service &gt;sge_qmaster&lt;
----------------------------------------</pre>
<pre>Using the service</pre>
<pre>   sge_qmaster</pre>
<pre>for communication with Grid Engine.</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p> เลือกหมายเลขพอร์ตสำหรับรัน sge_execd</p>
<pre> Grid Engine TCP/IP communication service
----------------------------------------</pre>
<pre>The port for sge_execd is currently set as service.</pre>
<pre><span style="color: #0000ff;">   sge_execd service set to port 10501</span></pre>
<pre>Now you have the possibility to set/change the communication ports by using the
&gt;shell environment&lt; or you may configure it via a network service, configured
in local &gt;/etc/service&lt;, &gt;NIS&lt; or &gt;NIS+&lt;, adding an entry in the form</pre>
<pre>    sge_execd &lt;port_number&gt;/tcp</pre>
<pre>to your services database and make sure to use an unused port number.</pre>
<pre>How do you want to configure the Grid Engine communication ports?</pre>
<pre>Using the &gt;shell environment&lt;:                           [1]</pre>
<pre>Using a network service like &gt;/etc/service&lt;, &gt;NIS/NIS+&lt;: [2]</pre>
<pre>(default: 2) &gt;&gt;</pre>
<pre> </pre>
<pre>Grid Engine TCP/IP communication service
-----------------------------------------</pre>
<pre>Using the service</pre>
<pre>   sge_execd</pre>
<pre>for communication with Grid Engine.</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>ตั้งชื่อ cell ในที่นี้จะตั้งเป็น MyCell</p>
<p>หมายเหตุ ชื่อ cell ใช้ในการจัดกลุ่มเพื่อส่งงานระหว่าง qmaster host และ execution host</p>
<pre> Grid Engine cells
-----------------</pre>
<pre>Grid Engine supports multiple cells.</pre>
<pre>If you are not planning to run multiple Grid Engine clusters or if you don't
know yet what is a Grid Engine cell it is safe to keep the default cell name</pre>
<pre>   default</pre>
<pre>If you want to install multiple cells you can enter a cell name now.</pre>
<pre>The environment variable</pre>
<pre>   $SGE_CELL=&lt;your_cell_name&gt;</pre>
<pre>will be set for all further Grid Engine commands.</pre>
<pre>Enter cell name [default] &gt;&gt; <strong><span style="color: #000000;">MyCell</span></strong></pre>
<pre>Using cell &gt;MyCell&lt;.
Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>ตั้งชื่อ cluster ในที่นี้ตั้งเป็น MyCluster</p>
<pre>Unique cluster name
-------------------</pre>
<pre>The cluster name uniquely identifies a specific Sun Grid Engine cluster.
The cluster name must be unique throughout your organization. The name
is not related to the SGE cell.</pre>
<pre>The cluster name must start with a letter ([A-Za-z]), followed by letters,
digits ([0-9]), dashes (-) or underscores (_).</pre>
<pre>Enter new cluster name or hit &lt;RETURN&gt;
to use default [p10500] &gt;&gt; <strong>MyCluster</strong></pre>
<pre>creating directory: /gridware/sge/MyCell/common</pre>
<pre>Your $SGE_CLUSTER_NAME: MyCluster</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>ไดเรคทอรี spool ของ qmaster</p>
<pre> Grid Engine qmaster spool directory
-----------------------------------</pre>
<pre>The qmaster spool directory is the place where the qmaster daemon stores
the configuration and the state of the queuing system.</pre>
<pre>The admin user &gt;sgeadmin&lt; must have read/write access
to the qmaster spool directory.</pre>
<pre>If you will install shadow master hosts or if you want to be able to start
the qmaster daemon on other hosts (see the corresponding section in the
Grid Engine Installation and Administration Manual for details) the account
on the shadow master hosts also needs read/write access to this directory.</pre>
<pre>Enter a qmaster spool directory [<strong><span style="color: #0000ff;">/gridware/sge/MyCell/spool/qmaster</span></strong>] &gt;&gt;</pre>
<pre>Using qmaster spool directory &gt;/gridware/sge/MyCell/spool/qmaster&lt;.
Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>จะรัน sge บนเครื่อง Windows ด้วยหรือไม่</p>
<pre>Windows Execution Host Support
------------------------------</pre>
<pre>Are you going to install Windows Execution Hosts? (y/n) [n] &gt;&gt;</pre>
<p>ตรวจสอบไฟล์ permission</p>
<pre>Verifying and setting file permissions
--------------------------------------</pre>
<pre>Did you install this version with &gt;pkgadd&lt; or did you already verify
and set the file permissions of your distribution (enter: y) (y/n) [y] &gt;&gt;</pre>
<pre>We do not verify file permissions. Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>คารใช้ DNS domain ชื่อเดียวกัน</p>
<pre>Select default Grid Engine hostname resolving method
----------------------------------------------------</pre>
<pre>Are all hosts of your cluster in one DNS domain? If this is
the case the hostnames</pre>
<pre>   &gt;hostA&lt; and &gt;hostA.foo.com&lt;</pre>
<pre>would be treated as equal, because the DNS domain name &gt;foo.com&lt;
is ignored when comparing hostnames.</pre>
<pre>Are all hosts of your cluster in a single DNS domain (y/n) [y] &gt;&gt;</pre>
<pre>Ignoring domain name when comparing hostnames.</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>จะเปิดการใช้ Grid Engine JMX MBean server หรือไม่ ในที่นี้จะตอบ &#8220;n&#8221; คือไม่ใช้</p>
<pre>Grid Engine JMX MBean server
----------------------------</pre>
<pre>In order to use the SGE Inspect or the Service Domain Manager (SDM)
SGE adapter you need to configure a JMX server in qmaster. Qmaster
will then load a Java Virtual Machine through a shared library.
NOTE: Java 1.5 or later is required for the JMX MBean server.</pre>
<pre>Do you want to enable the JMX MBean server (y/n) [y] &gt;&gt; <strong>n</strong></pre>
<p>โปรแกรมจะเริ่มสร้างไฟล์ ไดเรคทอรี ต่างๆ ที่จะใช้</p>
<pre>Making directories
------------------</pre>
<pre>creating directory: /gridware/sge/MyCell/spool/qmaster
creating directory: /gridware/sge/MyCell/spool/qmaster/job_scripts
Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>เลือกวิธีการ spooling</p>
<pre>Setup spooling
--------------
Your SGE binaries are compiled to link the spooling libraries
during runtime (dynamically). So you can choose between Berkeley DB
spooling and Classic spooling method.
Please choose a spooling method (berkeleydb|classic) [berkeleydb] &gt;&gt;</pre>
<pre>The Berkeley DB spooling method provides two configurations!</pre>
<pre>Local spooling:
The Berkeley DB spools into a local directory on this host (qmaster host)
This setup is faster, but you can't setup a shadow master host</pre>
<pre>Berkeley DB Spooling Server:
If you want to setup a shadow master host, you need to use
Berkeley DB Spooling Server!
In this case you have to choose a host with a configured RPC service.
The qmaster host connects via RPC to the Berkeley DB. This setup is more
failsafe, but results in a clear potential security hole. RPC communication
(as used by Berkeley DB) can be easily compromised. Please only use this
alternative if your site is secure or if you are not concerned about
security. Check the installation guide for further advice on how to achieve
failsafety without compromising security.</pre>
<pre>Do you want to use a Berkeley DB Spooling Server? (y/n) [n] &gt;&gt;</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<pre>Berkeley Database spooling parameters
-------------------------------------</pre>
<pre>Please enter the database directory now, even if you want to spool locally,
it is necessary to enter this database directory.</pre>
<pre>Default: [<span style="color: #0000ff;">/gridware/sge/MyCell/spool/spooldb</span>] &gt;&gt;</pre>
<pre>creating directory: /gridware/sge/MyCell/spool/spooldb
Dumping bootstrapping information
Initializing spooling database</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>ขอบเขตของ group id เพิ่มเติม ที่ sge ใช้</p>
<pre>Grid Engine group id range
--------------------------</pre>
<pre>When jobs are started under the control of Grid Engine an additional group id
is set on platforms which do not support jobs. This is done to provide maximum
control for Grid Engine jobs.</pre>
<pre>This additional UNIX group id range must be unused group id's in your system.
Each job will be assigned a unique id during the time it is running.
Therefore you need to provide a range of id's which will be assigned
dynamically for jobs.</pre>
<pre>The range must be big enough to provide enough numbers for the maximum number
of Grid Engine jobs running at a single moment on a single host. E.g. a range
like &gt;20000-20100&lt; means, that Grid Engine will use the group ids from
20000-20100 and provides a range for 100 Grid Engine jobs at the same time
on a single host.</pre>
<pre>You can change at any time the group id range in your cluster configuration.</pre>
<pre>Please enter a range [<span style="color: #0000ff;">20000-20100</span>] &gt;&gt;</pre>
<pre>Using &gt;20000-20100&lt; as gid range. Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<pre>Grid Engine cluster configuration
---------------------------------</pre>
<pre>Please give the basic configuration parameters of your Grid Engine
installation:</pre>
<pre>   &lt;execd_spool_dir&gt;</pre>
<pre>The pathname of the spool directory of the execution hosts. User &gt;sgeadmin&lt;
must have the right to create this directory and to write into it.</pre>
<pre>Default: [<span style="color: #0000ff;">/gridware/sge/MyCell/spool</span>] &gt;&gt;</pre>
<p>อีเมล์สำหรับการแจ้งปัญหา</p>
<pre>Grid Engine cluster configuration (continued)
---------------------------------------------</pre>
<pre>&lt;administrator_mail&gt;</pre>
<pre>The email address of the administrator to whom problem reports are sent.</pre>
<pre>It is recommended to configure this parameter. You may use &gt;none&lt;
if you do not wish to receive administrator mail.</pre>
<pre>Please enter an email address in the form &gt;user@foo.com&lt;.</pre>
<pre>Default: [none] &gt;&gt;</pre>
<pre> </pre>
<pre>The following parameters for the cluster configuration were configured:</pre>
<pre>   execd_spool_dir        /gridware/sge/MyCell/spool
   administrator_mail     none</pre>
<pre>Do you want to change the configuration parameters (y/n) [n] &gt;&gt;</pre>
<p>การสร้างไฟล์คอนฟิก</p>
<pre>Creating local configuration
----------------------------
Creating &gt;act_qmaster&lt; file
Adding default complex attributes
Adding default parallel environments (PE)
Adding SGE default usersets
Adding &gt;sge_aliases&lt; path aliases file
Adding &gt;qtask&lt; qtcsh sample default request file
Adding &gt;sge_request&lt; default submit options file
Creating &gt;sgemaster&lt; script
Creating &gt;sgeexecd&lt; script
Creating settings files for &gt;.profile/.cshrc&lt;</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>สร้าง startup script เวลาบู๊ตเครื่อง</p>
<pre>qmaster startup script
----------------------</pre>
<pre>We can install the startup script that will
start qmaster at machine boot (y/n) [y] &gt;&gt;</pre>
<pre>cp /gridware/sge/MyCell/common/sgemaster /etc/init.d/sgemaster.MyCluster
/usr/lib/lsb/install_initd /etc/init.d/sgemaster.MyCluster</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>รันเซอร์วิส sge_qmaster</p>
<pre>Grid Engine qmaster startup
---------------------------</pre>
<pre>Starting qmaster daemon. Please wait ...
   starting sge_qmaster</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>ระบุชื่อ host สำหรับรันโปรแกรม sge_execd ในที่นี้จะใส่สองเครื่องคือ &#8220;cent55-node1&#8243; และ &#8220;cent55-node2&#8243;</p>
<pre>Adding Grid Engine hosts
------------------------</pre>
<pre>Please now add the list of hosts, where you will later install your execution
daemons. These hosts will be also added as valid submit hosts.</pre>
<pre>Please enter a blank separated list of your execution hosts. You may
press &lt;RETURN&gt; if the line is getting too long. Once you are finished
simply press &lt;RETURN&gt; without entering a name.</pre>
<pre>You also may prepare a file with the hostnames of the machines where you plan
to install Grid Engine. This may be convenient if you are installing Grid
Engine on many hosts.</pre>
<pre>Do you want to use a file which contains the list of hosts (y/n) [n] &gt;&gt;</pre>
<p>ใส่ชื่อเครื่อง cent55-node1</p>
<pre>Adding admin and submit hosts
-----------------------------</pre>
<pre>Please enter a blank seperated list of hosts.</pre>
<pre>Stop by entering &lt;RETURN&gt;. You may repeat this step until you are
entering an empty list. You will see messages from Grid Engine
when the hosts are added.</pre>
<pre>Host(s): <strong>cent55-node1
</strong>cent55-node1.spalinux.com added to administrative host list
cent55-node1.spalinux.com added to submit host list</pre>
<p>ใส่ชื่อเครื่อง cent55-node2</p>
<pre>Adding admin and submit hosts
-----------------------------</pre>
<pre>Please enter a blank seperated list of hosts.</pre>
<pre>Stop by entering &lt;RETURN&gt;. You may repeat this step until you are
entering an empty list. You will see messages from Grid Engine
when the hosts are added.</pre>
<pre>Host(s): <strong>cent55-node2
</strong>cent55-node2.spalinux.com added to administrative host list
cent55-node2.spalinux.com added to submit host list
Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>เมื่อใส่ชื่อเครื่องหมดแล้ว กด [enter] ผ่าน</p>
<pre>Adding admin and submit hosts
-----------------------------</pre>
<pre>Please enter a blank seperated list of hosts.</pre>
<pre>Stop by entering &lt;RETURN&gt;. You may repeat this step until you are
entering an empty list. You will see messages from Grid Engine
when the hosts are added.</pre>
<pre>Host(s):
Finished adding hosts. Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>ระบุชื่อเครื่องเพิ่มเติมสำหรับ shadow host ในที่นี้ไม่ได้ใช้</p>
<pre>If you want to use a shadow host, it is recommended to add this host
to the list of administrative hosts.</pre>
<pre>If you are not sure, it is also possible to add or remove hosts after the
installation with &lt;qconf -ah hostname&gt; for adding and &lt;qconf -dh hostname&gt;
for removing this host</pre>
<pre>Attention: This is not the shadow host installation
procedure.
You still have to install the shadow host separately</pre>
<pre>Do you want to add your shadow host(s) now? (y/n) [y] &gt;&gt;</pre>
<pre>Adding Grid Engine shadow hosts
-------------------------------</pre>
<pre>Please now add the list of hosts, where you will later install your shadow
daemon.</pre>
<pre>Please enter a blank separated list of your execution hosts. You may
press &lt;RETURN&gt; if the line is getting too long. Once you are finished
simply press &lt;RETURN&gt; without entering a name.</pre>
<pre>You also may prepare a file with the hostnames of the machines where you plan
to install Grid Engine. This may be convenient if you are installing Grid
Engine on many hosts.</pre>
<pre>Do you want to use a file which contains the list of hosts (y/n) [n] &gt;&gt;</pre>
<pre>Adding admin hosts
------------------</pre>
<pre>Please enter a blank seperated list of hosts.</pre>
<pre>Stop by entering &lt;RETURN&gt;. You may repeat this step until you are
entering an empty list. You will see messages from Grid Engine
when the hosts are added.</pre>
<pre>Host(s):
Finished adding hosts. Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<pre>Creating the default &lt;all.q&gt; queue and &lt;allhosts&gt; hostgroup
-----------------------------------------------------------</pre>
<pre>root@cent55-sge.spalinux.com added "@allhosts" to host group list
root@cent55-sge.spalinux.com added "all.q" to cluster queue list</pre>
<pre>Hit &lt;RETURN&gt; to continue &gt;&gt;</pre>
<p>การคอนฟิก Scheduler Tuning</p>
<pre>Scheduler Tuning
----------------</pre>
<pre>The details on the different options are described in the manual.</pre>
<pre>Configurations
--------------
1) Normal
          Fixed interval scheduling, report limited scheduling information,
          actual + assumed load</pre>
<pre>2) High
          Fixed interval scheduling, report limited scheduling information,
          actual load</pre>
<pre>3) Max
          Immediate Scheduling, report no scheduling information,
          actual load</pre>
<pre>Enter the number of your preferred configuration and hit &lt;RETURN&gt;!
Default configuration is [1] &gt;&gt;</pre>
<pre> </pre>
<pre>We're configuring the scheduler with &gt;Normal&lt; settings!
Do you agree? (y/n) [y] &gt;&gt;</pre>
<p>แนะวิธีการใช้ sge</p>
<pre>Using Grid Engine
-----------------</pre>
<pre>You should now enter the command:</pre>
<pre>   source /gridware/sge/MyCell/common/settings.csh</pre>
<pre>if you are a csh/tcsh user or</pre>
<pre>   # . /gridware/sge/MyCell/common/settings.sh</pre>
<pre>if you are a sh/ksh user.</pre>
<pre>This will set or expand the following environment variables:</pre>
<pre>   - $SGE_ROOT         (always necessary)
   - $SGE_CELL         (if you are using a cell other than &gt;default&lt;)
   - $SGE_CLUSTER_NAME (always necessary)
   - $SGE_QMASTER_PORT (if you haven't added the service &gt;sge_qmaster&lt;)
   - $SGE_EXECD_PORT   (if you haven't added the service &gt;sge_execd&lt;)
   - $PATH/$path       (to find the Grid Engine binaries)
   - $MANPATH          (to access the manual pages)</pre>
<pre>Hit &lt;RETURN&gt; to see where Grid Engine logs messages &gt;&gt;</pre>
<pre>Grid Engine messages
--------------------</pre>
<pre>Grid Engine messages can be found at:</pre>
<pre>   /tmp/qmaster_messages (during qmaster startup)
   /tmp/execd_messages   (during execution daemon startup)</pre>
<pre>After startup the daemons log their messages in their spool directories.</pre>
<pre>   Qmaster:     /gridware/sge/MyCell/spool/qmaster/messages
   Exec daemon: &lt;execd_spool_dir&gt;/&lt;hostname&gt;/messages</pre>
<pre>Grid Engine startup scripts
---------------------------</pre>
<pre>Grid Engine startup scripts can be found at:</pre>
<pre>   /gridware/sge/MyCell/common/sgemaster (qmaster)
   /gridware/sge/MyCell/common/sgeexecd (execd)</pre>
<pre>Do you want to see previous screen about using Grid Engine again (y/n) [n] &gt;&gt;</pre>
<pre> </pre>
<pre>Your Grid Engine qmaster installation is now completed
------------------------------------------------------</pre>
<pre>Please now login to all hosts where you want to run an execution daemon
and start the execution host installation procedure.</pre>
<pre>If you want to run an execution daemon on this host, please do not forget
to make the execution host installation in this host as well.</pre>
<pre>All execution hosts must be administrative hosts during the installation.
All hosts which you added to the list of administrative hosts during this
installation procedure can now be installed.</pre>
<pre>You may verify your administrative hosts with the command</pre>
<pre>   # qconf -sh</pre>
<pre>and you may add new administrative hosts with the command</pre>
<pre>   # qconf -ah &lt;hostname&gt;</pre>
<pre>Please hit &lt;RETURN&gt; &gt;&gt;</pre>
<p>ใช้คำสั่ง ps ตรวจสอบโปรเซส sge_qmaster</p>
<pre>[root@cent55-sge sge]# <strong>ps -ef | grep sge
</strong>sgeadmin  4667     1  1 13:55 ?        00:00:00 /gridware/sge/bin/lx24-amd64/sge_qmaster</pre>
<h4>การเปิด/ปิด เซอร์วิส sge_qmaster</h4>
<p>การปิดเซอร์วิส sge_qmaster</p>
<pre>[root@cent55-sge ~]# <strong>/etc/init.d/sgemaster.MyCluster stop
</strong>   shutting down Grid Engine qmaster</pre>
<p>การเปิดหรือรันเซอร์วิส qmaster</p>
<pre>[root@cent55-sge ~]# <strong>/etc/init.d/sgemaster.MyCluster start
</strong>   starting sge_qmaster</pre>
<h4>ข้อมูลอ้างอิง</h4>
<ul>
<li><a href="http://spalinux.com/2011/01/install_sun_grid_engine_on_centos_5-5">ติดตั้ง Sun Grid Engine บน CentOS 5.5</a></li>
<li><a href="http://spalinux.com/2011/01/configure_sun_grid_engine_execd_host">คอนฟิก Sun Grid Engine execution (execd) host</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2011/01/configure_sun_grid_engine_qmaster_host/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ติดตั้ง Sun Grid Engine บน CentOS 5.5</title>
		<link>http://spalinux.com/2011/01/install_sun_grid_engine_on_centos_5-5</link>
		<comments>http://spalinux.com/2011/01/install_sun_grid_engine_on_centos_5-5#comments</comments>
		<pubDate>Sat, 08 Jan 2011 18:03:59 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Cluster]]></category>
		<category><![CDATA[Grid]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Oracle Grid Engine]]></category>
		<category><![CDATA[Sun Grid Engine]]></category>

		<guid isPermaLink="false">http://spalinux.com/?p=1226</guid>
		<description><![CDATA[Sun Grid Engine (SGE) หรือชื่อใหม่ Oracle Grid Engine เป็นโปรแกรมที่ใช้ควบคุม จัดการ การกระจายงาน (job) ไปรันตามเครื่องต่างๆ (distributed resource management) ในระบบ Sun Grid Engine ประกอบด้วยเครื่องที่ทำหน้าที่ควบคุมการส่ง job ที่เรียกว่า &#8220;sge qmaster&#8221; อย่างน้อยหนึ่งเครื่อง ส่วนเครื่องที่ทำหน้าที่รัน job เรียกว่า &#8220;sge execution host&#8221; หรือ &#8220;sge execd&#8221; มีหลายๆ เครื่อง ช่วยกันรันงานที่ได้รับมาจาก &#8220;qmaster&#8221; เวอร์ชั่น open source ที่สามารถดาวน์โหลดมาใช้งานได้อย่างถูกต้องล่าสุดคือ 6.2u5 ส่วนเวอร์ชั่นที่ใหม่กว่านี้ทาง Oracle ให้ทดลองใช้ได้ 90 วัน และขายเป็น commercial ใช้ google.com ค้นหา &#8220;Sun [...]]]></description>
			<content:encoded><![CDATA[<p>Sun Grid Engine (SGE) หรือชื่อใหม่ Oracle Grid Engine เป็นโปรแกรมที่ใช้ควบคุม จัดการ การกระจายงาน (job) ไปรันตามเครื่องต่างๆ (distributed resource management)</p>
<p>ในระบบ Sun Grid Engine ประกอบด้วยเครื่องที่ทำหน้าที่ควบคุมการส่ง job ที่เรียกว่า &#8220;sge qmaster&#8221; อย่างน้อยหนึ่งเครื่อง</p>
<p>ส่วนเครื่องที่ทำหน้าที่รัน job เรียกว่า &#8220;sge execution host&#8221; หรือ &#8220;sge execd&#8221; มีหลายๆ เครื่อง ช่วยกันรันงานที่ได้รับมาจาก &#8220;qmaster&#8221;</p>
<p><span id="more-1226"></span>เวอร์ชั่น open source ที่สามารถดาวน์โหลดมาใช้งานได้อย่างถูกต้องล่าสุดคือ 6.2u5 ส่วนเวอร์ชั่นที่ใหม่กว่านี้ทาง Oracle ให้ทดลองใช้ได้ 90 วัน และขายเป็น commercial</p>
<p>ใช้ google.com ค้นหา &#8220;Sun Grid Engine 6.2 Update 5 download&#8221; เพื่อดาวน์โหลดไฟล์รูปแบบ rpm สำหรับติดตั้งบน Linux x64 จาก Download Center</p>
<p>ข้อมูลไฟล์ที่เลือกดาวน์โหลดในหน้า Download Sun Grid Engine 6.2 Update 5 for Linux, English</p>
<ul>
<li>File Description: Sun Grid Engine 6.2 Update 5, Linux x64 (required), rpm format</li>
<li>File Name: sge62u5_linux24-x64_rpm.zip</li>
<li>Size: 28.16 MB</li>
</ul>
<h4>ระบบทดสอบ</h4>
<p>ในที่นี้ใช้ CentOS 5.5 (x64) โดยลง package group ตามนี้</p>
<ul>
<li>Base</li>
<li>Development Tools</li>
<li>Editors</li>
<li>GNOME Desktop Environment</li>
<li>X Window System</li>
</ul>
<h4>ติดตั้งไฟล์ rpm</h4>
<p>ตัวอย่างไฟล์ที่ดาวน์โหลด</p>
<pre>[root@cent55-sge sge]# <strong>ls -l
</strong>total 28844
-rw-r--r-- 1 root root 29533073 Jan  8 12:36 sge62u5_linux24-x64_rpm.zip</pre>
<p>แตกไฟล์ด้วยคำสั่ง unzip</p>
<pre>[root@cent55-sge sge]# <strong>unzip sge62u5_linux24-x64_rpm.zip
</strong>Archive:  sge62u5_linux24-x64_rpm.zip
  inflating: sge6_2u5/sun-sge-bin-linux24-x64-6.2-5.x86_64.rpm
  inflating: sge6_2u5/sun-sge-common-6.2-5.noarch.rpm</pre>
<p>ไฟล์ที่แตกได้จะมีสองไฟล์</p>
<pre>[root@cent55-sge sge]# <strong>cd sge6_2u5/</strong></pre>
<pre>[root@cent55-sge sge6_2u5]# <strong>ls -l</strong>
total 29048
-rw-r--r-- 1 root root 25583219 Dec 16  2009 sun-sge-bin-linux24-x64-6.2-5.x86_64.rpm
-rw-r--r-- 1 root root  4161238 Dec 16  2009 sun-sge-common-6.2-5.noarch.rpm</pre>
<p>ทุกเครื่องไม่ว่าจะเป็น qmaster host  หรือ execution host จะต้องติดตั้งไฟล์ rpm ทั้งสองนี้</p>
<p>ติดตั้งไฟล์ &#8220;sun-sge-common&#8221; ก่อน</p>
<pre>[root@cent55-sge sge6_2u5]# <strong>rpm -ivh sun-sge-common-6.2-5.noarch.rpm
</strong>Preparing...                ########################################### [100%]
   1:sun-sge-common         ########################################### [100%]</pre>
<p>ติดตั้งไฟล์ &#8220;sun-sge-bin-linux24-x64&#8243;</p>
<pre>[root@cent55-sge sge6_2u5]# <strong>rpm -ivh sun-sge-bin-linux24-x64-6.2-5.x86_64.rpm
</strong><span style="color: #ff0000;">error: Failed dependencies:</span>
        libXm.so.3()(64bit) is needed by sun-sge-bin-linux24-x64-6.2-5.x86_64
        libXp.so.6()(64bit) is needed by sun-sge-bin-linux24-x64-6.2-5.x86_64</pre>
<p>หากเจอ &#8220;error&#8221; แบบนี้ ต้องติดตั้ง library ที่ฟ้องขึ้นมาก่อน ในที่นี้ทั้งสอง library สามารถติดตั้งไฟล์ rpm จากแผ่นติดตั้ง CentOS 5.5 ได้</p>
<pre>[root@cent55-sge sge6_2u5]# <strong>mount /dev/cdrom /media
</strong>mount: block device /dev/cdrom is write-protected, mounting read-only</pre>
<pre>[root@cent55-sge sge6_2u5]# <strong>cd /media/CentOS/</strong></pre>
<p>สำหรับ &#8220;libXm.so.3&#8243; ต้องติดตั้งไฟล์ rpm ชื่อ &#8220;openmotif22-2.2.3-18.x86_64.rpm&#8221;</p>
<pre>[root@cent55-sge CentOS]# <strong>rpm -ivh openmotif22-2.2.3-18.x86_64.rpm
</strong>Preparing...                ########################################### [100%]
   1:openmotif22            ########################################### [100%]</pre>
<p>หมายเหตุ ในแผ่นดีวีดีติดตั้ง CentOS 5.5 (x64) จะมีไฟล์ rpm ติดตั้ง openmotif อยู่สองเวอร์ชั่น เนื่องจาก sge ใช้ libXm.so.3 ซึ่งมีอยู่ในไฟล์ &#8220;openmotif22-2.2.3&#8243; เลยต้องติดตั้งไฟล์เวอร์ชั่นนี้  ส่วน &#8220;openmotif-2.3.1&#8243; เวอร์ชั่นของ libXm จะเป็น &#8220;libXm.so.4&#8243; ไม่สามารถใช้กับ sge ได้</p>
<p>ใช้คำสั่ง rpm ดูไฟล์ที่จะติดตั้ง เพื่อเปรียบเทียบเวอร์ชั่นของ &#8220;libXm&#8221;</p>
<pre>[root@cent55-sge CentOS]# <strong>rpm -qilp openmotif22-2.2.3-18.x86_64.rpm | grep libXm
</strong>/usr/lib64/libXm.so.3
/usr/lib64/libXm.so.3.0.2</pre>
<pre>[root@cent55-sge CentOS]# <strong>rpm -qilp openmotif-2.3.1-2.el5_4.1.x86_64.rpm | grep libXm
</strong>/usr/lib64/libXm.so.4
/usr/lib64/libXm.so.4.0.1</pre>
<p>สำหรับ &#8220;libXp&#8221; ต้องติดตั้งไฟล์ rpm ชื่อ &#8220;libXp-1.0.0-8.1.el5.x86_64.rpm&#8221;</p>
<pre>[root@cent55-sge CentOS]# <strong>rpm -ivh libXp-1.0.0-8.1.el5.x86_64.rpm
</strong>Preparing...                ########################################### [100%]
   1:libXp                  ########################################### [100%]</pre>
<p>ทดลองติดตั้ง sge อีกครั้ง</p>
<pre>[root@cent55-sge CentOS]# <strong>cd -
</strong>/root/sge/sge6_2u5</pre>
<pre>[root@cent55-sge sge6_2u5]# <strong>rpm -ivh sun-sge-bin-linux24-x64-6.2-5.x86_64.rpm
</strong>Preparing...                ########################################### [100%]
   1:sun-sge-bin-linux24-x64########################################### [100%]</pre>
<h4>คอนฟิกเบื้องต้นสำหรับ sge</h4>
<p>สร้าง user และ group สำหรับรัน sge</p>
<pre>[root@cent55-sge sge6_2u5]# <strong>groupadd sgeadmin
</strong>[root@cent55-sge sge6_2u5]# <strong>useradd -g sgeadmin sgeadmin
</strong>[root@cent55-sge sge6_2u5]# <strong>id sgeadmin
</strong>uid=502(sgeadmin) gid=500(sgeadmin) groups=500(sgeadmin)</pre>
<p>ตั้งค่า PATH การติดตั้ง sge</p>
<pre>[root@cent55-sge sge6_2u5]# <strong>export SGE_ROOT=/gridware/sge
</strong>[root@cent55-sge sge6_2u5]# <strong>echo $SGE_ROOT</strong></pre>
<p>เปลี่ยน user group ของ PATH ที่จะติดตั้งเป็น sgeadmin</p>
<pre>[root@cent55-sge sge]# <strong>chown sgeadmin.sgeadmin /gridware/sge</strong></pre>
<p>ต้องแก้ไขไฟล์ /etc/hosts เพื่อ map ชื่อ hostname ของเครื่องที่ทำหน้าที่เป็น qmaster host จาก 127.0.0.1 เป็น IP Address ของพอร์ต LAN</p>
<pre>[root@cent55-sge sge6_2u5]# <strong>cat /etc/hosts
</strong># Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1        cent55-sge.spalinux.com cent55-sge localhost.localdomain localhost
::1              localhost6.localdomain6 localhost6</pre>
<p>สมมติว่าพอร์ต LAN ของเครื่องนี้ IP คือ 192.168.55.10 ต้องแก้ไขไฟล์นี้เป็นดังนี้</p>
<p>เพื่อความสะดวก แนะนำให้เพิ่มชื่อเครื่องและ IP address ที่จะทำหน้าที่เป็น execution host ด้วยเลย</p>
<pre>[root@cent55-sge sge6_2u5]# <strong>cat /etc/hosts
</strong># Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1        localhost.localdomain localhost
::1              localhost6.localdomain6 localhost6
192.168.55.10    cent55-sge.spalinux.com cent55-sge</pre>
<pre>192.168.55.11    cent55-node1.spalinux.com cent55-node1
192.168.55.12    cent55-node2.spalinux.com cent55-node2</pre>
<p> เพิ่มชื่อและหมายเลขพอร์ตสำหรับ sge ในไฟล์ /etc/services</p>
<pre>[root@cent55-sge sge6_2u5]# <strong>cat /etc/services
</strong>...
# Local services
<strong><span style="color: #0000ff;">sge_qmaster 10500/tcp
sge_execd   10501/tcp</span></strong></pre>
<h4>ข้อมูลอ้างอิง</h4>
<ul>
<li><a href="http://www.oracle.com/us/products/tools/oracle-grid-engine-075549.html" target="_blank">Oracle Grid Engine</a></li>
<li><a href="http://en.wikipedia.org/wiki/Oracle_Grid_Engine" target="_blank">Oracle Grid Engine &#8211; Wikipedia</a></li>
<li><a href="http://www.globusconsortium.org/tutorial/ch3/page_4.php" target="_blank">Globus Toolkit Tutorial &#8211; Chapter 3: Deploying Sun Grid Engine (SGE)</a></li>
<li><a href="http://spalinux.com/2011/01/configure_sun_grid_engine_qmaster_host">คอนฟิก Sun Grid Engine qmaster host</a></li>
<li><a href="http://spalinux.com/2011/01/configure_sun_grid_engine_execd_host">คอนฟิก Sun Grid Engine execution (execd) host</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2011/01/install_sun_grid_engine_on_centos_5-5/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>การใช้งาน DRBD เบื้องต้น</title>
		<link>http://spalinux.com/2010/02/basic_using_drbd</link>
		<comments>http://spalinux.com/2010/02/basic_using_drbd#comments</comments>
		<pubDate>Sat, 06 Feb 2010 11:09:40 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Backup]]></category>
		<category><![CDATA[Cluster]]></category>
		<category><![CDATA[Disk]]></category>
		<category><![CDATA[Filesystem]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[drbd]]></category>
		<category><![CDATA[linux ha]]></category>

		<guid isPermaLink="false">http://spalinux.com/?p=1072</guid>
		<description><![CDATA[จากบทความ ติดตั้งและคอนฟิก DRBD  เราได้คอนฟิกเป็นแบบ Single-primary mode คือ ณ เวลาใดเวลาหนึ่ง มีเครื่องเดียวเท่านั้นที่สามารถ อ่าน เขียน ข้อมูลได้ ดังนั้นขณะที่เครื่องที่ 1 (centos54-a) ทำหน้าที่เป็น primary ของดิสก์ drbd0 อยู่  เครื่องที่ 2 (centos54-b) จะไม่สามารถ mount ดิสก์ drbd0 นี้ขึ้นมาใช้งานได้ ในบทความนี้จะแสดงการทดสอบใช้คำสั่งเพื่อเปลี่ยนโหมด Primary, Secondary ระหว่างเครื่องทั้งสอง ตรวจสอบสถานะบนเครื่อง centos54-a [root@centos54-a ~]# service drbd status drbd driver loaded OK; device status: version: 8.3.2 (api:88/proto:86-90) GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 [...]]]></description>
			<content:encoded><![CDATA[<p>จากบทความ <a href="http://spalinux.com/2010/02/install_and_configure_drbd">ติดตั้งและคอนฟิก DRBD </a> เราได้คอนฟิกเป็นแบบ Single-primary mode คือ ณ เวลาใดเวลาหนึ่ง มีเครื่องเดียวเท่านั้นที่สามารถ อ่าน เขียน ข้อมูลได้</p>
<p>ดังนั้นขณะที่เครื่องที่ 1 (centos54-a) ทำหน้าที่เป็น primary ของดิสก์ drbd0 อยู่  เครื่องที่ 2 (centos54-b) จะไม่สามารถ mount ดิสก์ drbd0 นี้ขึ้นมาใช้งานได้</p>
<p>ในบทความนี้จะแสดงการทดสอบใช้คำสั่งเพื่อเปลี่ยนโหมด Primary, Secondary ระหว่างเครื่องทั้งสอง</p>
<p>ตรวจสอบสถานะบนเครื่อง centos54-a</p>
<pre>[root@centos54-a ~]# <strong>service drbd status
</strong>drbd driver loaded OK; device status:
version: 8.3.2 (api:88/proto:86-90)
GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 14:07:55
m:res  cs         ro                 ds                 p  mounted  fstype
0:r0   Connected  Primary/Secondary  UpToDate/UpToDate  C  /export  ext3</pre>
<pre>[root@centos54-a ~]# df -h /export
Filesystem            Size  Used Avail Use% Mounted on
/dev/drbd0            950M   18M  885M   2% /export</pre>
<p>ทดสอบ mount ดิสก์บนเครื่อง centos54-b</p>
<pre>[root@centos54-b ~]# <strong>service drbd status
</strong>drbd driver loaded OK; device status:
version: 8.3.2 (api:88/proto:86-90)
GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 14:07:55
m:res  cs         ro                 ds                 p  mounted  fstype
0:r0   Connected  Secondary/Primary  UpToDate/UpToDate  C</pre>
<pre>[root@centos54-b ~]# mount /dev/drbd0 /export
mount: block device /dev/drbd0 is write-protected, mounting read-only
mount: Wrong medium type</pre>
<p>ในกรณีที่ต้องการเปลี่ยนให้เครื่องที่ 2 (centos54-b) ทำหน้าที่เป็น primary  เช่นในกรณีที่ต้องการซ่อมบำรุงเครื่องที่ 1 สามารถทำได้ดังนี้</p>
<p>บนเครื่องที่ 1 ปิดเซอร์วิส DRBD</p>
<pre>[root@centos54-a ~]# <strong>service drbd stop
</strong>Stopping all DRBD resources:
.
[root@centos54-a ~]# <strong>service drbd status
</strong>drbd not loaded</pre>
<p>ตรวจสอบสถานะบนเครื่องที่ 2 หลังจากปิดเซอร์วิสบนเครื่องที่ 1</p>
<pre>[root@centos54-b ~]# <strong>service drbd status
</strong>drbd driver loaded OK; device status:
version: 8.3.2 (api:88/proto:86-90)
GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 14:07:55
m:res  cs            ro                 ds                 p  mounted  fstype
0:r0   WFConnection  <strong><span style="color: #0000ff;">Secondary</span></strong>/Unknown  UpToDate/DUnknown  C</pre>
<p>แม้เครื่อง Primary ปิดไปแล้ว บนเครื่องที่ 2 ที่ยังอยู่ในโหมด Secondary ก็ยัง mount ดิสก์ ไม่ได้</p>
<pre>[root@centos54-b ~]# <strong>mount /dev/drbd0 /export
</strong>mount: block device /dev/drbd0 is write-protected, mounting read-only
mount: Wrong medium type</pre>
<p>ต้องเปลี่ยนสถานะบนเครื่องที่ 2 ให้เป็น primary ด้วยคำสั่ง drbdadm primary</p>
<pre>[root@centos54-b ~]# <strong>drbdadm primary all</strong></pre>
<p>ตรวจสอบสถานะบนเครื่องที่ 2</p>
<pre>[root@centos54-b ~]# <strong>service drbd status
</strong>drbd driver loaded OK; device status:
version: 8.3.2 (api:88/proto:86-90)
GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 14:07:55
m:res  cs            ro               ds                 p  mounted  fstype
0:r0   WFConnection  <span style="color: #0000ff;"><strong>Primary</strong></span>/Unknown  UpToDate/DUnknown  C</pre>
<p>เมื่ออยู่ในโหมด primary แล้ว ก็สามารถ mount ดิสก์ขึ้นมาใช้งานได้</p>
<pre>[root@centos54-b ~]# <strong>mount /dev/drbd0 /export
</strong>[root@centos54-b ~]# <strong>df -h /export
</strong>Filesystem            Size  Used Avail Use% Mounted on
/dev/drbd0            950M   18M  885M   2% /export</pre>
<p>ทดลองสร้างไฟล์ในดิสก์ drbd0</p>
<pre>[root@centos54-b ~]# <strong>cd /export/
</strong>[root@centos54-b export]# <strong>ls
</strong>lost+found
[root@centos54-b export]# <strong>echo "hello world from node 2" &gt; test-file-on-node-2.txt
</strong>[root@centos54-b export]# <strong>ls -l
</strong>total 20
drwx------ 2 root root 16384 Feb  6 15:46 lost+found
-rw-r--r-- 1 root root    24 Feb  6 17:17 <span style="color: #0000ff;"><strong>test-file-on-node-2.txt</strong></span></pre>
<p>รันเซอร์วิส DRBD บนเครื่องที่ 1 ขึ้นมาอีกครั้ง ตอนนี้เครื่องที่ 1 จะทำหน้าที่เป็น Secondary และจะทำการ replicate ข้อมูลมาจากเครื่องที่ 2 (Primary) โดยอัตโนมัติ</p>
<pre>[root@centos54-a ~]# <strong>service drbd start
</strong>Starting DRBD resources: [ d(r0) s(r0) n(r0) ].</pre>
<pre>[root@centos54-a ~]# <strong>service drbd status
</strong>drbd driver loaded OK; device status:
version: 8.3.2 (api:88/proto:86-90)
GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 14:07:55
m:res  cs         ro                 ds                 p  mounted  fstype
0:r0   Connected  <strong><span style="color: #0000ff;">Secondary</span></strong>/Primary  UpToDate/UpToDate  C</pre>
<p>บนเครื่องที่ 2 เปลี่ยนให้เป็นโหมด Secondary</p>
<pre>[root@centos54-b ~]# <strong>drbdadm secondary all
</strong><span style="color: #ff0000;">0: State change failed: (-12) Device is held open by someone</span>
Command 'drbdsetup 0 secondary' terminated with exit code 11</pre>
<p>หากมีการเรียกใช้ดิสก์ drbd อยู่ จะไม่สามารถเปลี่ยนโหมดจาก Primary ไปเป็น Secondary ได้ ต้อง umount ดิสก์ออกไปก่อนถึงจะเปลี่ยนโหมดได้</p>
<pre>[root@centos54-b ~]# <strong>umount /export
</strong>[root@centos54-b ~]# <strong>drbdadm secondary all</strong></pre>
<p>ตรวจสอบสถานะบนเครื่องที่ 2</p>
<pre>[root@centos54-b ~]# <strong>service drbd status
</strong>drbd driver loaded OK; device status:
version: 8.3.2 (api:88/proto:86-90)
GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 14:07:55
m:res  cs         ro                   ds                 p  mounted  fstype
0:r0   Connected  <span style="color: #0000ff;"><strong>Secondary</strong></span>/Secondary  UpToDate/UpToDate  C</pre>
<p>เปลี่ยนโหมดบนเครื่องที่ 1 ให้เป็น Primary เพื่อเรียกใช้ดิสก์ได้</p>
<pre>[root@centos54-a ~]# <strong>drbdadm primary all
</strong>[root@centos54-a ~]# <strong>service drbd status
</strong>drbd driver loaded OK; device status:
version: 8.3.2 (api:88/proto:86-90)
GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 14:07:55
m:res  cs         ro                 ds                 p  mounted  fstype
0:r0   Connected  <strong><span style="color: #0000ff;">Primary</span></strong>/Secondary  UpToDate/UpToDate  C</pre>
<p>mount ดิสก์ และตรวจสอบไฟล์ที่อยู่ใน drbd0 จะเห็นไฟล์ที่สร้างจากเครื่องที่ 2</p>
<pre>[root@centos54-a ~]# <strong>mount /dev/drbd0 /export
</strong>[root@centos54-a ~]# <strong>cd /export/
</strong>[root@centos54-a export]# ls -l
total 20
drwx------ 2 root root 16384 Feb  6 15:46 lost+found
-rw-r--r-- 1 root root    24 Feb  6 17:17 <strong><span style="color: #0000ff;">test-file-on-node-2.txt
</span></strong>[root@centos54-a export]# <strong>cat test-file-on-node-2.txt
</strong>hello world from node 2</pre>
<h4>ตรวจสอบไฟล์ /var/log/messages</h4>
<p>เมื่อมีปัญหาเกี่ยวกับการใช้ DBRD นอกจากการใช้คำสั่ง service เพื่อตรวจสอบสถานะแล้ว ไฟล์ /var/log/messages จะแสดงการเปลี่ยนแปลงทั้งหมดของ DRBD ที่เกิดขึ้น ซึ่งสามารถนำมาใช้ช่วยในการแก้ปัญหาได้</p>
<p>ตัวอย่างข้อความในไฟล์ /var/log/messages ที่เกิดขึ้น เมื่อมีการเปลี่ยนโหมด</p>
<pre>[root@centos54-a ~]# <strong>tail /var/log/messages
</strong>...
Feb  6 17:19:38 centos54-a kernel: block drbd0: peer( Primary -&gt; Secondary )
Feb  6 17:21:04 centos54-a kernel: block drbd0: role( Secondary -&gt; Primary )
...</pre>
<h4>ข้อมูลอ้างอิง</h4>
<ul>
<li><a href="http://spalinux.com/2010/02/install_and_configure_drbd">ติดตั้งและคอนฟิก DRBD</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2010/02/basic_using_drbd/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ติดตั้งและคอนฟิก DRBD</title>
		<link>http://spalinux.com/2010/02/install_and_configure_drbd</link>
		<comments>http://spalinux.com/2010/02/install_and_configure_drbd#comments</comments>
		<pubDate>Sat, 06 Feb 2010 09:40:46 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Backup]]></category>
		<category><![CDATA[Cluster]]></category>
		<category><![CDATA[Disk]]></category>
		<category><![CDATA[Filesystem]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[drbd]]></category>
		<category><![CDATA[linux ha]]></category>

		<guid isPermaLink="false">http://spalinux.com/?p=1068</guid>
		<description><![CDATA[DRBD (Distributed Replicated Block Device) เป็นโปรแกรมเพื่อใช้ในการ replicate ข้อมูลดิสก์ที่อยู่คนละเครื่องกัน ผ่านทางเน็ตเวิร์ก โดยจะทำในระดับ block ของดิสก์ เมื่อมีการเปลี่ยนแปลงข้อมูลที่อยูในดิสก์เครื่องหนึ่ง (primary) การเปลี่ยนแปลงนั้นจะถูก replicate ไปยังอีกเครื่อง (secondary) โดยอัตโนมัติ DRBD ประกอบด้วยสองส่วนคือ 1. Kernel module &#8211; DRBD ทำหน้าที่ใน kernel โดยจะสร้าง virtual block device คั่นกลางระหว่าง physical disk กับ filesystem ที่สร้างอยู่ ไม่ว่าจะเป็น ext3, ext4, xfs 2. User space administration tools &#8211; เป็นโปรแกรมที่ช่วยในการจัดการ DRBD ได้ง่ายขึ้น หลักๆ จะเป็น drbdadm ในบทความนี้จะแสดงการติดตั้งโปรแกรม [...]]]></description>
			<content:encoded><![CDATA[<p>DRBD (Distributed Replicated Block Device) เป็นโปรแกรมเพื่อใช้ในการ replicate ข้อมูลดิสก์ที่อยู่คนละเครื่องกัน ผ่านทางเน็ตเวิร์ก โดยจะทำในระดับ block ของดิสก์</p>
<p>เมื่อมีการเปลี่ยนแปลงข้อมูลที่อยูในดิสก์เครื่องหนึ่ง (primary) การเปลี่ยนแปลงนั้นจะถูก replicate ไปยังอีกเครื่อง (secondary) โดยอัตโนมัติ</p>
<p>DRBD ประกอบด้วยสองส่วนคือ</p>
<p>1. Kernel module &#8211; DRBD ทำหน้าที่ใน kernel โดยจะสร้าง virtual block device คั่นกลางระหว่าง physical disk กับ filesystem ที่สร้างอยู่ ไม่ว่าจะเป็น ext3, ext4, xfs<br />
2. User space administration tools &#8211; เป็นโปรแกรมที่ช่วยในการจัดการ DRBD ได้ง่ายขึ้น หลักๆ จะเป็น drbdadm</p>
<p>ในบทความนี้จะแสดงการติดตั้งโปรแกรม DRBD และคอนฟิกเป็นแบบ Single-primary mode คือ ณ เวลาใดเวลาหนึ่ง มีเครื่องเดียวเท่านั้นที่สามารถ อ่าน เขียน ข้อมูลได้</p>
<p><span style="color: #ff0000;"><strong>คำเตือน ติดตั้งและคอนฟิก DRBD บนเครื่องทดสอบให้เข้าใจก่อน เพราะบางคำสั่งอาจกระทบข้อมูลดิสก์หรือ partition ที่มีอยู่ในเครื่องได้ ทำให้ข้อมูลเสียหายได้</strong></span></p>
<p><span id="more-1068"></span></p>
<h4>ระบบสำหรับการทดสอบ</h4>
<p>ในที่นี้จะติดตั้ง CentOS 5.4 พร้อมคอนฟิกให้สองเครื่องติดต่อ ping กันได้ และปิดคุณสมบัติ firewall ทั้งหมด</p>
<p><strong>เครื่องที่ 1</strong></p>
<ul>
<li>Hostname:   centos54-a.spalinux.com</li>
<li>IP Address: 10.3.3.51</li>
</ul>
<p><strong>เครื่องที่ 2</strong></p>
<ul>
<li>Hostname:   centos54-b.spalinux.com</li>
<li>IP Address: 10.3.3.52</li>
</ul>
<p>แก้ไขไฟล์ /etc/hosts เพื่อให้ทั้งสองเครื่องอ้างอิงจากชื่อเครื่องได้</p>
<p>ตัวอย่างคอนฟิกของเครื่องที่ 1</p>
<pre>[root@centos54-a ~]# <strong>hostname</strong>
centos54-a.spalinux.com</pre>
<pre>[root@centos54-a ~]# <strong>cat /etc/hosts
</strong># Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6</pre>
<pre>10.3.3.51       centos54-a centos54-a.spalinux.com
10.3.3.52       centos54-b centos54-b.spalinux.com</pre>
<p>ตัวอย่างคอนฟิกของเครื่องที่ 2</p>
<pre>[root@centos54-b ~]# <strong>hostname</strong>
centos54-b.spalinux.com</pre>
<pre>[root@centos54-b ~]# <strong>cat /etc/hosts
</strong># Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6</pre>
<pre>10.3.3.51       centos54-a centos54-a.spalinux.com
10.3.3.52       centos54-b centos54-b.spalinux.com</pre>
<p>ทั้งสองเครื่อง ต้องสร้าง partition สำหรับใช้เป็นดิสก์ DRBD โดยไม่ต้องสร้าง filesystem ใดๆ ทั้งสิ้นบน partition นี้ สมมติว่าเป็น /dev/sda5 บนทั้งสองเครื่อง</p>
<p>หมายเหตุ</p>
<ul>
<li>แนะนำให้สร้าง partition ทั้งสองเครื่องให้เหมือนกัน ขนาดเท่ากัน จะได้ง่ายต่อการคอนฟิก</li>
<li>สำหรับการทดสอบเริ่มต้น แนะนำให้สร้างขนาด partition เล็กๆ ก่อน จะได้ใช้เวลาในการ sync ข้อมูลไม่นานมากนัก ในบทความนี้สร้างประมาณ 1 GBytes</li>
</ul>
<h4>ติดตั้งโปรแกรม DRBD</h4>
<p>ไฟล์ติดตั้ง DRBD ในรูปแบบ rpm ของ CentOS 5.4 นั้น ไม่อยู่ในแผ่นดีวีดีติดตั้ง แต่จะอยู่ในส่วนของ extras สำหรับในเมืองไทยสามารถดาวน์โหลดได้จาก <a href="http://www.mirror.in.th/osarchive/centos/5.4/extras/">http://www.mirror.in.th/osarchive/centos/5.4/extras/</a></p>
<p>ดาวน์โหล์ด และติดตั้งไฟล์ rpm สองไฟล์ บนเครื่องทั้งสอง</p>
<ul>
<li>drbd83-8.3.2-6.el5_3.x86_64.rpm  &#8211; &#8220;User space administration tools&#8221;</li>
<li>kmod-drbd83-8.3.2-6.el5_3.x86_64.rpm  &#8211; &#8220;Kernel Module&#8221;</li>
</ul>
<p>ใช้คำสั่ง rpm เพื่อติดตั้ง</p>
<pre>[root@centos54-a ~]# <strong>rpm -ivh drbd83-8.3.2-6.el5_3.x86_64.rpm
</strong>Preparing...                ########################################### [100%]
   1:drbd83                 ########################################### [100%]
[root@centos54-a ~]# <strong>rpm -ivh kmod-drbd83-8.3.2-6.el5_3.x86_64.rpm
</strong>Preparing...                ########################################### [100%]
   1:kmod-drbd83            ########################################### [100%]</pre>
<h4>คอนฟิก DRBD บนเครื่องที่ 1 (primary)</h4>
<p>ไฟล์คอนฟิกหลักของ DRBD คือไฟล์ /etc/drbd.conf ต้องมีการแก้ไขไฟล์นี้ก่อนถึงจะเริ่มใช้งานได้ โดยมีไฟล์ตัวอย่างคอนฟิกอยู่ใน /usr/share/doc/drbd83/drbd.conf</p>
<p>ไฟล์คอนฟิก /etc/drbd.conf จากการติดตั้ง</p>
<pre>[root@centos54-a ~]# <strong>cat /etc/drbd.conf
</strong>#
# please have a a look at the example configuration file in
# /usr/share/doc/drbd83/drbd.conf
#</pre>
<p>สร้างไฟล์คอนฟิก /etc/drbd.conf บนเครื่องที่ 1 &#8220;centos54-a.spalinux.com&#8221; ดังนี้</p>
<pre>[root@centos54-a ~]# <strong>cat /etc/drbd.conf
</strong>global {
    usage-count no;
}</pre>
<pre>common {
    syncer { rate 10M; }
}</pre>
<pre>resource <strong><span style="color: #0000ff;">r0</span> </strong>{
    protocol C;</pre>
<pre>    net {
        cram-hmac-alg "sha1";
        shared-secret "<span style="color: #0000ff;"><strong>test1234</strong></span>";
    }</pre>
<pre>    on <strong><span style="color: #0000ff;">centos54-a.spalinux.com</span></strong> {
        device /dev/drbd0;
        <strong><span style="color: #0000ff;">disk /dev/sda5</span></strong>;
        <strong><span style="color: #0000ff;">address 10.3.3.51:8888</span></strong>;
        meta-disk internal;
    }</pre>
<pre>    on <strong><span style="color: #0000ff;">centos54-b.spalinux.com</span></strong> {
        device /dev/drbd0;
        <strong><span style="color: #0000ff;">disk /dev/sda5</span></strong>;
        <strong><span style="color: #0000ff;">address 10.3.3.52:8888</span></strong>;
        meta-disk internal;
    }
}</pre>
<p>คำอธิบายเบื้องต้น</p>
<ul>
<li>shared-secret เป็นการกำหนดรหัสของเครื่องที่สามารถ replicate ข้อมูลกันได้ </li>
<li>r0 เป็นชื่อ resource ของ DRBD สามารถตั้งเป็นชื่อใดๆ ก็ได้ เพื่อสื่อความหมาย</li>
<li>on ตามด้วยชื่อ hostname ที่ต้องการ replicate ข้อมูลกัน ส่วนในวงเล็บ { เป็นการกำหนดคอนฟิกของแต่ละเครื่อง</li>
<li>disk คือชื่อ partition ที่สร้างไว้สำหรับการทำ DRBD ในที่นี้คือ /dev/sda5</li>
</ul>
<p>ใช้คำสั่ง drbadm create-md เพื่อสร้าง meta data บน partition ที่จะทำเป็น DRBD</p>
<pre>[root@centos54-a ~]# <strong>drbdadm create-md all
</strong>Writing meta data...
initializing activity log
NOT initialized bitmap
New drbd meta data block successfully created.</pre>
<p>หาก partition ที่คอนฟิกเป็น DRBD มี filesystem อยู่ก่อนแล้ว จะไม่สามารถสร้าง DRBD ได้</p>
<pre>[root@centos54-a ~]# <strong>drbdadm create-md all
</strong>md_offset 1011671040
al_offset 1011638272
bm_offset 1011605504</pre>
<pre><span style="color: #ff0000;">Found ext3 filesystem</span> which uses 987964 kB
current configuration leaves usable 987896 kB</pre>
<pre>Device size would be truncated, which
would corrupt data and result in
'access beyond end of device' errors.
You need to either
   * use external meta data (recommended)
   * shrink that filesystem first
   * zero out the device (destroy the filesystem)
<span style="color: #ff0000;">Operation refused.</span></pre>
<pre>Command 'drbdmeta 0 v08 /dev/sda5 internal create-md' terminated with exit code 40
<span style="color: #ff0000;">drbdadm create-md r0: exited with code 40</span></pre>
<p>วิธีการแก้ไขคือต้องลบข้อมูลของ filesystem บน partition /dev/sda5 นี้ออก วิธีการง่ายสุดคือใช้คำสั่ง dd</p>
<p><span style="color: #ff0000;"><strong>คำเตือน คำสั่ง dd จะลบข้อมูลทั้งหมดบน partition ที่ระบุ</strong></span></p>
<pre>[root@centos54-a ~]# <strong>dd if=/dev/zero of=/dev/sda5
</strong>dd: writing to `/dev/sda5': No space left on device
1975933+0 records in
1975932+0 records out
1011677184 bytes (1.0 GB) copied, 87.2749 seconds, 11.6 MB/s</pre>
<p>แล้วถึงสามารถสร้าง meta data ของ DRBD ได้</p>
<pre>[root@centos54-a ~]# <strong>drbdadm create-md all
</strong>Writing meta data...
initializing activity log
NOT initialized bitmap
New drbd meta data block successfully created.</pre>
<p>ใช้คำสั่ง service เพื่อรันเซอร์วิส DRBD</p>
<pre>[root@centos54-a ~]# <strong>service drbd start
</strong>Starting DRBD resources: [ d(r0) s(r0) n(r0) ]..........
***************************************************************
 DRBD's startup script waits for the peer node(s) to appear.
 - In case this node was already a degraded cluster before the
   reboot the timeout is 0 seconds. [degr-wfc-timeout]
 - If the peer was available before the reboot the timeout will
   expire after 0 seconds. [wfc-timeout]
   (These values are for resource 'r0'; 0 sec -&gt; wait forever)
 To abort waiting enter 'yes' [  20]:<span style="color: #3366ff;"><strong><span style="color: #0000ff;">yes</span></strong></span></pre>
<p>ในครั้งแรกที่รันเซอร์วิส บนเครื่อง primary โปรแกรมจะรอให้เครื่อง peer (secondary) เข้ามาเชื่อมต่อ หากไม่ต้องการให้รอ ให้พิมพ์คำว่า &#8220;yes&#8221; แล้ว [Enter]</p>
<p>ใช้คำสั่ง service status เพื่อตรวจสอบสถานะของ DRBD</p>
<pre>[root@centos54-a ~]# <strong>service drbd status
</strong>drbd driver loaded OK; device status:
version: 8.3.2 (api:88/proto:86-90)
GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 14:07:55
m:res  cs            ro                 ds                     p  mounted  fstype
0:r0   WFConnection  <span style="color: #0000ff;"><strong>Secondary</strong></span>/Unknown  <span style="color: #0000ff;"><strong>Inconsistent</strong></span>/DUnknown  C</pre>
<p>หรืออ่านจากไฟล์ /proc/drbd โดยตรง</p>
<pre>[root@centos54-a ~]# <strong>cat /proc/drbd</strong>
version: 8.3.2 (api:88/proto:86-90)
GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 14:07:55
 0: cs:WFConnection ro:Secondary/Unknown ds:Inconsistent/DUnknown C r----
    ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:987896</pre>
<p>สร้างไดเรคทอรี /export สำหรับทดสอบ mount เพื่อใช้ดิสก์ drbd ที่สร้างขึ้น</p>
<pre>[root@centos54-a ~]# <strong>mount /dev/drbd0 /export
</strong>mount: block device /dev/drbd0 is write-protected, mounting read-only
mount: Wrong medium type</pre>
<p>ดิสก์นี้ยังไม่สามารถใช้ได้ ต้องใช้คำสั่ง drbdadm primary คอนฟิกให้ดิสก์ drbd บนเครื่องนี้ทำหน้าที่เป็น primary เพื่อให้สามารถ อ่าน เขียน ข้อมูลจากดิสก์ได้</p>
<pre>[root@centos54-a ~]# <strong>drbdadm primary all
</strong><span style="color: #ff0000;">0: State change failed: (-2) Refusing to be Primary without at least one UpToDate disk
</span>Command 'drbdsetup 0 primary' terminated with exit code 17</pre>
<p>หากเป็นการเรียกใช้ครั้งแรก ต้องระบุออปชั่นดังนี้</p>
<pre>[root@centos54-a ~]# <strong>drbdadm -- --overwrite-data-of-peer primary all
</strong>[root@centos54-a ~]#</pre>
<p>ตรวจสอบสถานะ drbd อีกครั้ง สังเกตว่า ฟิลด์ ro จะเปลี่ยนจาก Seconday เป็น Primary และฟิลด์ ds จะเปลี่ยนจาก Inconsistent เป็น UpToDate</p>
<pre>[root@centos54-a ~]# <strong>service drbd status
</strong>drbd driver loaded OK; device status:
version: 8.3.2 (api:88/proto:86-90)
GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 14:07:55
m:res  cs            ro               ds                 p  mounted  fstype
0:r0   WFConnection  <span style="color: #0000ff;"><strong>Primary</strong></span>/Unknown  <strong><span style="color: #0000ff;">UpToDate</span></strong>/DUnknown  C</pre>
<p>ทดสอบการ mount ดิสก์อีกครั้ง</p>
<pre>[root@centos54-a ~]# <strong>mount /dev/drbd0 /export
</strong>mount: you must specify the filesystem type</pre>
<p>ก็ยังไม่สามารถ mount ได้ เพราะยังไม่มี filesystem บน /dev/drbd0</p>
<p>รันคำสั่ง mkfs.ext3 เพื่อสร้าง filesystem แบบ ext3</p>
<pre>[root@centos54-a ~]# <strong>mkfs.ext3 /dev/drbd0
</strong>mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
123648 inodes, 246974 blocks
12348 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=255852544
8 block groups
32768 blocks per group, 32768 fragments per group
15456 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376</pre>
<pre>Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done</pre>
<pre>This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.</pre>
<p>ทดสอบการ mount อีกครั้ง จะสามารถใช้งานได้แล้ว</p>
<pre>[root@centos54-a ~]# <strong>mount /dev/drbd0 /export</strong></pre>
<p>ตรวจสอบสถานะ DRBD</p>
<pre>[root@centos54-a ~]# <strong>service drbd status
</strong>drbd driver loaded OK; device status:
version: 8.3.2 (api:88/proto:86-90)
GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 14:07:55
m:res  cs            ro               ds                 p  mounted  fstype
0:r0   WFConnection  Primary/Unknown  UpToDate/DUnknown  C  <span style="color: #0000ff;"><strong>/export  ext3</strong></span></pre>
<h4>คอนฟิก DRBD บนเครื่องที่ 2 (secondary)</h4>
<p>สร้างไฟล์คอนฟิก /etc/drbd.conf บนเครื่องที่ 2 เหมือนกับไฟล์ในเครื่องที่ 1</p>
<pre>[root@centos54-b ~]# <strong>cat /etc/drbd.conf
</strong>global {
    usage-count no;
}</pre>
<pre>common {
    syncer { rate 10M; }
}</pre>
<pre>resource r0 {
    protocol C;</pre>
<pre>    net {
        cram-hmac-alg "sha1";
        shared-secret "test1234";
    }</pre>
<pre>    on centos54-a.spalinux.com {
        device /dev/drbd0;
        disk /dev/sda5;
        address 10.3.3.51:8888;
        meta-disk internal;
    }</pre>
<pre>    on centos54-b.spalinux.com {
        device /dev/drbd0;
        disk /dev/sda5;
        address 10.3.3.52:8888;
        meta-disk internal;
    }
}</pre>
<p>ใช้คำสั่ง drbadm create-md เพื่อสร้าง meta data บน partition ที่จะทำเป็น DRBD</p>
<pre>[root@centos54-b ~]# <strong>drbdadm create-md all
</strong>Writing meta data...
initializing activity log
NOT initialized bitmap
New drbd meta data block successfully created.</pre>
<p>เช่นเดียวกัน หากมี filesystem อยู่บน partition ก่อนแล้ว ต้องใช้คำสั่ง dd เพื่อลบข้อมูลออก</p>
<p>ใช้คำสั่ง service เพื่อรันเซอร์วิส DRBD</p>
<pre>[root@centos54-b ~]# <strong>service drbd start
</strong>Starting DRBD resources: [ d(r0) s(r0) n(r0) ].</pre>
<p>เมื่อเริ่มต้นรันเซอร์วิส DRBD บนเครื่องที่ 2 จะเป็นการเริ่ม replicate ข้อมูลจากเครื่องที่ 1</p>
<p>ตรวจสอบสถานะ DRBD บนเครื่องที่ 2</p>
<pre>[root@centos54-b ~]# <strong>service drbd status
</strong>drbd driver loaded OK; device status:
version: 8.3.2 (api:88/proto:86-90)
GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 14:07:55
m:res  cs          ro                 ds                     p  mounted  fstype
...    <strong><span style="color: #0000ff;">sync'ed:    42.2%</span> </strong>             (576248/987896)K
0:r0   <strong><span style="color: #0000ff;">SyncTarget</span></strong>  <strong><span style="color: #0000ff;">Secondary</span></strong>/Primary  <span style="color: #0000ff;"><strong>Inconsistent</strong></span>/UpToDate  C</pre>
<p>ตรวจสอบสถานะ DRBD บนเครื่องที่ 1</p>
<pre>[root@centos54-a ~]# <strong>service drbd status
</strong>drbd driver loaded OK; device status:
version: 8.3.2 (api:88/proto:86-90)
GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 14:07:55
m:res  cs          ro                 ds                     p  mounted  fstype
...    <strong><span style="color: #0000ff;">sync'ed:    43.0%</span></strong>              (567032/987896)K
0:r0   <strong><span style="color: #0000ff;">SyncSource</span></strong>  Primary/<strong><span style="color: #0000ff;">Secondary</span>  </strong>UpToDate/<strong><span style="color: #0000ff;">Inconsistent</span></strong>  C  /export  ext3</pre>
<p>เมื่อ replicate ข้อมูลเรียบร้อย (synced) ข้อมูลแล้ว สถานะจะเป็นดังนี้</p>
<p>ตรวจสอบสถานะ DRBD บนเครื่องที่ 2 เมื่อ synced ข้อมูลเรียบร้อย</p>
<pre>[root@centos54-b ~]# <strong>service drbd status
</strong>drbd driver loaded OK; device status:
version: 8.3.2 (api:88/proto:86-90)
GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 14:07:55
m:res  cs         ro                 ds                 p  mounted  fstype
0:r0   <strong><span style="color: #0000ff;">Connected</span>  <span style="color: #0000ff;">Secondary</span></strong>/Primary  <strong><span style="color: #0000ff;">UpToDate</span></strong>/UpToDate  C</pre>
<p>ตรวจสอบสถานะ DRBD บนเครื่องที่ 1 เมื่อ synced ข้อมูลเรียบร้อย</p>
<pre>[root@centos54-a ~]# <strong>service drbd status
</strong>drbd driver loaded OK; device status:
version: 8.3.2 (api:88/proto:86-90)
GIT-hash: dd7985327f146f33b86d4bff5ca8c94234ce840e build by mockbuild@v20z-x86-64.home.local, 2009-08-29 14:07:55
m:res  cs         ro                 ds                 p  mounted  fstype
0:r0   <strong><span style="color: #0000ff;">Connected</span></strong>  Primary/<strong><span style="color: #0000ff;">Secondary</span></strong>  UpToDate/<strong><span style="color: #0000ff;">UpToDate</span></strong>  C  /export  ext3</pre>
<p>หลังจาก synced ข้อมูลระหว่างเครื่องเรียบร้อย เมื่อมีการเปลี่ยนแปลงข้อมูลในดิสก์บนเครื่องที่ 1 (primary) การเปลี่ยนแปลงนั้นจะถูก replicate ไปยังเครื่องที่ 2 (secondary) โดยอัตโนมัติ</p>
<p>ตัวอย่างการใช้คำสั่ง tcpdump  ตรวจสอบ packet ที่ส่งระหว่างเครื่องเพื่อการ replicate ข้อมูลของ DRBD</p>
<pre>[root@centos54-b ~]# <strong>tcpdump -i eth0 -l -nn | grep 8888
</strong>tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
15:51:39.815802 IP 10.3.3.52.8888 &gt; 10.3.3.51.42180: P 2834377596:2834377604(8) ack 2893184807 win 46 &lt;nop,nop,timestamp 1772852 1818781&gt;
15:51:39.816356 IP 10.3.3.51.42180 &gt; 10.3.3.52.8888: P 1:9(8) ack 8 win 3216 &lt;nop,nop,timestamp 1828655 1772852&gt;
15:51:39.816394 IP 10.3.3.52.8888 &gt; 10.3.3.51.42180: . ack 9 win 46 &lt;nop,nop,timestamp 1772852 1828655&gt;
15:51:44.888876 IP 10.3.3.1.4117 &gt; 10.3.3.51.22: P 1560:1612(52) ack 1629 win 64271
15:51:49.815252 IP 10.3.3.51.42180 &gt; 10.3.3.52.8888: P 9:17(8) ack 8 win 3216 &lt;nop,nop,timestamp 1838655 1772852&gt;
15:51:49.815330 IP 10.3.3.52.8888 &gt; 10.3.3.51.42180: . ack 17 win 46 &lt;nop,nop,timestamp 1782853 1838655&gt;
15:51:49.815666 IP 10.3.3.52.8888 &gt; 10.3.3.51.42180: P 8:16(8) ack 17 win 46 &lt;nop,nop,timestamp 1782853 1838655&gt;
15:51:49.847300 IP 10.3.3.51.42180 &gt; 10.3.3.52.8888: . ack 16 win 3216 &lt;nop,nop,timestamp 1838696 1782853&gt;
15:51:50.937877 IP 10.3.3.51.8888 &gt; 10.3.3.52.40284: . 3903780263:3903781711(1448) ack 2834246899 win 501 &lt;nop,nop,timestamp 1839875 1683335&gt;
...
<strong><span style="color: #0000ff;">[Ctrl-C]</span></strong></pre>
<h4>ข้อมูลอ้างอิง</h4>
<ul>
<li><a href="http://www.drbd.org/" target="_blank">DRBD</a></li>
<li><a href="http://www.mirror.in.th/osarchive/centos/5.4/extras/" target="_blank">CentOS 5.4 extras</a></li>
<li><a href="http://spalinux.com/2010/02/basic_using_drbd">การใช้งาน DRBD เบื้องต้น</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2010/02/install_and_configure_drbd/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>คอนฟิก Linux HA บน Fedora 9 ตอนที่ 1</title>
		<link>http://spalinux.com/2008/06/configure_linux_ha_on_fedora9_part1</link>
		<comments>http://spalinux.com/2008/06/configure_linux_ha_on_fedora9_part1#comments</comments>
		<pubDate>Mon, 02 Jun 2008 13:44:48 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Cluster]]></category>

		<guid isPermaLink="false">http://spalinux.com/?p=26</guid>
		<description><![CDATA[บทความนี้จะแนะนำการคอนฟิก Linux HA บน server สองตัว โดยใช้โปรแกรม heartbeat โดยในบทความตอนแรกนี้ จะคอนฟิกเป็นแบบ Active Standby คือ ณ ขณะหนึ่งจะมีเครื่องที่ใช้งานเพียงเครื่องเดียวเท่านั้น ส่วนอีกเครื่องจะเป็นเครื่องสำรอง แล้วจะถูกใช้งานโดยอัตโนมัติเมื่อเครื่องหลักมีปัญหา ระบบที่ทดสอบ Fedora 9 heartbeat-2.1.3-1.fc9.i386.rpm ข้อมูลพื้นฐาน Primary Server (เครื่องหลัก): linux-ha01.example.com Secondary Server (เครื่องสำรอง): linux-ha02.example.com Virtual IP Address: 192.168.1.1 Default gateway: 192.168.1.254 ติดตั้งโปรแกรม เริ่มต้นติดตั้งโปรแกรมตามตัวอย่างต่อไปนี้บนเครื่องทั้งสอง (ดูข้อมูลอ้างอิงสำหรับการดาวน์โหลด) # rpm -ivh --nodeps fedora-usermgmt-core-0.10-1.fc8.noarch.rpm # rpm -ivh --nodeps fedora-usermgmt-shadow-utils-0.10-1.fc8.noarch.rpm # rpm -ivh fedora-usermgmt-default-fedora-setup-0.10-1.fc8.noarch.rpm # [...]]]></description>
			<content:encoded><![CDATA[<p>บทความนี้จะแนะนำการคอนฟิก Linux HA บน server สองตัว โดยใช้โปรแกรม heartbeat โดยในบทความตอนแรกนี้ จะคอนฟิกเป็นแบบ Active Standby คือ ณ ขณะหนึ่งจะมีเครื่องที่ใช้งานเพียงเครื่องเดียวเท่านั้น ส่วนอีกเครื่องจะเป็นเครื่องสำรอง แล้วจะถูกใช้งานโดยอัตโนมัติเมื่อเครื่องหลักมีปัญหา</p>
<p><span id="more-26"></span></p>
<p><strong>ระบบที่ทดสอบ</strong></p>
<ul>
<li>Fedora 9</li>
<li>heartbeat-2.1.3-1.fc9.i386.rpm</li>
</ul>
<p><strong>ข้อมูลพื้นฐาน<br />
</strong>Primary Server (เครื่องหลัก): linux-ha01.example.com<br />
Secondary Server (เครื่องสำรอง): linux-ha02.example.com<br />
Virtual IP Address: 192.168.1.1<br />
Default gateway: 192.168.1.254</p>
<p><strong>ติดตั้งโปรแกรม<br />
</strong>เริ่มต้นติดตั้งโปรแกรมตามตัวอย่างต่อไปนี้บนเครื่องทั้งสอง (ดูข้อมูลอ้างอิงสำหรับการดาวน์โหลด)</p>
<pre># rpm -ivh --nodeps fedora-usermgmt-core-0.10-1.fc8.noarch.rpm
# rpm -ivh --nodeps fedora-usermgmt-shadow-utils-0.10-1.fc8.noarch.rpm
# rpm -ivh fedora-usermgmt-default-fedora-setup-0.10-1.fc8.noarch.rpm
# rpm -ivh fedora-usermgmt-0.10-1.fc8.noarch.rpm
# rpm -ivh ipvsadm-1.24-11.i386.rpm
# rpm -ivh perl-MailTools-2.02-3.fc9.noarch.rpm
# rpm -ivh perl-TimeDate-1.16-8.fc9.noarch.rpm
# rpm -ivh perl-MailTools-2.02-3.fc9.noarch.rpm
# rpm -ivh ldirectord-2.1.3-1.fc9.i386.rpm
# rpm -ivh pils-2.1.3-1.fc9.i386.rpm
# rpm -ivh lm_sensors-3.0.1-5.fc9.i386.rpm
# rpm -ivh net-snmp-libs-5.4.1-14.fc9.i386.rpm
# rpm -ivh stonith-2.1.3-1.fc9.i386.rpm
# rpm -ivh heartbeat-2.1.3-1.fc9.i386.rpm</pre>
<p><strong>คอนฟิกไฟล์ของ heartbeat</strong><br />
สร้างไฟล์คอนฟิกขึ้นมาบนเครื่องทั้งสองให้เหมือนกัน โดยไฟล์คอนฟิกทั้งหมดของ heartbeat จะอยู่ใน /etc/ha.d/</p>
<p>ตัวอย่างคอนฟิกไฟล์ <strong>/etc/ha.d/ha.cf</strong></p>
<pre>logfacility daemon         # Log to syslog as facility "daemon"
node linux-ha01.example.com
node linux-ha02.example.com
keepalive 1                # Send one heartbeat each second
deadtime 10                # Declare nodes dead after 10 seconds
bcast eth0                 # Broadcast heartbeats on eth0 and eth1 interfaces
ping 192.168.1.254              # Ping our router to monitor ethernet connectivity
auto_failback no           # Try and keep resources on their "preferred" hosts
respawn hacluster /usr/lib/heartbeat/ipfail  # Failover on network failures</pre>
<p>ตัวอย่างคอนฟิกไฟล์ <strong>/etc/ha.d/haresources</strong></p>
<pre>linux-ha01.example.com  192.168.1.1</pre>
<p>สร้าง key สำหรับใส่ในไฟล์ authkeys โดยใช้คำสั่งดังนี้</p>
<pre># <strong>dd if=/dev/urandom count=4 2&gt;/dev/null | md5sum | cut -c1-32
</strong>0a7ee4ce653744cb5ecbcbdc0ef52487</pre>
<p>ตัวอย่างคอนฟิกไฟล์<strong> /etc/ha.d/authkeys</strong></p>
<pre>auth 1
1 sha1 0a7ee4ce653744cb5ecbcbdc0ef52487</pre>
<p><strong>เริ่มต้นโปรแกรม heartbeat<br />
</strong>เมื่อสร้างคอนฟิกทั้งสองเครื่องเรียบร้อยแล้ว ต้องเริ่มต้นโปรแกรม heartbeat ทั้องสองเคริ่องโดยแนะนำให้เริ่มจากเครื่องหลักก่อน</p>
<pre># /etc/init.d/heartbeat start
Starting High-Availability services:                                                           [  OK  ]</pre>
<p><strong>ทดสอบการใช้งาน</strong><br />
เราสามารถทดสอบการทำงานโดยใช้คำสั่ง ping ไปที่ Virtual IP Address จากเครื่องอื่นๆ โดยถ้าทั้งสองเครื่องทำงานปกติ เครื่องหลัก (Primary Server) จะทำหน้าที่เป็น Virtual IP แต่ถ้าเครื่องหลักมีปัญหา (อาจทดสอบโดยการดึงสาย LAN ออก) เครื่องสำรองจะทำหน้าที่เป็น Virtual IP แทน</p>
<p><strong>ข้อมูลอ้างอิง</strong></p>
<ul>
<li><a title="http://mirrors.kernel.org/fedora/releases/9/Everything/x86_64/os/" href="http://www.linux-ha.org" target="_self">The High Availability Linux Project</a></li>
<li><a title="Fedora 9 - Everything RPM Files" href="http://mirrors.kernel.org/fedora/releases/9/Everything/x86_64/os/" target="_blank">Fedora 9 &#8211; Everything RPM Files</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2008/06/configure_linux_ha_on_fedora9_part1/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

