<?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>masakazu&#039;s Weblog &#187; OS</title>
	<atom:link href="http://bougaidenpa.org/masakazu/archives/category/os/feed" rel="self" type="application/rss+xml" />
	<link>http://bougaidenpa.org/masakazu</link>
	<description></description>
	<lastBuildDate>Sat, 24 Jul 2010 16:40:58 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Primary/Primary 構成の DRBD デバイス上に構築した Cluster Filesystem 上に構築した Xen 準仮想化仮想マシン上の Filesystem Benchmark</title>
		<link>http://bougaidenpa.org/masakazu/archives/34</link>
		<comments>http://bougaidenpa.org/masakazu/archives/34#comments</comments>
		<pubDate>Sun, 24 Feb 2008 14:18:48 +0000</pubDate>
		<dc:creator>masakazu</dc:creator>
				<category><![CDATA[OS]]></category>

		<guid isPermaLink="false">http://bougaidenpa.org/masakazu/?p=34</guid>
		<description><![CDATA[<p>
以下の環境で iozone による Benchmark を実施してみました。
</p>

/dev/sdb1 上に作成した Ext3 Filesystem
/dev/drbd0 上に作成した Ext3 Filesystem
/dev/drbd0 上に作成した OCFS2 Filesystem
/dev/drbd0 上に作成した GFS Filesystem
/dev/sdb1 上に作成した Ext3 Filesystem 上に作成したファイルを Disk Image として構築した Xen 準仮想化仮想マシン上に作成した Ext3 Filesystem
/dev/drbd0 上に作成した Ext3 Filesystem 上に作成したファイルを Disk Image として構築した Xen 準仮想化仮想マシン上に作成した Ext3 Filesystem
/dev/drbd0 上に作成した OCFS2 Filesystem 上に作成したファイルを Disk Image として構築した Xen 準仮想化仮想マシン上に作成した Ext3 Filesystem
/dev/drbd0 上に作成した GFS Filesystem 上に作成したファイルを Disk Image [...]]]></description>
			<content:encoded><![CDATA[<p>
以下の環境で <a href="http://www.iozone.org/">iozone</a> による Benchmark を実施してみました。
</p>
<ul>
<li>/dev/sdb1 上に作成した Ext3 Filesystem</li>
<li>/dev/drbd0 上に作成した Ext3 Filesystem</li>
<li>/dev/drbd0 上に作成した OCFS2 Filesystem</li>
<li>/dev/drbd0 上に作成した GFS Filesystem</li>
<li>/dev/sdb1 上に作成した Ext3 Filesystem 上に作成したファイルを Disk Image として構築した Xen 準仮想化仮想マシン上に作成した Ext3 Filesystem</li>
<li>/dev/drbd0 上に作成した Ext3 Filesystem 上に作成したファイルを Disk Image として構築した Xen 準仮想化仮想マシン上に作成した Ext3 Filesystem</li>
<li>/dev/drbd0 上に作成した OCFS2 Filesystem 上に作成したファイルを Disk Image として構築した Xen 準仮想化仮想マシン上に作成した Ext3 Filesystem</li>
<li>/dev/drbd0 上に作成した GFS Filesystem 上に作成したファイルを Disk Image として構築した Xen 準仮想化仮想マシン上に作成した Ext3 Filesystem</li>
</ul>
<p>
Benchmark 実行環境は以下の通り。
</p>
<table>
<tr>
<td>CPU</td>
<td>Intel(R) Pentium(R) D CPU 3.00GHz</td>
</tr>
<tr>
<td>メモリ</td>
<td>2GB(ただし Dom0 に 512MB のみ割り当て)</td>
</tr>
<tr>
<td>ディスク</td>
<td>FUJITSU MAX3073RC(容量:73.5GB/回転数:15000rpm/SAS 3Gbps)</td>
</tr>
<tr>
<td>NIC</td>
<td>Broadcom NetXtreme BCM5721 Gigabit Ethernet PCI Express</td>
</tr>
</table>
<p>
DRBD でミラー先として用いた環境は以下の通り。
</p>
<table>
<tr>
<td>CPU</td>
<td>Intel(R) Celeron(R) CPU 3.06GHz</td>
</tr>
<tr>
<td>メモリ</td>
<td>1GB(ただし Dom0 に 512MB のみ割り当て)</td>
</tr>
<tr>
<td>ディスク</td>
<td>FUJITSU MAX3073RC(容量:73.5GB/回転数:15000rpm/SAS 3Gbps)</td>
</tr>
<tr>
<td>NIC</td>
<td>Broadcom NetXtreme BCM5721 Gigabit Ethernet PCI Express</td>
</tr>
</table>
<p>
結果は以下の通り。念のため 3 回実行した平均値を求めています。
</p>
<ul>
<li><a href="http://jinkakunashi.com/~masakazu/fs16mb.htm">16MB のファイルを 4kB から 16MB までのレコードサイズで読み書きした際の結果</a></li>
<li><a href="http://jinkakunashi.com/~masakazu/fs512mb.htm">512MB のファイルを 4kB から 16MB までのレコードサイズで読み書きした際の結果</a></li>
<li><a href="http://jinkakunashi.com/~masakazu/rs128mb.htm">レコードサイズを 128kB 固定にして 128kB から 512MB までのサイズのファイルを読み書きした際の結果</a></li>
<li><a href="http://jinkakunashi.com/~masakazu/result.xls">上記結果を格納した Excel ファイル</a></li>
</ul>
<p>
書き込み系の処理ではなぜか OCFS2/GFS の方がローカルディスクの Ext3 よりもスループットが高いことになってしまいました。なんでこんな結果になるのか理解できません。ひょっとしてライトバックでもしている？
</p>
<p>
あと Xen 上の Filesystem が全然遅くなっていない。本当か？
</p>
<p>
Xen の仮想マシン上はもっと性能が悪いのかと思っていたけど実際にはなかなかよさげです。</p>
]]></content:encoded>
			<wfw:commentRss>http://bougaidenpa.org/masakazu/archives/34/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DRBD &amp; Heartbeat &#8211; takeover/failback verification</title>
		<link>http://bougaidenpa.org/masakazu/archives/29</link>
		<comments>http://bougaidenpa.org/masakazu/archives/29#comments</comments>
		<pubDate>Wed, 12 Sep 2007 15:57:12 +0000</pubDate>
		<dc:creator>masakazu</dc:creator>
				<category><![CDATA[OS]]></category>

		<guid isPermaLink="false">http://bougaidenpa.org/masakazu/?p=29</guid>
		<description><![CDATA[<p>
DRBD 上の ext3 filesystem を Heartbeat 配下に設定し、 Primary を落としたときと、落としてからあげたときの syslog。
</p>
<p>
何が起きているのかさっぱりですが、時間を作って追っかけたいと思います。
</p>
<p>
とりあえず、 Primary で mount されてた /var/lib/mysql という directory は、 Primary の shutdown 後、ちゃんと Secondary で mount されました。そして落とした Primary の復旧後、ちゃんと Secondary から Primary に戻りました。
</p>
<p>
以下の document が参考になるかも。
</p>

DRBD &#8211; Integrating with Heartbeat V1 [対訳]- http://bougaidenpa.org/masakazu/entry/drbd_integrating_with_heartbeat_v1

<p>
以下は設定。
</p>

FILE: /etc/drbd.conf
--
resource r0 {
protocol C;
incon-degr-cmd &#34;echo '!DRBD! pri on incon-degr' &#124; wall ; sleep 60 ; [...]]]></description>
			<content:encoded><![CDATA[<p>
DRBD 上の ext3 filesystem を Heartbeat 配下に設定し、 Primary を落としたときと、落としてからあげたときの syslog。
</p>
<p>
何が起きているのかさっぱりですが、時間を作って追っかけたいと思います。
</p>
<p>
とりあえず、 Primary で mount されてた /var/lib/mysql という directory は、 Primary の shutdown 後、ちゃんと Secondary で mount されました。そして落とした Primary の復旧後、ちゃんと Secondary から Primary に戻りました。
</p>
<p>
以下の document が参考になるかも。
</p>
<ul>
<li><a href="http://bougaidenpa.org/masakazu/entry/drbd_integrating_with_heartbeat_v1">DRBD &#8211; Integrating with Heartbeat V1 [対訳]<br />- http://bougaidenpa.org/masakazu/entry/drbd_integrating_with_heartbeat_v1</a></li>
</ul>
<p>
以下は設定。
</p>
<pre class="sourcecode">
FILE: /etc/drbd.conf
--
resource r0 {
protocol C;
incon-degr-cmd &quot;echo '!DRBD! pri on incon-degr' | wall ; sleep 60 ; halt -f&quot;;
startup {
degr-wfc-timeout 120;
}
disk {
on-io-error   detach;
}
net {
}
syncer {
rate 10M;
group 1;
al-extents 257;
}
on debiancluster1 {
device     /dev/drbd0;
disk       /dev/sdb1;
address    192.168.2.16:7788;
meta-disk  internal;
}
on debiancluster2 {
device    /dev/drbd0;
disk      /dev/sdb1;
address   192.168.2.17:7788;
meta-disk internal;
}
}
</pre>
<pre class="sourcecode">
FILE: /etc/ha.d/ha.cf
--
logfacility     local0
ucast eth1 192.168.2.17
#ucast eth1 192.168.2.16
auto_failback on
node debiancluster1
node debiancluster2
</pre>
<pre class="sourcecode">
FILE: /etc/ha.d/haresources
--
debiancluster1 drbddisk::r0 Filesystem::/dev/drbd0::/var/lib/mysql::ext3
</pre>
<p>
以下は Primary 側を強制 shutdown させたときの Secondary 側の syslog。
</p>
<pre class="console">
Sep 13 00:08:38 debiancluster2 kernel: drbd0: PingAck did not arrive in time.
Sep 13 00:08:38 debiancluster2 kernel: drbd0: drbd0_asender [6652]: cstate Connected --> NetworkFailure
Sep 13 00:08:38 debiancluster2 kernel: drbd0: asender terminated
Sep 13 00:08:38 debiancluster2 kernel: drbd0: drbd0_receiver [3462]: cstate NetworkFailure --> BrokenPipe
Sep 13 00:08:38 debiancluster2 kernel: drbd0: short read expecting header on sock: r=-512
Sep 13 00:08:38 debiancluster2 kernel: drbd0: worker terminated
Sep 13 00:08:38 debiancluster2 kernel: drbd0: drbd0_receiver [3462]: cstate BrokenPipe --> Unconnected
Sep 13 00:08:38 debiancluster2 kernel: drbd0: Connection lost.
Sep 13 00:08:38 debiancluster2 kernel: drbd0: drbd0_receiver [3462]: cstate Unconnected --> WFConnection
Sep 13 00:08:56 debiancluster2 heartbeat: [6088]: WARN: node debiancluster1: is dead
Sep 13 00:08:56 debiancluster2 heartbeat: [6088]: WARN: No STONITH device configured.
Sep 13 00:08:56 debiancluster2 heartbeat: [6088]: WARN: Shared disks are not protected.
Sep 13 00:08:56 debiancluster2 heartbeat: [6088]: info: Resources being acquired from debiancluster1.
Sep 13 00:08:56 debiancluster2 heartbeat: [6088]: info: Link debiancluster1:eth1 dead.
Sep 13 00:08:56 debiancluster2 heartbeat: [6925]: debug: notify_world: setting SIGCHLD Handler to SIG_DFL
Sep 13 00:08:56 debiancluster2 harc[6925]: info: Running /etc/ha.d/rc.d/status status
Sep 13 00:08:56 debiancluster2 heartbeat: [6926]: info: No local resources [/usr/lib/heartbeat/ResourceManager listkeys debiancluster2] to acquire.
Sep 13 00:08:56 debiancluster2 heartbeat: [6088]: debug: StartNextRemoteRscReq(): child count 1
Sep 13 00:08:56 debiancluster2 mach_down[6945]: info: Taking over resource group drbddisk::r0
Sep 13 00:08:57 debiancluster2 ResourceManager[6965]: info: Acquiring resource group: debiancluster1 drbddisk::r0 Filesystem::/dev/drbd0::/var/lib/mysql::ext3
Sep 13 00:08:57 debiancluster2 ResourceManager[6965]: info: Running /etc/ha.d/resource.d/drbddisk r0 start
Sep 13 00:08:57 debiancluster2 ResourceManager[6965]: debug: Starting /etc/ha.d/resource.d/drbddisk r0 start
Sep 13 00:08:57 debiancluster2 kernel: drbd0: Secondary/Unknown --> Primary/Unknown
Sep 13 00:08:57 debiancluster2 ResourceManager[6965]: debug: /etc/ha.d/resource.d/drbddisk r0 start done. RC=0
Sep 13 00:08:57 debiancluster2 Filesystem[7101]: INFO: Running status for /dev/drbd0 on /var/lib/mysql
Sep 13 00:08:57 debiancluster2 Filesystem[7101]: INFO: /var/lib/mysql is unmounted (stopped)
Sep 13 00:08:57 debiancluster2 Filesystem[7037]: INFO: Filesystem Resource is stopped
Sep 13 00:08:57 debiancluster2 ResourceManager[6965]: info: Running /etc/ha.d/resource.d/Filesystem /dev/drbd0 /var/lib/mysql ext3 start
Sep 13 00:08:57 debiancluster2 ResourceManager[6965]: debug: Starting /etc/ha.d/resource.d/Filesystem /dev/drbd0 /var/lib/mysql ext3 start
Sep 13 00:08:57 debiancluster2 Filesystem[7210]: INFO: Running start for /dev/drbd0 on /var/lib/mysql
Sep 13 00:08:57 debiancluster2 kernel: kjournald starting.  Commit interval 5 seconds
Sep 13 00:08:57 debiancluster2 kernel: EXT3 FS on drbd0, internal journal
Sep 13 00:08:57 debiancluster2 kernel: EXT3-fs: recovery complete.
Sep 13 00:08:57 debiancluster2 kernel: EXT3-fs: mounted filesystem with ordered data mode.
Sep 13 00:08:57 debiancluster2 Filesystem[7146]: INFO: Filesystem Success
Sep 13 00:08:58 debiancluster2 ResourceManager[6965]: debug: /etc/ha.d/resource.d/Filesystem /dev/drbd0 /var/lib/mysql ext3 start done. RC=0
Sep 13 00:08:58 debiancluster2 mach_down[6945]: info: /usr/lib/heartbeat/mach_down: nice_failback: foreign resources acquired
Sep 13 00:08:58 debiancluster2 mach_down[6945]: info: mach_down takeover complete for node debiancluster1.
Sep 13 00:08:58 debiancluster2 heartbeat: [6088]: info: mach_down takeover complete.
</pre>
<p>
以下は強制 shutdown した Primary を再起動したときの Primary 側の syslog。
</p>
<pre class="console">
Sep 13 09:11:24 debiancluster1 kernel: drbd: initialised. Version: 0.7.21 (api:79/proto:74)
Sep 13 09:11:24 debiancluster1 kernel: drbd: SVN Revision: 2326 build by root@debiancluster1, 2007-09-13 07:55:36
Sep 13 09:11:24 debiancluster1 kernel: drbd: registered as block device major 147
Sep 13 09:11:24 debiancluster1 kernel: drbd0: resync bitmap: bits=5208430 words=81382
Sep 13 09:11:24 debiancluster1 kernel: drbd0: size = 19 GB (20833720 KB)
Sep 13 09:11:24 debiancluster1 kernel: drbd0: 0 KB marked out-of-sync by on disk bit-map.
Sep 13 09:11:24 debiancluster1 kernel: drbd0: Found 6 transactions (267 active extents) in activity log.
Sep 13 09:11:24 debiancluster1 kernel: drbd0: Marked additional 809 MB as out-of-sync based on AL.
Sep 13 09:11:24 debiancluster1 kernel: drbd0: drbdsetup [2198]: cstate Unconfigured --> StandAlone
Sep 13 09:11:25 debiancluster1 kernel: drbd0: drbdsetup [2211]: cstate StandAlone --> Unconnected
Sep 13 09:11:25 debiancluster1 kernel: drbd0: drbd0_receiver [2212]: cstate Unconnected --> WFConnection
Sep 13 09:11:25 debiancluster1 kernel: drbd0: drbd0_receiver [2212]: cstate WFConnection --> WFReportParams
Sep 13 09:11:25 debiancluster1 kernel: drbd0: Handshake successful: DRBD Network Protocol version 74
Sep 13 09:11:25 debiancluster1 kernel: drbd0: Connection established.
Sep 13 09:11:25 debiancluster1 kernel: drbd0: I am(S): 1:00000002:00000001:00000003:00000002:10
Sep 13 09:11:25 debiancluster1 kernel: drbd0: Peer(P): 1:00000002:00000001:00000003:00000003:10
Sep 13 09:11:25 debiancluster1 kernel: drbd0: drbd0_receiver [2212]: cstate WFReportParams --> WFBitMapT
Sep 13 09:11:25 debiancluster1 kernel: drbd0: Secondary/Unknown --> Secondary/Primary
Sep 13 09:11:25 debiancluster1 kernel: drbd0: drbd0_receiver [2212]: cstate WFBitMapT --> SyncTarget
Sep 13 09:11:25 debiancluster1 kernel: drbd0: Resync started as SyncTarget (need to sync 828856 KB [207214 bits set]).
Sep 13 09:11:30 debiancluster1 heartbeat: [2278]: WARN: Core dumps could be lost if multiple dumps occur
Sep 13 09:11:30 debiancluster1 heartbeat: [2278]: WARN: Consider setting /proc/sys/kernel/core_uses_pid (or equivalent) to 1 for maximum supportability
Sep 13 09:11:31 debiancluster1 heartbeat: [2278]: WARN: Logging daemon is disabled --enabling logging daemon is recommended
Sep 13 09:11:31 debiancluster1 heartbeat: [2278]: info: **************************
Sep 13 09:11:31 debiancluster1 heartbeat: [2278]: info: Configuration validated. Starting heartbeat 2.0.7
Sep 13 09:11:31 debiancluster1 heartbeat: [2279]: info: heartbeat: version 2.0.7
Sep 13 09:11:31 debiancluster1 heartbeat: [2279]: info: Heartbeat generation: 4
Sep 13 09:11:31 debiancluster1 heartbeat: [2279]: info: G_main_add_TriggerHandler: Added signal manual handler
Sep 13 09:11:31 debiancluster1 heartbeat: [2279]: info: G_main_add_TriggerHandler: Added signal manual handler
Sep 13 09:11:31 debiancluster1 heartbeat: [2279]: info: Removing /var/run/heartbeat/rsctmp failed, recreating.
Sep 13 09:11:31 debiancluster1 heartbeat: [2279]: info: glib: ucast: write socket priority set to IPTOS_LOWDELAY on eth1
Sep 13 09:11:31 debiancluster1 heartbeat: [2279]: info: glib: ucast: bound send socket to device: eth1
Sep 13 09:11:31 debiancluster1 heartbeat: [2279]: info: glib: ucast: bound receive socket to device: eth1
Sep 13 09:11:31 debiancluster1 heartbeat: [2279]: info: glib: ucast: started on port 694 interface eth1 to 192.168.2.17
Sep 13 09:11:31 debiancluster1 heartbeat: [2279]: info: G_main_add_SignalHandler: Added signal handler for signal 17
Sep 13 00:11:42 debiancluster1 heartbeat: [2279]: info: Local status now set to: 'up'
Sep 13 00:11:42 debiancluster1 heartbeat: [2279]: info: Link debiancluster2:eth1 up.
Sep 13 00:11:42 debiancluster1 heartbeat: [2279]: info: Status update for node debiancluster2: status active
Sep 13 00:11:42 debiancluster1 heartbeat: [2343]: debug: notify_world: setting SIGCHLD Handler to SIG_DFL
Sep 13 00:11:42 debiancluster1 harc[2343]: info: Running /etc/ha.d/rc.d/status status
Sep 13 00:11:43 debiancluster1 heartbeat: [2279]: info: Comm_now_up(): updating status to active
Sep 13 00:11:43 debiancluster1 heartbeat: [2279]: info: Local status now set to: 'active'
Sep 13 00:11:43 debiancluster1 heartbeat: [2279]: WARN: G_CH_dispatch_int: Dispatch function for read child took too long to execute: 480 ms (> 50 ms) (GSource: 0x5dfeb8)
Sep 13 00:11:43 debiancluster1 heartbeat: [2279]: info: remote resource transition completed.
Sep 13 00:11:43 debiancluster1 heartbeat: [2279]: info: remote resource transition completed.
Sep 13 00:11:43 debiancluster1 heartbeat: [2279]: info: Local Resource acquisition completed. (none)
Sep 13 00:11:44 debiancluster1 heartbeat: [2279]: info: debiancluster2 wants to go standby [foreign]
Sep 13 00:11:46 debiancluster1 kernel: drbd0: Secondary/Primary --> Secondary/Secondary
Sep 13 00:11:46 debiancluster1 heartbeat: [2279]: info: standby: acquire [foreign] resources from debiancluster2
Sep 13 00:11:46 debiancluster1 heartbeat: [2354]: info: acquire local HA resources (standby).
Sep 13 00:11:46 debiancluster1 ResourceManager[2364]: info: Acquiring resource group: debiancluster1 drbddisk::r0 Filesystem::/dev/drbd0::/var/lib/mysql::ext3
Sep 13 00:11:46 debiancluster1 ResourceManager[2364]: info: Running /etc/ha.d/resource.d/drbddisk r0 start
Sep 13 00:11:46 debiancluster1 ResourceManager[2364]: debug: Starting /etc/ha.d/resource.d/drbddisk r0 start
Sep 13 00:11:46 debiancluster1 kernel: drbd0: Secondary/Secondary --> Primary/Secondary
Sep 13 00:11:46 debiancluster1 ResourceManager[2364]: debug: /etc/ha.d/resource.d/drbddisk r0 start done. RC=0
Sep 13 00:11:47 debiancluster1 Filesystem[2500]: INFO: Running status for /dev/drbd0 on /var/lib/mysql
Sep 13 00:11:47 debiancluster1 Filesystem[2500]: INFO: /var/lib/mysql is unmounted (stopped)
Sep 13 00:11:47 debiancluster1 Filesystem[2436]: INFO: Filesystem Resource is stopped
Sep 13 00:11:47 debiancluster1 ResourceManager[2364]: info: Running /etc/ha.d/resource.d/Filesystem /dev/drbd0 /var/lib/mysql ext3 start
Sep 13 00:11:47 debiancluster1 ResourceManager[2364]: debug: Starting /etc/ha.d/resource.d/Filesystem /dev/drbd0 /var/lib/mysql ext3 start
Sep 13 00:11:47 debiancluster1 Filesystem[2609]: INFO: Running start for /dev/drbd0 on /var/lib/mysql
Sep 13 00:11:49 debiancluster1 kernel: kjournald starting.  Commit interval 5 seconds
Sep 13 00:11:49 debiancluster1 kernel: EXT3 FS on drbd0, internal journal
Sep 13 00:11:49 debiancluster1 kernel: EXT3-fs: mounted filesystem with ordered data mode.
Sep 13 00:11:49 debiancluster1 Filesystem[2545]: INFO: Filesystem Success
Sep 13 00:11:49 debiancluster1 ResourceManager[2364]: debug: /etc/ha.d/resource.d/Filesystem /dev/drbd0 /var/lib/mysql ext3 start done. RC=0
Sep 13 00:11:49 debiancluster1 heartbeat: [2354]: info: local HA resource acquisition completed (standby).
Sep 13 00:11:49 debiancluster1 heartbeat: [2279]: info: Standby resource acquisition done [foreign].
Sep 13 00:11:49 debiancluster1 heartbeat: [2279]: info: Initial resource acquisition complete (auto_failback)
Sep 13 00:11:49 debiancluster1 heartbeat: [2279]: info: remote resource transition completed.
Sep 13 00:13:40 debiancluster1 kernel: drbd0: Resync done (total 127 sec; paused 0 sec; 6524 K/sec)
Sep 13 00:13:40 debiancluster1 kernel: drbd0: drbd0_worker [2199]: cstate SyncTarget --> Connected
</pre>
<p>
以下は強制 shutdown した Primary を再起動したときの Secondary 側の syslog。
</p>
<pre class="console">
Sep 13 00:11:32 debiancluster2 kernel: drbd0: drbd0_receiver [3462]: cstate WFConnection --> WFReportParams
Sep 13 00:11:32 debiancluster2 kernel: drbd0: Handshake successful: DRBD Network Protocol version 74
Sep 13 00:11:32 debiancluster2 kernel: drbd0: Connection established.
Sep 13 00:11:32 debiancluster2 kernel: drbd0: I am(P): 1:00000002:00000001:00000003:00000003:10
Sep 13 00:11:32 debiancluster2 kernel: drbd0: Peer(S): 1:00000002:00000001:00000003:00000002:10
Sep 13 00:11:32 debiancluster2 kernel: drbd0: drbd0_receiver [3462]: cstate WFReportParams --> WFBitMapS
Sep 13 00:11:32 debiancluster2 kernel: drbd0: Primary/Unknown --> Primary/Secondary
Sep 13 00:11:32 debiancluster2 kernel: drbd0: drbd0_receiver [3462]: cstate WFBitMapS --> SyncSource
Sep 13 00:11:32 debiancluster2 kernel: drbd0: Resync started as SyncSource (need to sync 828856 KB [207214 bits set]).
Sep 13 00:11:42 debiancluster2 heartbeat: [6088]: info: Heartbeat restart on node debiancluster1
Sep 13 00:11:42 debiancluster2 heartbeat: [6088]: info: Link debiancluster1:eth1 up.
Sep 13 00:11:42 debiancluster2 heartbeat: [6088]: info: Status update for node debiancluster1: status init
Sep 13 00:11:42 debiancluster2 heartbeat: [6088]: info: Status update for node debiancluster1: status up
Sep 13 00:11:42 debiancluster2 heartbeat: [6088]: debug: StartNextRemoteRscReq(): child count 1
Sep 13 00:11:42 debiancluster2 heartbeat: [6088]: debug: get_delnodelist: delnodelist=
Sep 13 00:11:42 debiancluster2 heartbeat: [7260]: debug: notify_world: setting SIGCHLD Handler to SIG_DFL
Sep 13 00:11:42 debiancluster2 harc[7260]: info: Running /etc/ha.d/rc.d/status status
Sep 13 00:11:42 debiancluster2 heartbeat: [7270]: debug: notify_world: setting SIGCHLD Handler to SIG_DFL
Sep 13 00:11:42 debiancluster2 harc[7270]: info: Running /etc/ha.d/rc.d/status status
Sep 13 00:11:43 debiancluster2 heartbeat: [6088]: info: Status update for node debiancluster1: status active
Sep 13 00:11:43 debiancluster2 heartbeat: [7280]: debug: notify_world: setting SIGCHLD Handler to SIG_DFL
Sep 13 00:11:43 debiancluster2 harc[7280]: info: Running /etc/ha.d/rc.d/status status
Sep 13 00:11:43 debiancluster2 heartbeat: [6088]: info: remote resource transition completed.
Sep 13 00:11:43 debiancluster2 heartbeat: [6088]: info: debiancluster2 wants to go standby [foreign]
Sep 13 00:11:44 debiancluster2 heartbeat: [6088]: info: standby: debiancluster1 can take our foreign resources
Sep 13 00:11:44 debiancluster2 heartbeat: [7290]: info: give up foreign HA resources (standby).
Sep 13 00:11:44 debiancluster2 ResourceManager[7300]: info: Releasing resource group: debiancluster1 drbddisk::r0 Filesystem::/dev/drbd0::/var/lib/mysql::ext3
Sep 13 00:11:44 debiancluster2 ResourceManager[7300]: info: Running /etc/ha.d/resource.d/Filesystem /dev/drbd0 /var/lib/mysql ext3 stop
Sep 13 00:11:44 debiancluster2 ResourceManager[7300]: debug: Starting /etc/ha.d/resource.d/Filesystem /dev/drbd0 /var/lib/mysql ext3 stop
Sep 13 00:11:45 debiancluster2 Filesystem[7399]: INFO: Running stop for /dev/drbd0 on /var/lib/mysql
Sep 13 00:11:45 debiancluster2 Filesystem[7399]: INFO: Trying to unmount /var/lib/mysql
Sep 13 00:11:45 debiancluster2 Filesystem[7399]: INFO: unmounted /var/lib/mysql successfully
Sep 13 00:11:45 debiancluster2 Filesystem[7335]: INFO: Filesystem Success
Sep 13 00:11:45 debiancluster2 ResourceManager[7300]: debug: /etc/ha.d/resource.d/Filesystem /dev/drbd0 /var/lib/mysql ext3 stop done. RC=0
Sep 13 00:11:45 debiancluster2 ResourceManager[7300]: info: Running /etc/ha.d/resource.d/drbddisk r0 stop
Sep 13 00:11:45 debiancluster2 ResourceManager[7300]: debug: Starting /etc/ha.d/resource.d/drbddisk r0 stop
Sep 13 00:11:45 debiancluster2 kernel: drbd0: Primary/Secondary --> Secondary/Secondary
Sep 13 00:11:46 debiancluster2 ResourceManager[7300]: debug: /etc/ha.d/resource.d/drbddisk r0 stop done. RC=0
Sep 13 00:11:46 debiancluster2 heartbeat: [7290]: info: foreign HA resource release completed (standby).
Sep 13 00:11:46 debiancluster2 heartbeat: [6088]: info: Local standby process completed [foreign].
Sep 13 00:11:46 debiancluster2 kernel: drbd0: Secondary/Secondary --> Secondary/Primary
Sep 13 00:11:49 debiancluster2 heartbeat: [6088]: WARN: 1 lost packet(s) for [debiancluster1] [17:19]
Sep 13 00:11:49 debiancluster2 heartbeat: [6088]: info: remote resource transition completed.
Sep 13 00:11:49 debiancluster2 heartbeat: [6088]: info: No pkts missing from debiancluster1!
Sep 13 00:11:49 debiancluster2 heartbeat: [6088]: info: Other node completed standby takeover of foreign resources.
Sep 13 00:13:32 debiancluster2 kernel: drbd0: [drbd0_worker/6924] sock_sendmsg time expired, ko = 4294967295
Sep 13 00:13:40 debiancluster2 kernel: drbd0: Resync done (total 127 sec; paused 0 sec; 6524 K/sec)
Sep 13 00:13:40 debiancluster2 kernel: drbd0: drbd0_worker [6924]: cstate SyncSource --> Connected
</pre>
]]></content:encoded>
			<wfw:commentRss>http://bougaidenpa.org/masakazu/archives/29/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DRBD &#8211; Integrating with Heartbeat V2 [対訳]</title>
		<link>http://bougaidenpa.org/masakazu/archives/24</link>
		<comments>http://bougaidenpa.org/masakazu/archives/24#comments</comments>
		<pubDate>Sun, 26 Aug 2007 17:39:08 +0000</pubDate>
		<dc:creator>masakazu</dc:creator>
				<category><![CDATA[OS]]></category>

		<guid isPermaLink="false">http://bougaidenpa.org/masakazu/?p=24</guid>
		<description><![CDATA[<p>
DRBD &#8211; Integrating with Heartbeat V2(http://www.drbd.org/drbd8-howto2.html) の対訳。
</p>
<p>
誤訳がありましたらコメントにてご指摘ください。
</p>


前: DRBD &#8211; Integrating with Heartbeat V1 [対訳]




Getting and installing Heartbeat
Heartbeat の入手とインストール

<p>
As with Heartbeat V1, the preferred way of installing Heartbeat V2 is through your distribution&#8217;s package management frontend (yum, apt, rug, whatever). If you do want to build and install from source, the Linux-HA download area has the necessary [...]]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://www.drbd.org/drbd8-howto2.html">DRBD &#8211; Integrating with Heartbeat V2(http://www.drbd.org/drbd8-howto2.html)</a> の対訳。
</p>
<p>
誤訳がありましたらコメントにてご指摘ください。
</p>
<table width="100%">
<tr>
<td align="left"><a href="http://bougaidenpa.org/masakazu/entry/drbd_integrating_with_heartbeat_v1">前: DRBD &#8211; Integrating with Heartbeat V1 [対訳]</a></td>
<td align="right"></td>
</tr>
</table>
<div class="myh">
Getting and installing Heartbeat<br/><br />
<span class="trans">Heartbeat の入手とインストール</span>
</div>
<p>
As with Heartbeat V1, the preferred way of installing Heartbeat V2 is through your distribution&#8217;s package management frontend (yum, apt, rug, whatever). If you do want to build and install from source, the Linux-HA download area has the necessary archives.<br/><br />
<span class="trans">Heartbeat V1 と同様、 Heartbeat V2 のお勧めのインストール方法はディストリビューションのパッケージ管理ツール(yum, apt, rug, など)を利用する方法である。もしソースからビルドとインストールを行いたいのであれば、 Linux-HA のダウンロードサイトに必要となるアーカイブがある。</span>
</p>
<p>
On the Linux-HA site, you will also find the Getting Started V2 howto that will enable you to get an initial Heartbeat V2 configuration up and running.<br/><br />
<span class="trans">Linux-HA サイトには、 Heartbeat V2 の初期設定と起動のための Getting Starget  V2 howto も見つけられるだろう。</span>
</p>
<div class="myh">
Prerequisites<br/><br />
<span class="trans">前提条件</span>
</div>
<p>
The same prerequisites apply for Heartbeat V2 as do for Heartbeat V1. In fact, you might run Heartbeat V2 just like V1, with unchanged configuration. If, however, you want to use Heartbeat&#8217;s new Cluster Resource Manager (CRM) introduced in V2, you need to include this line in your /etc/ha.d/ha.cf:<br/><br />
<span class="trans">Heartbeat V1 と同様の前提条件が Heartbeat V2 でも適用される。実際、設定を変更せず Heartbeat V2 を V1 と同じように実行できるかもしれない。しかし、Heartbeat V2 で新しく導入されたクラスターリソースマネージャ(CRM)を利用したいのであれば、 /etc/ha.d/ha.cf に以下の行を追加する必要がある:</span>
</p>
<pre class="sourcecode">
crm yes
</pre>
<p>
Simple, isn&#8217;t it? Note that if you have that option enabled, Heartbeat will no longer read the haresources file on startup, and will issue a warning if that file exists.<br/><br />
<span class="trans">単純だろう。このオプションを有効にすると、 Heartbeat はもう haresources ファイルを起動時に読み込まなくなり、もしこのファイルが存在した場合に警告するようになる。</span>
</p>
<div class="myh">
Cluster Information Base (CIB) configuration<br/><br />
<span class="trans">クラスター情報ベース(CIB) の設定</span>
</div>
<p>
Heartbeat V2 resources are defined in the Cluster Information Base XML file, usually found in /var/lib/heartbeat/crm/cib.xml. This may be edited manually, see the Linux-HA site for more information (however, see the following paragraph if you prefer a more user-friendly approach).<br/><br />
<span class="trans">Heartbeat V2 のリソースはクラスター情報ベースという XML ファイルで定義される。このファイルは普通 /var/lib/heartbeat/crm/cib.xml にある。このファイルは手動で編集される。詳細な情報は Linux-HA サイトを参照せよ。(ただしよりユーザーフレンドリーな方法を好むようであれば次の節を参照。)</span>
</p>
<div class="myh">
Using the Heartbeat V2 GUI<br/><br />
<span class="trans">Heartbeat V2 GUI を利用する</span>
</div>
<p>
Heartbeat V2 includes a GUI for the cluster resource manager, which will manipulate the Cluster Information Base for you. It is written in Python and requires GTK+, Glade, and the associated Python bindings. It&#8217;s named ha_client.py, though some distributions rename it to hbgui or similar.<br/><br />
<span class="trans">Heartbeat V2 はクラスターリソースマネージャのための GUI を含んでいる。これはクラスター情報ベースを操作する。これは Python で書かれ GTK+, Glade, そして関連する Python バインディングを必要とする。 ha_client.py という名前で、いくつかのディストリビューションはこれを hbgui などと名前を変更している。</span>
</p>
<div class="myh">
Heartbeat V2 DRBD resources<br/><br />
<span class="trans">Heartbeat V2 での DRBD リソース</span>
</div>
<p>
With Heartbeat V2, you may address DRBD resources in one of two ways:<br/><br />
<span class="trans">Heartbeat V2 では DRBD リソースを二つのうち一つの方法で示すことになる。</span>
</p>
<ul>
<li>the drbddisk resource type, as in Heartbeat V1,<br/><br />
<span class="trans">Heartbeat V1 で drbddisk リソースタイプ</span></li>
<li>the drbd resource type, using the Heartbeat V2/OCF interface.<br/><br />
<span class="trans">Heartbeat V2/OCF インターフェースで drbd リソースタイプ</span></li>
</ul>
<div class="myh">
DRBD/Heartbeart V2 configuration check list<br/><br />
<span class="trans">DRBD/Heartbeat V2 設定チェックリスト</span>
</div>
<p>
In order to set up a working DRBD configuration with Heartbeat V2, follow these steps:<br/><br />
<span class="trans">Heartbeat V2 と動作する DRBD の設定をするためには以下の手順に従う:</span>
</p>
<ul>
<li>Set up your DRBD resource (using either the drbddisk or drbd resource type)<br/><br />
<span class="trans">DRBD リソースを設定する(drbddisk か drbd リソースタイプを使って)</span></li>
<li>Set up your filesystem resource<br/><br />
<span class="trans">ファイルシステムリソースを設定する</span></li>
<li>Set up your IP address resource<br/><br />
<span class="trans">IP アドレスリソースを設定する</span></li>
<li>Set up your service resource<br/><br />
<span class="trans">サービスリソースを設定する</span></li>
<li>Create an order constraint so the DRBD resource is activated before the filesystem resource (so Heartbeat doesn&#8217;t attempt to mount a file system on a node that&#8217;s still in secondary mode)<br/><br />
<span class="trans">ファイルシステムの前に DRBD リソースが有効になるよう順序制約を作る(Heartbeat はまだセカンダリモードのノードのファイルシステムをマウントしようとしない)</span></li>
<li>Create a colocation constraint so the filesystem, IP address, and service resources always run on the same node<br/><br />
<span class="trans">ファイルシステムと IP アドレスとサービスリソースが同じノードで実行されるよう位置制約を作る</span></li>
<li>(optional) Set a preferred node for the service resource.<br/><br />
<span class="trans">(オプションで) そのサービスの優先ノードを設定する</span></li>
</ul>
<table width="100%">
<tr>
<td align="left"><a href="http://bougaidenpa.org/masakazu/entry/drbd_integrating_with_heartbeat_v1">前: DRBD &#8211; Integrating with Heartbeat V1 [対訳]</a></td>
<td align="right"></td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://bougaidenpa.org/masakazu/archives/24/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DRBD &#8211; Integrating with Heartbeat V1 [対訳]</title>
		<link>http://bougaidenpa.org/masakazu/archives/23</link>
		<comments>http://bougaidenpa.org/masakazu/archives/23#comments</comments>
		<pubDate>Sun, 26 Aug 2007 16:28:15 +0000</pubDate>
		<dc:creator>masakazu</dc:creator>
				<category><![CDATA[OS]]></category>

		<guid isPermaLink="false">http://bougaidenpa.org/masakazu/?p=23</guid>
		<description><![CDATA[<p>
DRBD &#8211; Integrating with Heartbeat V1(http://www.drbd.org/drbd8-howto1.html) の対訳。
</p>
<p>
誤訳がありましたらコメントにてご指摘ください。
</p>


前: DRBD &#8211; Migrating DRBD resources [対訳]
次: DRBD &#8211; Integrating with Heartbeat V2 [対訳]




Note
ノート

<p>
DRBD is cluster manager agnostic. You may use any cluster manager for managing DRBD resources. Heartbeat (as described here) serves as the canonical example.
DRBD はクラスターマネージャ不可知論者である。あなたは DRBD のリソースを管理するために様々なクラスターマネージャを利用するかもしれない。(ここで説明する)Heartbeat は正規の例を提供する。
</p>


Getting and installing Heartbeat
Heartbeat の取得とインストール

<p>
The preferred way of installing Heartbeat [...]]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://www.drbd.org/drbd8-howto1.html">DRBD &#8211; Integrating with Heartbeat V1(http://www.drbd.org/drbd8-howto1.html)</a> の対訳。
</p>
<p>
誤訳がありましたらコメントにてご指摘ください。
</p>
<table width="100%">
<tr>
<td align="left"><a href="http://bougaidenpa.org/masakazu/entry/drbd_migrating_drbd_resources">前: DRBD &#8211; Migrating DRBD resources [対訳]</a></td>
<td align="right"><a href="http://bougaidenpa.org/masakazu/entry/drbd_integrating_with_heartbeat_v2">次: DRBD &#8211; Integrating with Heartbeat V2 [対訳]</a></td>
</tr>
</table>
<div class="note">
<div class="myh">
Note<br/><br />
<span class="trans">ノート</span>
</div>
<p>
DRBD is cluster manager agnostic. You may use any cluster manager for managing DRBD resources. Heartbeat (as described here) serves as the canonical example.<br/><br />
<span class="trans">DRBD はクラスターマネージャ不可知論者である。あなたは DRBD のリソースを管理するために様々なクラスターマネージャを利用するかもしれない。(ここで説明する)Heartbeat は正規の例を提供する。</span>
</p>
</div>
<div class="myh">
Getting and installing Heartbeat<br/><br />
<span class="trans">Heartbeat の取得とインストール</span>
</div>
<p>
The preferred way of installing Heartbeat is through your distribution&#8217;s package management frontend (yum, apt, rug, whatever). If you do want to build and install from source, the Linux-HA download area has the necessary archives.<br/><br />
<span class="trans">Heartbeat をインストールする完全な方法はあたなが利用しているディストリビュージョンのパッケージ管理ツール(yum, apt, run, など)を利用することだ。もしソースコードからビルドしインストールしたいのであれば Linux-HA のダウンロードサイトに必要なアーカイブがある。</span>
</p>
<p>
On the Linux-HA site, you will also find the Getting Started howto that will enable you to get an initial Heartbeat configuration up and running.<br/><br />
<span class="trans">Linux-HA サイトには、 Heartbeat の初期設定と起動のための Getting Starget howto も見つけられるだろう。</span>
</p>
<div class="myh">
Prerequisites<br/><br />
<span class="trans">前提条件</span>
</div>
<p>
In order to have your DRBD resources managed by Heartbeat, the following conditions must be met beforehand:<br/><br />
<span class="trans">あなたの DRBD リソースを Heartbeat で管理するためには、次の条件を事前に満たさなければならない:</span>
</p>
<ul>
<li>Heartbeat, the DRBD kernel module, and the DRBD userland tools must be installed on both cluster nodes (if you&#8217;re thinking &#8220;duh&#8221; now, that&#8217;s perfectly appropriate)<br/><br />
<span class="trans">Heartbeat, DRBD kernel モジュール, そして DRBD のツールが両方のクラスターノードでインストールされていなければならない(あなたが現在 &#8220;duh&#8221; を考えているなら、それは完全に適切です)。</span></li>
<li>You must have your /etc/ha.d/ha.cf and /etc/ha.d/authkeys configured correctly<br/><br />
<span class="trans">/etc/ha.d/ha.cf と /etc/ha.d/authkeys が適切に設定されていなければならない。</span></li>
<li>DBRD resources must be configured in /etc/drbd.conf, and that file must have been distributed cluster-wide<br/><br />
<span class="trans">RDBD のリソースが /etc/drbd.conf で設定されていなければならない。そしてこのファイルはクラスター間で配布されていなければならない。</span></li>
<li>The DRBD kernel module must be loaded (the resource scripts won&#8217;t do that for you, your specific distribution will, however, offer a facility to automate this at system boot)<br/><br />
<span class="trans">DRBD kernel モジュールがロードされていなければならない(リソーススクリプトはこの作業を行ってくれない、しかしながら、特定のディストリビューションは、システムリブートの時点でこの作業を自動で行ってくれる)。</span></li>
<li>Network connectivity must be established on the DRBD replication path and all Heartbeat communication paths<br/><br />
<span class="trans">ネットワーク接続性が DRBD レプリケーション経路と Heartbeat 通信経路で確立されていなければならない。</span></li>
<li>Not required, but highly recommended: you should have tested and verified manual migration of your DRBD resources<br/><br />
<span class="trans">必須ではないが強く勧める: DRBD リソースへのテストと手動でのマイグレーションをすでに行っている。</span></li>
</ul>
<div class="myh">
Configuring haresources<br/><br />
<span class="trans">haresources の設定</span>
</div>
<p>
The haresources file, /etc/ha.d/haresources, is where you&#8217;ll configure your managed DRBD as a cluster resource. Normally it makes little sense to have DRBD managed without an associated file system. An entry for DRBD in the haresources file might look like this:<br/><br />
<span class="trans">haresources ファイル /etc/ha.d/haresources は、あなたの管理する DRBD をクラスターリソースとして設定する場所である。通常、ファイルシステムと関連しない DRBD を管理することには意味がない。DRBD に対する haresources ファイルの設定は以下のようになる:</span>
</p>
<pre class="console">
joe drbddisk::r0 Filesystem::/dev/drbd0::/var/lib/mysql::ext3
</pre>
<p>
This will instruct Heartbeat to manage the DRBD resource r0 concurrently with the ext3 filesystem /var/lib/mysql, which will be mounted from the corresponding block device /dev/drbd0. The preferred node for this resource is joe.<br/><br />
<span class="trans">これは /dev/drbd0 というブロックデバイス上の ext3 ファイルシステムで /var/lib/mysql にマウントされている DRBD リソース r0 を管理するよう Heartbeat に指示する。このリソースの優先ノードは joe である。</span>
</p>
<p>
Of course, the more typical (and complete) usage would be this:<br/><br />
<span class="trans">もちろん、より典型的(かつ完全)な利用はこのようになる:</span>
</p>
<pre class="console">
joe drbddisk::r0 Filesystem::/dev/drbd0::/var/lib/mysql::ext3 192.168.0.42 mysqld
</pre>
<p>
&#8230; which in addition to the DRBD device and file system will also include a service IP address (192.168.0.42) and a MySQL RDBMS daemon (mysqld) in the same cluster resource.<br/><br />
<span class="trans">&#8230; DRBD デバイスとファイルシステムに加え、同じクラスターリソース上のサービス IP アドレス(192.168.0.42) と MySQL RDBMS デーモン(mysqld) も設定している。</span>
</p>
<div class="note">
<div class="myh">
Note<br/><br />
<span class="trans">ノート</span>
</div>
<p>
Like /etc/drbd.conf, /etc/ha.d/haresources must be identical on both cluster nodes.<br/><br />
<span class="trans">/etc/drbd.conf のように、 /etc/ha.d/haresources は両方のクラスターノードで一致していなければならない。</span>
</p>
</div>
<table width="100%">
<tr>
<td align="left"><a href="http://bougaidenpa.org/masakazu/entry/drbd_migrating_drbd_resources">前: DRBD &#8211; Migrating DRBD resources [対訳]</a></td>
<td align="right"><a href="http://bougaidenpa.org/masakazu/entry/drbd_integrating_with_heartbeat_v2">次: DRBD &#8211; Integrating with Heartbeat V2 [対訳]</a></td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://bougaidenpa.org/masakazu/archives/23/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DRBD &#8211; Migrating DRBD resources [対訳]</title>
		<link>http://bougaidenpa.org/masakazu/archives/22</link>
		<comments>http://bougaidenpa.org/masakazu/archives/22#comments</comments>
		<pubDate>Thu, 23 Aug 2007 16:38:34 +0000</pubDate>
		<dc:creator>masakazu</dc:creator>
				<category><![CDATA[OS]]></category>

		<guid isPermaLink="false">http://bougaidenpa.org/masakazu/?p=22</guid>
		<description><![CDATA[<p>
DRBD &#8211; Migrating DRBD resources(http://www.drbd.org/drbd8-howto0.html) の対訳。
</p>
<p>
誤訳がありましたらコメントにてご指摘ください。
</p>


前: DRBD &#8211; Getting started [対訳]
次: DRBD &#8211; Integrating with Heartbeat V1 [対訳]


<p>
Suppose we have our DRBD resource r0, corresponding to /dev/drbd0, mounted on /mnt on one cluster node (joe), and want to mount it on the other (jane). This page outlines the process of doing this manually.
以下を想定する。DRBD リソース r0 がある。r0 [...]]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://www.drbd.org/drbd8-howto0.html">DRBD &#8211; Migrating DRBD resources(http://www.drbd.org/drbd8-howto0.html)</a> の対訳。
</p>
<p>
誤訳がありましたらコメントにてご指摘ください。
</p>
<table width="100%">
<tr>
<td align="left"><a href="http://bougaidenpa.org/masakazu/entry/drbd_getting_started">前: DRBD &#8211; Getting started [対訳]</a></td>
<td align="right"><a href="http://bougaidenpa.org/masakazu/entry/drbd_integrating_with_heartbeat_v1">次: DRBD &#8211; Integrating with Heartbeat V1 [対訳]</a></td>
</tr>
</table>
<p>
Suppose we have our DRBD resource r0, corresponding to /dev/drbd0, mounted on /mnt on one cluster node (joe), and want to mount it on the other (jane). This page outlines the process of doing this manually.<br/><br />
<span class="trans">以下を想定する。DRBD リソース r0 がある。r0 は /dev/drbd0 に該当する。r0 はクラスターノードの一方(joe) で /mnt にマウントされている。そしてもう一方のクラスターノード(jane) でマウントしたい。このページではこれを手動で行う方法について説明していく。</span>
</p>
<div class="note">
<div class="myh">
Notes<br/><br />
<span class="trans">ノート</span>
</div>
<p>
This walk-through demonstrates the steps in switching resources over manually, which is helpful if you want to test DRBD or see how it works. In any practical configuration, you would have the switch-over/fail-over process managed by a cluster manager.<br/><br />
<span class="trans">このデモではリソースの切り替えを手動で行う。もし DRBD のテストをしたいとかどんな感じで動作するのか知りたいのであればとても参考になるだろう。実際の設定ではクラスターマネージャを用いたスイッチオーバ/フェイルオーバをすることになるだろう。</span>
</p>
<p>
In either scenario, you need to ensure that /etc/drbd.conf is identical on both nodes.<br/><br />
<span class="trans">いずれにせよ、確実に両方のノードの /etc/drbd.conf が同じ内容である必要がある。</span>
</p>
</div>
<div class="myh">
Initial status<br/><br />
<span class="trans">初期状態</span>
</div>
<p>
At first, let&#8217;s have a look what the current DRBD status is from joe&#8217;s perspective:<br/><br />
<span class="trans">最初に、 joe 側で DRBD の状態がどのようになっているかを確認する。</span>
</p>
<pre class="console">
root@joe:~# cat /proc/drbd
version: 8.0.0 (api:86/proto:86)
SVN Revision: 2759 build by florian@sour, 2007-02-21 16:06:15
0: cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate C r---
ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0
resync: used:0/31 hits:0 misses:0 starving:0 dirty:0 changed:0
act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0
</pre>
<div class="myh">
Releasing the device<br/><br />
<span class="trans">デバイスの解放</span>
</div>
<p>
The first thing we do now is free /dev/drbd0 (if we don&#8217;t do this, DRBD will refuse to change that device&#8217;s status):<br/><br />
<span class="trans">まず最初にすることは /dev/drbd0 を解放すること(こうしないと DRBD はデバイスの状態を変えようとしても拒否する)。</span>
</p>
<pre class="console">
root@joe:~# umount /dev/drbd0
</pre>
<div class="myh">
Demoting the resource<br/><br />
<span class="trans">リソースを降格させる</span>
</div>
<p>
Then we demote r0 on joe, so that the device is secondary on both nodes:<br/><br />
<span class="trans">そしたら joe の r0 を降格させる。そうすると両方のノードでデバイスはセカンダリとなる。</span>
</p>
<pre class="console">
root@joe:~# drbdadm secondary r0
root@joe:~# cat /proc/drbd
version: 8.0.0 (api:86/proto:86)
SVN Revision: 2759 build by florian@sour, 2007-02-21 16:06:15
0: cs:Connected st:Secondary/Secondary ds:UpToDate/UpToDate C r---
ns:0 nr:0 dw:0 dr:0 al:0 bm:81 lo:0 pe:0 ua:0 ap:0
resync: used:0/31 hits:0 misses:0 starving:0 dirty:0 changed:0
act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0
</pre>
<div class="myh">
Promoting the resource<br/><br />
<span class="trans">リソースを昇格させる</span>
</div>
<p>
At this time we can promote jane to become the primary node for this resource:<br/><br />
<span class="trans">この時点で jane をこのリソースに対するプライマリノードに昇格させることができる。</span>
</p>
<pre class="console">
root@jane:~# drbdadm primary r0
root@jane:~# cat /proc/drbd
version: 8.0.0 (api:86/proto:86)
SVN Revision: 2759 build by florian@sour, 2007-02-21 16:06:15
0: cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate C r---
ns:0 nr:0 dw:0 dr:0 al:0 bm:81 lo:0 pe:0 ua:0 ap:0
resync: used:0/31 hits:0 misses:0 starving:0 dirty:0 changed:0
act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0
</pre>
<div class="myh">
Using the resource<br/><br />
<span class="trans">リソースを利用する</span>
</div>
<p>
Finally, we can mount the device on Jane:<br/><br />
<span class="trans">最後に jane でデバイスをマウント出来る。</span>
</p>
<pre class="console">
root@jane:~# mount /dev/drbd0 /mnt
</pre>
<div class="myh">
Other things you might want to try<br/><br />
<span class="trans">ほかに試してみたいこと</span>
</div>
<p>
DRBD disallows a few things so as to keep you from shooting yourself in the foot. You might try the following things just to see what happens:<br/><br />
<span class="trans">DRBD は自分で自分の足を撃ってしまわないよういくつかの制限を設けている。なにが起きるのかを確認するために次の事柄をためしてみたいかもしれない。</span>
</p>
<ul>
<li>Demoting a primary device to secondary while it&#8217;s still mounted. This will fail with a &#8220;device held open by someone&#8221; error.<br/><br />
<span class="trans">まだマウントされている状態でプライマリデバイスをセカンダリに降格させようとする。この場合 &#8220;device held open by someone&#8221; というエラーで失敗するだろう。</span></li>
<li>Making a device primary while the other one is primary too, unless this is explicitly allowed.<br/><br />
<span class="trans">(明示的に許可されていない状態で)他方がプライマリの状態でデバイスをプライマリにしようとする。</span></li>
<li>Mounting the backing device directly, while being used by DRBD.<br/><br />
<span class="trans">DRBD で利用されている状態でブロックデバイスを直接マウントしようとする。</span></li>
</ul>
<table width="100%">
<tr>
<td align="left"><a href="http://bougaidenpa.org/masakazu/entry/drbd_getting_started">前: DRBD &#8211; Getting started [対訳]</a></td>
<td align="right"><a href="http://bougaidenpa.org/masakazu/entry/drbd_integrating_with_heartbeat_v1">次: DRBD &#8211; Integrating with Heartbeat V1 [対訳]</a></td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://bougaidenpa.org/masakazu/archives/22/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DRBD &#8211; Getting started [対訳]</title>
		<link>http://bougaidenpa.org/masakazu/archives/21</link>
		<comments>http://bougaidenpa.org/masakazu/archives/21#comments</comments>
		<pubDate>Thu, 23 Aug 2007 15:18:45 +0000</pubDate>
		<dc:creator>masakazu</dc:creator>
				<category><![CDATA[OS]]></category>

		<guid isPermaLink="false">http://bougaidenpa.org/masakazu/?p=21</guid>
		<description><![CDATA[<p>
DRBD &#8211; Getting started(http://www.drbd.org/drbd8-howto.html) の対訳。
</p>
<p>
誤訳がありましたらコメントにてご指摘ください。
</p>



次: DRBD &#8211; Migrating DRBD resources [対訳]


Installation
インストール

<p>
If you install via tarball, you want to read the README and INSTALL notes first.
もし tarball からインストールしたいのであれば、 README と INSTALL を最初に読んだ方がよい。
</p>
<p>
You want to also read the upgrade*.txt files in the drbd src directory, or online in the drbd subversion repository.
また、 drbd ソースディレクトリかオンラインの drbd subversion リポジトリに存在する upgrade*.txt [...]]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://www.drbd.org/drbd8-howto.html">DRBD &#8211; Getting started(http://www.drbd.org/drbd8-howto.html)</a> の対訳。
</p>
<p>
誤訳がありましたらコメントにてご指摘ください。
</p>
<table width="100%">
<tr>
<td align="left"></td>
<td align="right"><a href="http://bougaidenpa.org/masakazu/entry/drbd_migrating_drbd_resources">次: DRBD &#8211; Migrating DRBD resources [対訳]</a></td>
</tr>
</table>
<div class="myh">Installation<br/><br />
<span class="trans">インストール</span>
</div>
<p>
If you install via tarball, you want to read the README and INSTALL notes first.<br/><br />
<span class="trans">もし tarball からインストールしたいのであれば、 README と INSTALL を最初に読んだ方がよい。</span>
</p>
<p>
You want to also read the upgrade*.txt files in the drbd src directory, or online in the drbd subversion repository.<br/><br />
<span class="trans">また、 drbd ソースディレクトリかオンラインの drbd subversion リポジトリに存在する upgrade*.txt ファイル群も読んだ方がよい。</span>
</p>
<p>
Along with the DRBD tarball or your installed DRBD package, you should find a well commented example configuration file. In the tarball this is in ./scripts/drbd.conf, in installed binary packages it most likely ends up in /usr/share/doc/drbd, /usr/share/doc/packages/drbd, or similar.<br/><br />
<span class="trans">DRBD の tarball もしくはインストールされた DRBD パッケージと一緒に、たくさんコメントが書かれた設定ファイル例を見つけられるだろう。 tarball の場合 ./scripts/drbd.conf に、バイナリパッケージでインストールした場合はたいてい /usr/share/doc/drbd とか /usr/share/doc/packages/drbd とかにある。</span>
</p>
<p>
You edit that to your needs, copy it to /etc/drbd.conf on both nodes, and check that the meta-disk points to the right location.<br/><br />
<span class="trans">必要に応じてそのファイルを編集し、両方のノードに /etc/drbd.conf としてコピーし、 meta-disk が正しい場所を向いているか確認する。</span>
</p>
<div class="myh">
DRBD meta data<br/><br />
<span class="trans">DRBD のメタデータ</span>
</div>
<p>
DRBD allows you to either place its meta data on the same backing device where it puts the actual usable production data (internal meta data), or on a separate block device (external meta data). Before DRBD 8, the space required for DRBD meta data was fixed at 128MB, regardless of device size. Starting with DRBD 8, you may refer to this table for estimates of DRBD meta data sizes:<br/><br />
<span class="trans">DRBD ではデータを格納するデバイス上にメタデータを同居させる方法(内部メタデータ)と、別のデバイスに分ける方法(外部メタデータ)のどちらかの方法でメタデータを格納出来る。 DRBD 8 以前では、DRBD メタデータに要求されるスペースはデバイスのサイズに関わらず 128MB に固定されていた。 DRBD 8 からは、DRBD メタデータのサイズは以下のテーブルから見積もることができる。</span>
</p>
<table>
<tr>
<td align="center">Block device size</td>
<td align="center">DRBD meta data</td>
</tr>
<tr>
<td align="right">1 GB</td>
<td align="right">2 MB</td>
</tr>
<tr>
<td align="right">100 GB</td>
<td align="right">5 MB</td>
</tr>
<tr>
<td align="right">1 TB</td>
<td align="right">33 MB</td>
</tr>
<tr>
<td align="right">4 TB</td>
<td align="right">128 MB</td>
</tr>
</table>
<p>
Make sure you don&#8217;t direct DRBD to write its meta data to a place where you already have existing data you still need. Also, if you are using internal meta data on an existing block device with a file system on it, make sure you shrink that file system first!<br/><br />
<span class="trans">まだ必要としているデータが存在している場所に対して DRBD がメタデータを書き込まないように注意しよう。また、すでにファイルシステムを持っているブロックデバイスで内部メタデータを使用する場合は、はじめにファイルシステムを圧縮している(縮めている)ことを確認すること。</span>
</p>
<div class="myh">
Bringing up your DRBDs<br/><br />
<span class="trans">DRBD を立ち上げる</span>
</div>
<p>
Now that we have that drbd.conf, copy it to /etc/drbd.conf on both nodes. Then, on both nodes, do a drbdadm up all. It should come up as both nodes Secondary and Inconsistent.<br/><br />
<span class="trans">drbd.conf が出来たら、両方のノードに /etc/drbd.conf としてコピーする。そしたら両方のノードで drbdadm up all を実行する。両方ともセカンダリかつ不整合として起動するはず。</span>
</p>
<p>
The latter is because the underlying storage is not yet synchronized, and DRBD has no way of knowing whether you want the initial sync from left-to-right, or right-to-left. So you have to tell it. If you have no data in the underlying block devices, it does not matter. But if you have an existing filesystem on the lower level device, and now you sync in the wrong direction, you&#8217;d need to get your latest backup ready afterwards&#8230;<br/><br />
<span class="trans">なんでそうなるか。それはストレージがまだ同期されていないからで、その上 DRBD は右から左に同期すべきなのか、それとも左から右なのか、あなたが最初の同期をどちらにしたいのか知る方法がないから。なのでそれを教えてあげなければならない。もしなにもデータを持っていないブロックデバイスで構成しているのであれば、それはどうでもいいことだろう。しかしすでに構成するデバイスがファイルシステムを持っていて、仮に間違った方向に同期してしまったなら、あなたは最新のバックアップデータの準備をしなければならなくなるだろう。</span>
</p>
<div class="myh">
Performing the initial device synchronization<br/><br />
<span class="trans">最初のデバイス同期の実行</span>
</div>
<p>
You choose which node shall become Primary for the first time (the one with the good data, if you have some), then you do drbdadm &#8212; &#8211;overwrite-data-of-peer primary all. The result is a full synchronization of the underlying devices (we call this the initial full sync).<br/><br />
<span class="trans">まず最初にプライマリになってほしいノード(もしデータがある状態なら条件の良いデータを持っている方)を選択する。そして drbdadm &#8212; -overwrite-data-of-peer primary all を実行する。結果としてデバイスの完全な同期がとられる(これを初期フル同期と呼ぶ)。</span>
</p>
<p>
The device is usable right away, so if you have no file system already, you should create one now.<br/><br />
<span class="trans">実行後すぐにデバイスは利用可能になる。もしファイルシステムがない状態なら作ることが出来る。</span>
</p>
<div class="note">
<div class="myh">
Change from versions prior to DRBD 8<br/><br />
<span class="trans">DRBD 8 からの変更されたこと</span>
</div>
<p>
Prior to DRBD 8, what is now the &#8211;overwrite-data-of-peer option used to be &#8211;do-what-I-say. We changed the option because we found out that people mistakenly believed &#8211;do-what-I-say could be used to force any drbdadm command, regardless of its implications.<br/><br />
<span class="trans">DRBD 8 から &#8211;do-what-I-say のために &#8211;overwrite-data-of-peer が利用される。このオプションを変更した理由は、その実装にも関わらず &#8211;do-what-I-say がすべての drbdadm コマンドを強制することに使えると勘違いする人たちがいることに気づいたからだ。</span>
</p>
</div>
<table width="100%">
<tr>
<td align="left"></td>
<td align="right"><a href="http://bougaidenpa.org/masakazu/entry/drbd_migrating_drbd_resources">次: DRBD &#8211; Migrating DRBD resources [対訳]</a></td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://bougaidenpa.org/masakazu/archives/21/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iSCSI Initiator &#8211; Solaris 10</title>
		<link>http://bougaidenpa.org/masakazu/archives/20</link>
		<comments>http://bougaidenpa.org/masakazu/archives/20#comments</comments>
		<pubDate>Thu, 23 Aug 2007 13:56:20 +0000</pubDate>
		<dc:creator>masakazu</dc:creator>
				<category><![CDATA[OS]]></category>

		<guid isPermaLink="false">http://bougaidenpa.org/masakazu/?p=20</guid>
		<description><![CDATA[<p>
Solaris 10 で iSCSI Initiator を設定したときのメモ。
</p>
<p>
Solaris 10 で iSCSI Initiator を利用する場合、 Solaris 10 が 1/06 以降のリリースである必要があります。
</p>
<p>
以下の文書を参考にしています。
</p>

Solaris のシステム管理 (デバイスとファイルシステム) >> 15.  Solaris iSCSI イニシエータの構成 (手順)- http://docs.sun.com/app/docs/doc/819-0386/fmvcd?a=view

<p>
Solaris では iSCSI Initiator を設定するためのコマンドとして iscsiadm というモノが用意されています。
</p>
<p>
iSCSI Initiator が iSCSI Target を利用しようとした場合、 iSCSI Initiator はネットワーク上の iSCSI Target を何らかの方法で認識しなければならないわけですが、 iSCSI Initiator が iSCSI Target を発見するための方法として、以下の 3 つの方法が用意されています。
</p>

静的デバイス発見 &#8211; iSCSI Target を静的に構成する方法
SendTargets による動的デバイス発見 [...]]]></description>
			<content:encoded><![CDATA[<p>
Solaris 10 で iSCSI Initiator を設定したときのメモ。
</p>
<p>
Solaris 10 で iSCSI Initiator を利用する場合、 Solaris 10 が 1/06 以降のリリースである必要があります。
</p>
<p>
以下の文書を参考にしています。
</p>
<ul>
<li><a href="http://docs.sun.com/app/docs/doc/819-0386/fmvcd?a=view">Solaris のシステム管理 (デバイスとファイルシステム) >> 15.  Solaris iSCSI イニシエータの構成 (手順)<br/>- http://docs.sun.com/app/docs/doc/819-0386/fmvcd?a=view</a></li>
</ul>
<p>
Solaris では iSCSI Initiator を設定するためのコマンドとして <span class="command">iscsiadm</span> というモノが用意されています。
</p>
<p>
iSCSI Initiator が iSCSI Target を利用しようとした場合、 iSCSI Initiator はネットワーク上の iSCSI Target を何らかの方法で認識しなければならないわけですが、 iSCSI Initiator が iSCSI Target を発見するための方法として、以下の 3 つの方法が用意されています。
</p>
<ol>
<li>静的デバイス発見 &#8211; iSCSI Target を静的に構成する方法</li>
<li>SendTargets による動的デバイス発見 &#8211; iSCSI Target の IP アドレスとポートの組み合わせから iSCSI Target を発見する方法</li>
<li>iSNS による動的デバイス発見 &#8211; iSNS サーバの IP アドレスとポートの組み合わせから iSCSI Target を発見する方法</li>
</ol>
<p>
ここでは SendTargets による動的デバイス発見で iSCSI Target を認識させます。
</p>
<p>
なお、<a href="http://bougaidenpa.org/masakazu/entry/iscsi_target_solaris_express">前回の例</a>で iSCSI Target として利用した Solaris Express では iSNS は利用できませんが、将来的には iSNS も実装することになっているようです。Solaris Express の iSCSI Target で iSNS が利用できるようになったら評価してみようと思っています。
</p>
<p>
まずは iSCSI Target を SendTargets の発見アドレスとして登録します。以下で 192.168.1.15 は iSCSI Target の IP アドレスで、 3260 はポート番号です。
</p>
<pre class="console">
bash-3.00# iscsiadm add discovery-address 192.168.1.15:3260
</pre>
<p>
そして SendTargets を有効化します。
</p>
<pre class="console">
bash-3.00# iscsiadm modify discovery --sendtargets enable
</pre>
<p>
これで 192.168.1.15 に登録された iSCSI Target が利用できるようになります。
</p>
<p>
<span class="command">iscsiadm</span> コマンドで現在認識している iSCSI Target の一覧を表示することができます。
</p>
<pre class="console">
bash-3.00# iscsiadm list target
Target: iqn.1986-03.com.sun:02:5185308e-59e1-efe5-dcac-b4ce033808ba.target01
Alias: target01
TPGT: 1
ISID: 4000002a0000
Connections: 1
Target: iqn.1986-03.com.sun:02:66dbbe37-13fa-6637-c597-cf1f57b3d85c.target02
Alias: target02
TPGT: 1
ISID: 4000002a0000
Connections: 1
Target: iqn.1986-03.com.sun:02:861c6552-3a19-43b8-ccff-91ef396f98de.target03
Alias: target03
TPGT: 1
ISID: 4000002a0000
Connections: 1
</pre>
<p>
試しに <span class="command">format</span> コマンドを実行してみると、以下のようにデバイスが増えています。
</p>
<pre class="console">
bash-3.00# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t0d0 &lt;DEFAULT cyl 2607 alt 2 hd 255 sec 63>
/pci@0,0/pci1000,30@10/sd@0,0
1. c2t0100000C29AE111100002A0046CD8AAFd0 &lt;DEFAULT cyl 97 alt 2 hd 64 sec 32>
/scsi_vhci/disk@g0100000c29ae111100002a0046cd8aaf
2. c2t0100000C29AE111100002A0046CD8C5Dd0 &lt;DEFAULT cyl 97 alt 2 hd 64 sec 32>
/scsi_vhci/disk@g0100000c29ae111100002a0046cd8c5d
3. c2t0100000C29AE111100002A0046CD8C5Ed0 &lt;DEFAULT cyl 97 alt 2 hd 64 sec 32>
/scsi_vhci/disk@g0100000c29ae111100002a0046cd8c5e
Specify disk (enter its number):
</pre>
<p>
あとは普通の SCSI ディスクと同じように扱えます。
</p>
<p>
例えば上記 3 つで raidz pool を作りたければこんな感じです。
</p>
<pre class="console">
bash-3.00# zpool create tank raidz c2t0100000C29AE111100002A0046CD8AAFd0 \
> c2t0100000C29AE111100002A0046CD8C5Dd0 \
> c2t0100000C29AE111100002A0046CD8C5Ed0
bash-3.00# zpool status
pool: tank
state: ONLINE
scrub: none requested
config:
NAME                                       STATE     READ WRITE CKSUM
tank                                       ONLINE       0     0     0
raidz1                                   ONLINE       0     0     0
c2t0100000C29AE111100002A0046CD8AAFd0  ONLINE       0     0     0
c2t0100000C29AE111100002A0046CD8C5Dd0  ONLINE       0     0     0
c2t0100000C29AE111100002A0046CD8C5Ed0  ONLINE       0     0     0
errors: No known data errors
bash-3.00# df -k
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c1t0d0s0    20093023 3593070 16299023    19%    /
/devices                   0       0       0     0%    /devices
ctfs                       0       0       0     0%    /system/contract
proc                       0       0       0     0%    /proc
mnttab                     0       0       0     0%    /etc/mnttab
swap                  684520     724  683796     1%    /etc/svc/volatile
objfs                      0       0       0     0%    /system/object
/usr/lib/libc/libc_hwcap1.so.1
20093023 3593070 16299023    19%    /lib/libc.so.1
fd                         0       0       0     0%    /dev/fd
swap                  683832      36  683796     1%    /tmp
swap                  683824      28  683796     1%    /var/run
tank                  144552      32  144462     1%    /tank
</pre>
]]></content:encoded>
			<wfw:commentRss>http://bougaidenpa.org/masakazu/archives/20/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iSCSI Target &#8211; Solaris Express</title>
		<link>http://bougaidenpa.org/masakazu/archives/19</link>
		<comments>http://bougaidenpa.org/masakazu/archives/19#comments</comments>
		<pubDate>Mon, 20 Aug 2007 11:39:02 +0000</pubDate>
		<dc:creator>masakazu</dc:creator>
				<category><![CDATA[OS]]></category>

		<guid isPermaLink="false">http://bougaidenpa.org/masakazu/?p=19</guid>
		<description><![CDATA[<p>
Solaris Express で iSCSI Target を設定したときのメモ。
</p>
<p>
将来的には Solaris 10 でも iSCSI Target の設定が出来るようになるようですが、現時点では Solaris Express でないと iSCSI Target は設定できません。
</p>
<p>
ちなみに iSCSI Initiator は Solaris 10 でも利用可能です。この Entry に続いて Solaris 10 で iSCSI Initiator を設定するためのメモを書く予定でいます。
</p>
<p>
以下の文書を参考にしています。
</p>

OpenSolaris Project: Solaris iSCSI Target- http://www.opensolaris.org/os/project/iscsitgt/
Creating your first target- http://www.opensolaris.org/os/project/iscsitgt/getstarted/

<p>
Solaris Express では iSCSI Target を設定するためのコマンドとして iscsitadm というモノが用意されています。
</p>
<p>
iSCSI Target Daemon を起動するために、まずは base directory を設定します。 base directory [...]]]></description>
			<content:encoded><![CDATA[<p>
Solaris Express で iSCSI Target を設定したときのメモ。
</p>
<p>
将来的には Solaris 10 でも iSCSI Target の設定が出来るようになるようですが、現時点では Solaris Express でないと iSCSI Target は設定できません。
</p>
<p>
ちなみに iSCSI Initiator は Solaris 10 でも利用可能です。この Entry に続いて Solaris 10 で iSCSI Initiator を設定するためのメモを書く予定でいます。
</p>
<p>
以下の文書を参考にしています。
</p>
<ul>
<li><a href="http://www.opensolaris.org/os/project/iscsitgt/">OpenSolaris Project: Solaris iSCSI Target<br />- http://www.opensolaris.org/os/project/iscsitgt/</a></li>
<li><a href="http://www.opensolaris.org/os/project/iscsitgt/getstarted/">Creating your first target<br />- http://www.opensolaris.org/os/project/iscsitgt/getstarted/</a></li>
</ul>
<p>
Solaris Express では iSCSI Target を設定するためのコマンドとして <span class="command">iscsitadm</span> というモノが用意されています。
</p>
<p>
iSCSI Target Daemon を起動するために、まずは base directory を設定します。 base directory には Target と LU を構成するためのデータが格納されます。もし利用可能な ZFS pool があるようであればそこに格納した方が望ましい、と上記 <a href="http://www.opensolaris.org/os/project/iscsitgt/getstarted/">“Creating your first target”</a> には書かれていますが、ここではめんどくさいので普通に UFS 上の directory を指定します。
</p>
<p>
以下の例では <span class="command">/export/iscsi</span> という directory を作成し base directory として設定しています。
</p>
<pre class="console">
bash-3.00# mkdir /export/iscsi
bash-3.00# iscsitadm modify admin -d /export/iscsi
</pre>
<p>
base directory の設定が終われば Target を作成できます。
</p>
<p>
以下の例では 1GB の Target を disk01, disk02, &#8230; という名前で 5 個作成しています。
</p>
<pre class="console">
bash-3.00# iscsitadm create target --size 1g disk01
bash-3.00# iscsitadm create target --size 1g disk02
bash-3.00# iscsitadm create target --size 1g disk03
bash-3.00# iscsitadm create target --size 1g disk04
bash-3.00# iscsitadm create target --size 1g disk05
</pre>
<p>
<span class="command">ps</span> コマンドで確認してみると <span class="command">iscsitgtd</span> という Daemon が起動していることがわかります。
</p>
<pre class="console">
bash-3.00# ps -ef | grep scsi
root   644   566   0 19:46:49 pts/1       0:00 grep scsi
root   627     1   0 19:15:12 ?           1:28 /usr/sbin/iscsitgtd
</pre>
<p>
また base directory には以下のような file と directory が作成されています。
</p>
<pre class="console">
bash-3.00# ls -l /export/iscsi
total 24
-rw-------   1 root     sys         1183 Aug 20 19:15 config.xml
lrwxrwxrwx   1 root     sys           80 Aug 20 19:15 disk01 -> /export/iscsi/iqn.1986-03.com.sun:02:ed52dc45-b3f1-e1be-cec0-9572450a2fff.disk01
lrwxrwxrwx   1 root     sys           80 Aug 20 19:15 disk02 -> /export/iscsi/iqn.1986-03.com.sun:02:66528f32-b1b9-6b0a-cfe9-c8c98f8578dc.disk02
lrwxrwxrwx   1 root     sys           80 Aug 20 19:15 disk03 -> /export/iscsi/iqn.1986-03.com.sun:02:fd06731d-42b9-c1c9-bf0e-e4b41ccd8d17.disk03
lrwxrwxrwx   1 root     sys           80 Aug 20 19:15 disk04 -> /export/iscsi/iqn.1986-03.com.sun:02:6a93da14-9ddb-4913-e502-fd4f846be66a.disk04
lrwxrwxrwx   1 root     sys           80 Aug 20 19:15 disk05 -> /export/iscsi/iqn.1986-03.com.sun:02:32e0173b-5155-6722-e3d1-ae1cf42a71d6.disk05
drwxr-xr-x   2 root     sys          512 Aug 20 19:15 iqn.1986-03.com.sun:02:32e0173b-5155-6722-e3d1-ae1cf42a71d6.disk05
drwxr-xr-x   2 root     sys          512 Aug 20 19:15 iqn.1986-03.com.sun:02:66528f32-b1b9-6b0a-cfe9-c8c98f8578dc.disk02
drwxr-xr-x   2 root     sys          512 Aug 20 19:15 iqn.1986-03.com.sun:02:6a93da14-9ddb-4913-e502-fd4f846be66a.disk04
drwxr-xr-x   2 root     sys          512 Aug 20 19:15 iqn.1986-03.com.sun:02:ed52dc45-b3f1-e1be-cec0-9572450a2fff.disk01
drwxr-xr-x   2 root     sys          512 Aug 20 19:15 iqn.1986-03.com.sun:02:fd06731d-42b9-c1c9-bf0e-e4b41ccd8d17.disk03
</pre>
<p>
<span class="command">config.xml</span> の中身は次のようになっています。
</p>
<pre class="sourcecode">
&lt;config version='1.0'&gt;
&lt;target&gt;
disk01
&lt;lun-list&gt;
&lt;lun&gt;0x0&lt;/lun&gt;
&lt;/lun-list&gt;
&lt;iscsi-name&gt;
iqn.1986-03.com.sun:02:ed52dc45-b3f1-e1be-cec0-9572450a2fff.disk01
&lt;/iscsi-name&gt;
&lt;/target&gt;
... 以下 &lt;target&gt;&lt;/target&gt; が disk02, disk02 ... の分記述されている ...
&lt;/config&gt;
</pre>
<p>
<span class="command">disk01</span>(実態は <span class="command">iqn.1986-03.com.sun&#8230;</span> という長ったらしい名前の directory) の中身はこんな感じです。
</p>
<pre class="console">
bash-3.00# ls -l /export/iscsi/disk01/
total 2098194
-rw-------   1 root     sys      1073741824 Aug 20 19:20 lun.0
-rw-------   1 root     sys          345 Aug 20 19:20 params.0
</pre>
<p>
恐らく file size から <span class="command">lun.0</span> は scsi device image だと思われます。
</p>
<p>
<span class="command">params.0</span> の中身はこんな感じで、こちらは LU の設定情報でしょう。
</p>
<pre class="sourcecode">
&lt;params version='1.0'&gt;
&lt;size&gt;0x200000&lt;/size&gt;
&lt;status&gt;online&lt;/status&gt;
&lt;interleave&gt;1&lt;/interleave&gt;
&lt;bps&gt;512&lt;/bps&gt;
&lt;spt&gt;16&lt;/spt&gt;
&lt;cylinders&gt;32768&lt;/cylinders&gt;
&lt;heads&gt;4&lt;/heads&gt;
&lt;rpm&gt;7200&lt;/rpm&gt;
&lt;dtype&gt;disk&lt;/dtype&gt;
&lt;vid&gt;SUN&lt;/vid&gt;
&lt;pid&gt;SOLARIS&lt;/pid&gt;
&lt;guid&gt;0100000c29ae111100002a0046c969cc&lt;/guid&gt;
&lt;/params&gt;
</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://bougaidenpa.org/masakazu/archives/19/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The new Mac mini &#8211; Enabling VT-x</title>
		<link>http://bougaidenpa.org/masakazu/archives/17</link>
		<comments>http://bougaidenpa.org/masakazu/archives/17#comments</comments>
		<pubDate>Sun, 19 Aug 2007 09:26:56 +0000</pubDate>
		<dc:creator>masakazu</dc:creator>
				<category><![CDATA[OS]]></category>

		<guid isPermaLink="false">http://bougaidenpa.org/masakazu/?p=17</guid>
		<description><![CDATA[<p>
disable 化されてた新しい Mac mini の VT-x オプションだけど、 Parallels の Support Forum にあった以下の方法で enable 化できました。
</p>

How To Enable VT (aka VTX or VT-x) with rEFIt and vmx-var-set.efi- http://forum.parallels.com/showthread.php?t=3273

<p>
rEFIt のバージョンが違ったからか “14. In rEFIt menu, select Console.” の部分が微妙に違ってたけど、それ以外は書いてある通りに進んでいけば OK でした。
</p>
<p>CentOS 4 と CentOS 5 の [...]]]></description>
			<content:encoded><![CDATA[<p>
disable 化されてた新しい Mac mini の VT-x オプションだけど、 Parallels の Support Forum にあった以下の方法で enable 化できました。
</p>
<ul>
<li><a href="http://forum.parallels.com/showthread.php?t=3273">How To Enable VT (aka VTX or VT-x) with rEFIt and vmx-var-set.efi<br/>- http://forum.parallels.com/showthread.php?t=3273</a></li>
</ul>
<p>
rEFIt のバージョンが違ったからか “14. In rEFIt menu, select Console.” の部分が微妙に違ってたけど、それ以外は書いてある通りに進んでいけば OK でした。
</p>
<p>CentOS 4 と CentOS 5 の x86_64 版インストールしてみたけど、問題なく動作してるみたいです。</p>
]]></content:encoded>
			<wfw:commentRss>http://bougaidenpa.org/masakazu/archives/17/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The new Mac mini</title>
		<link>http://bougaidenpa.org/masakazu/archives/16</link>
		<comments>http://bougaidenpa.org/masakazu/archives/16#comments</comments>
		<pubDate>Tue, 14 Aug 2007 14:49:57 +0000</pubDate>
		<dc:creator>masakazu</dc:creator>
				<category><![CDATA[OS]]></category>

		<guid isPermaLink="false">http://bougaidenpa.org/masakazu/?p=16</guid>
		<description><![CDATA[<p></p>
<p>
かなりまえから Mac mini が Core 2 Duo になったら買おう、って思ってたんだけど、ようやく Core 2 Duo になって新登場、ということで買いました。同じタイミングでリニューアルの iMac の方が大々的に広告されているので Mac mini の方はひっそりとしてますけど。
</p>
<p>
VMware Fusion も買ったので、これで LVS やら MySQL やら Asterisk やら Ruby on Rails の deploy やらの評価環境を手軽に準備できるようになったわけです。恐ろしい。
</p>
<p>
てか Core 2 Duo になるの待ってたのは VMware で 64bit Guest OS 動かしたいからだったんだけど(Core Duo は EM64T 非サポート)、どうも Firmware で VT-x 殺しているらしく 64bit Guest OS はそのままでは動作しない。 Parallels のサポートには rEFI [...]]]></description>
			<content:encoded><![CDATA[<p><iframe src="http://rcm-jp.amazon.co.jp/e/cm?t=ae937b48baa89-22&#038;o=9&#038;p=8&#038;l=as1&#038;asins=B000UWRC4U&#038;fc1=000000&#038;IS2=1&#038;lt1=_top&#038;lc1=0000FF&#038;bc1=FFFFFF&#038;bg1=FFFFFF&#038;f=ifr" class="amazonbox" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe></p>
<p>
かなりまえから Mac mini が Core 2 Duo になったら買おう、って思ってたんだけど、ようやく Core 2 Duo になって新登場、ということで買いました。同じタイミングでリニューアルの iMac の方が大々的に広告されているので Mac mini の方はひっそりとしてますけど。
</p>
<p>
VMware Fusion も買ったので、これで LVS やら MySQL やら Asterisk やら Ruby on Rails の deploy やらの評価環境を手軽に準備できるようになったわけです。恐ろしい。
</p>
<p>
てか Core 2 Duo になるの待ってたのは VMware で 64bit Guest OS 動かしたいからだったんだけど(Core Duo は EM64T 非サポート)、どうも Firmware で VT-x 殺しているらしく 64bit Guest OS はそのままでは動作しない。 Parallels のサポートには rEFI を使って VT-x を enable 化する方法が載ってるんだけど&#8230; Core 2 Duo 版の Mac mini でもそのまま使えるのか不安なのでとりあえず様子見(32bit Guest OS で我慢)とします。
</p>
<p>
でも Mac mini で VT-x が disable 化されてたのは Bug だったらしく、後から出たやつはちゃんと enable 化されてるらしいんだけどなぁ&#8230; 戻っちゃったのかな？
</p>
<div style="clear:both;margin:0px;padding:0px;width:0px;height:0px;">&nbsp;</div>
]]></content:encoded>
			<wfw:commentRss>http://bougaidenpa.org/masakazu/archives/16/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
