Home > Archives > August 2008 Archive

August 2008 Archive

binlog-formatの変更

  • August 27, 2008 11:25 AM

MySQL :: MySQL 5.1 Reference Manual :: 5.1.3 System Variables

There are exceptions when you cannot switch the replication format at runtime:

*

From within a stored function or a trigger.
*

If NDB is enabled.
*

If the session is currently in row-based replication mode and has open temporary tables.

Trying to switch the format in those cases results in an error.

binlog-formatは、通常はdynamicだけど、NDBオンにしている場合は、例外(dynamicにはならない。)で、変更しようとすると、エラーが返る。

NDBオンっていうのが、「show engines;でNDBが使える状態」のことなのか、これに加えて「ndbclusterオプションを追加して起動した場合」なのかは、不明。

  • Comments (Close): 0
  • TrackBack (Close): 0

binlog-format=mixed

  • August 18, 2008 3:41 PM

MySQL :: MySQL 5.1 リファレンスマニュアル :: 5.1.2.2 ミックス レプリケーション フォーマット


MIXED モードで実行している場合、次の条件下にあるレプリケーションはステートメント ベースから行ベースに自動的に切り替わります。

DML ステートメントが NDB テーブルを更新するとき

  • Comments (Close): 0
  • TrackBack (Close): 0

Zone構成へのMySQL Serverインストール・メモ

  • August 4, 2008 6:39 PM

バイナリの配置(Global Zone)

データ格納用のディレクトリ作成(各Zone)
/export/home/mysql/
/export/home/mysql-cluster/

設定ファイルの確認(各Zone)
/export/home/mysql-cluster/config.ini
/etc/my.cnf

  • Comments (Close): 0
  • TrackBack (Close): 0

Oracle無料版のインストール

  • August 4, 2008 6:36 PM

無料で使える「Oracle Database XE」をインストール - builder by ZDNet Japan

を参考にして、Oracle Database Expressをoracle.comからダウンロードしてインストール

日本オラクルのページではユーザ登録した記憶があったのだけど、アカウントは統一されていないのかな?
oracle.comで再度アカウントを作成した。

インストール後、ポート番号8080はPOPFileの管理画面で利用しているので、「Oracle Databaseは難しいなぁ」と思うあなたに:Application Express - builder by ZDNet Japanを参考にして、8081へ変更した。

あとは、Oracle® Database Express Edition Getting Started Guideを参考にして、一通りみてみる。


  • Comments (Close): 0
  • TrackBack (Close): 0

DRBDとHeartbeat2でMySQLをHA対応にしてみる: 4/4 - Heartbeat2のインストールと設定 -

  • August 4, 2008 2:40 PM

Heartbeat2のインストール(両方のノードで)

http://www.linux-ha.org/ja/DownloadSoftware_ja
からRedHat Enterprise 4用のRPMを利用する。

[root@h1 heartbeat-2.1.2-2.rhel4.x86_64.RPMS]# rpm -ivh heartbeat-pils-2.1.2-2.x86_64.rpm
Preparing...                ########################################### [100%]
   1:heartbeat-pils         ########################################### [100%]
[root@h1 heartbeat-2.1.2-2.rhel4.x86_64.RPMS]# rpm -ivh heartbeat-stonith-2.1.2-2.x86_64.rpm
Preparing...                ########################################### [100%]
   1:heartbeat-stonith      ########################################### [100%]
[root@h1 heartbeat-2.1.2-2.rhel4.x86_64.RPMS]# rpm -ivh heartbeat-2.1.2-2.x86_64.rpm
Preparing...                ########################################### [100%]
   1:heartbeat              ########################################### [100%]
[root@h1 heartbeat-2.1.2-2.rhel4.x86_64.RPMS]# rpm -ivh heartbeat-gui-2.1.2-2.x86_64.rpm
Preparing...                ########################################### [100%]
   1:heartbeat-gui          ########################################### [100%]


インストールする順番は、

1. pils
2. stonith
3. heartbeat

Heartbeat2の設定ファイル:ha.cf
/etc/ha.d/ha.cf

debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility syslog
#use_logd yes
keepalive 2
deadtime 30
warntime 10
initdead 120
udpport 694
bcast   eth1			# dedicated interconnect
mcast eth0 224.1.1.1 694 1 0
auto_failback off
node h1
node h2
crm yes

cib.xml
/var/lib/heartbeat/crm/cib.xml

haresourcesから生成する場合は、drbddiskの後にリソース名を指定すること。
h1 172.20.95.50 drbddisk::d0 Filesystem::/dev/drbd0::/mnt/drbd/mysql::ext3 mysql

sticknessはINFINITYに変更すること。(変更しないと自動フェールバックしてしまう。)

またmysqlスクリプトのファイル権限にも注意すること。

<?xml version="1.0" ?>
<cib admin_epoch="0" epoch="0" num_updates="0">
	<configuration>
		<crm_config>
			<cluster_property_set id="cib-bootstrap-options">
				<attributes>
					<nvpair id="cib-bootstrap-options-symmetric-cluster" name="symmetric-cluster" value="true"/>
					<nvpair id="cib-bootstrap-options-no-quorum-policy" name="no-quorum-policy" value="stop"/>
					<nvpair id="cib-bootstrap-options-default-resource-stickiness" name="default-resource-stickiness" value="INFINITY"/>
					<nvpair id="cib-bootstrap-options-default-resource-failure-stickiness" name="default-resource-failure-stickiness" value="0"/>
					<nvpair id="cib-bootstrap-options-stonith-enabled" name="stonith-enabled" value="false"/>
					<nvpair id="cib-bootstrap-options-stonith-action" name="stonith-action" value="reboot"/>
					<nvpair id="cib-bootstrap-options-stop-orphan-resources" name="stop-orphan-resources" value="true"/>
					<nvpair id="cib-bootstrap-options-stop-orphan-actions" name="stop-orphan-actions" value="true"/>
					<nvpair id="cib-bootstrap-options-remove-after-stop" name="remove-after-stop" value="false"/>
					<nvpair id="cib-bootstrap-options-short-resource-names" name="short-resource-names" value="true"/>
					<nvpair id="cib-bootstrap-options-transition-idle-timeout" name="transition-idle-timeout" value="5min"/>
					<nvpair id="cib-bootstrap-options-default-action-timeout" name="default-action-timeout" value="15s"/>
					<nvpair id="cib-bootstrap-options-is-managed-default" name="is-managed-default" value="true"/>
				</attributes>
			</cluster_property_set>
		</crm_config>
		<nodes/>
		<resources>
			<group id="group_1">
				<primitive class="ocf" id="IPaddr_172_20_95_50" provider="heartbeat" type="IPaddr">
					<operations>
						<op id="IPaddr_172_20_95_50_mon" interval="5s" name="monitor" timeout="5s"/>
					</operations>
					<instance_attributes id="IPaddr_172_20_95_50_inst_attr">
						<attributes>
							<nvpair id="IPaddr_172_20_95_50_attr_0" name="ip" value="172.20.95.50"/>
						</attributes>
					</instance_attributes>
				</primitive>
				<primitive class="heartbeat" id="drbddisk_2" provider="heartbeat" type="drbddisk">
					<operations>
						<op id="drbddisk_2_mon" interval="120s" name="monitor" timeout="60s"/>
					</operations>
					<instance_attributes id="drbddisk_2_inst_attr">
						<attributes>
							<nvpair id="drbddisk_2_attr_1" name="1" value="d0"/>
						</attributes>
					</instance_attributes>
				</primitive>
				<primitive class="ocf" id="Filesystem_3" provider="heartbeat" type="Filesystem">
					<operations>
						<op id="Filesystem_3_mon" interval="120s" name="monitor" timeout="60s"/>
					</operations>
					<instance_attributes id="Filesystem_3_inst_attr">
						<attributes>
							<nvpair id="Filesystem_3_attr_0" name="device" value="/dev/drbd0"/>
							<nvpair id="Filesystem_3_attr_1" name="directory" value="/mnt/drbd"/>
							<nvpair id="Filesystem_3_attr_2" name="fstype" value="ext3"/>
						</attributes>
					</instance_attributes>
				</primitive>
				<primitive class="heartbeat" id="mysql_4" provider="heartbeat" type="mysql">
					<operations>
						<op id="mysql_4_mon" interval="60s" name="monitor" timeout="30s"/>
					</operations>
				</primitive>
			</group>
		</resources>
		<constraints>
			<rsc_location id="rsc_location_group_1" rsc="group_1">
				<rule id="prefered_location_group_1" score="100">
					<expression attribute="#uname" id="prefered_location_group_1_expr" operation="eq" value="h1"/>
				</rule>
			</rsc_location>
		</constraints>
	</configuration>
	<status/>
</cib>

authkeys
/etc/ha.d/authkeys

auth 1
1 crc

Heartbeat2の設定

mysqlスタートアップスクリプトのコピー

[root@h1 resource.d]# cp /etc/rc.d/init.d/mysql /etc/ha.d/resource.d/
[root@h2 resource.d]# cp /etc/rc.d/init.d/mysql /etc/ha.d/resource.d/

このスクリプトは、本来はMySQLバイナリに入っているものだが、バグが(MySQL Bugs: #31785: mysql.server stop does not spot server gone away)あるので、修正版を利用する。

各サービスの停止

必要に応じてサービスを停止する。

[root@h1 resource.d]# service drbd stop
Stopping all DRBD resources.
[root@h1 resource.d]# service mysql stop
MySQL manager or server PID file could not be found!       [失敗]
[root@h1 resource.d]# service heartbeat stop
Stopping High-Availability services: 
                                                           [  OK  ]
logd is already stopped

h2でも同様の処理を行う。

スタートアップスクリプトに登録(両方のノードで)

[root@h1 resource.d]# chkconfig drbd on
[root@h1 resource.d]# chkconfig mysql off
[root@h1 resource.d]# chkconfig heartbeat on

h2でも同様の処理を行う。

drbdの起動 (両方のノードで)

[root@h1 resource.d]# service drbd start
Starting DRBD resources:    [ d0 s0 n0 ].

h2でも同様の処理を行う。

heartbeatの起動(両方のノードで)

[root@h1 resource.d]# service heartbeat start

h2でも同様の処理を行う。

Heartbeat2の稼働確認

[root@h1 ha.d]# crm_mon -i 3
Refresh in 1s...

============
Last updated: Thu Nov 8 18:16:25 2007
Current DC: h2 (73553d5d-1a50-4f55-99de-8ba7aec48426)
2 Nodes configured.
1 Resources configured.
============

Node: h2 (73553d5d-1a50-4f55-99de-8ba7aec48426): online
Node: h1 (ce2c28c3-585e-494b-baa8-d38b7e7ebd9e): online

Resource Group: group_1
IPaddr_172_20_95_50 (heartbeat::ocf:IPaddr): Started h1
drbddisk_2 (heartbeat:drbddisk): Started h1
Filesystem_3 (heartbeat::ocf:Filesystem): Started h1
mysql_4 (heartbeat:mysql): Started h1

  • Comments (Close): 0
  • TrackBack (Close): 0

DRBDとHeartbeat2でMySQLをHA対応にしてみる: 3/4 - MySQLのインストール -

  • August 4, 2008 2:36 PM

MySQL Enterprise BinaryのRedHat 4.4向けEM64T対応のサーバとクライアントを RPMからインストール
データディレクトリをDRBD管理配下へ

basedir=/mnt/drbd/mysql

DRBD構成用my.cnf

#BEGIN CONFIG INFO
#DESCR: h1 for DRBD Eval. by hirohama
#END CONFIG INFO

###########################################
# GENERIC configuration options
###########################################

[client]
# Connection
port = 3306

[mysqld]
server-id=11
datadir=/mnt/drbd/mysql
skip-name-resolve

# Character Set

# Connection
port = 3306
user=mysql
max_connections = 100

# File Open

# Thread
thread_cache_size = 100

# Query Cache
query_cache_size = 64M
query_cache_type = 1

default_table_type = INNODB

###########################################
# Log Specific options
###########################################

log-bin=h-bin

log=h.log

log-error=h.err

binlog_cache_size = 1M
log-warnings = 2
log_slow_queries
long_query_time = 10
sync_binlog = 1

###########################################
# BDB Specific options
###########################################

skip-bdb

###########################################
# MyISAM Specific options
###########################################

key_buffer_size = 8M

###########################################
# INNODB Specific options
###########################################

innodb_additional_mem_pool_size = 16M
innodb_buffer_pool_size = 1G
innodb_log_buffer_size = 8M
innodb_log_file_size = 200M
innodb_log_files_in_group = 3
innodb_lock_wait_timeout = 50

DRBDを使わない場合のmy.cnf

datadirをコメントアウトして、デフォルトの/var/lib/mysql以下にデータディレクトリを設定する。

スタートアップスクリプトを差し替える

既存のmysql.serverはバグがあるので、手動で差し替えること。

/etc/init.d/mysql
/etc/ha.d/resource.d/mysql (後ほど/etc/init.d/mysqlをコピーする)

  • Comments (Close): 0
  • TrackBack (Close): 0

DRBDとHeartbeat2でMySQLをHA対応にしてみる: 2/4 - DRBDの稼働テスト -

  • August 4, 2008 2:33 PM

同期が完了したらファイルシステムを作成して、マウントする。(プライマリノード)

mke2fs -jまたはmkfs.ext3を利用する。

[root@h1 ~]# mke2fs -j /dev/drbd0
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
8896512 inodes, 17789979 blocks
889498 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
543 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information:

done

This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

[root@h1 ~]# mkdir /mnt/drbd
[root@h1 ~]# mount /dev/drbd0 /mnt/drbd/

手動でフェールオーバ(プライマリノード)

[root@h1 ~]# umount /mnt/drbd/
[root@h1 ~]# cat /proc/drbd
version: 8.0.7 (api:86/proto:86)
GIT-hash: cf14288833afe95db396075f8530a5960d29e498 build by buildsystem@linbit, 2007-11-02 15:08:55
 0: cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate C r---
    ns:72313830 nr:0 dw:1153913 dr:71160107 al:568 bm:4344 lo:0 pe:0 ua:0 ap:0
        resync: used:0/31 hits:4443152 misses:4344 starving:0 dirty:0 changed:4344
        act_log: used:0/257 hits:2306894 misses:795 starving:0 dirty:227 changed:568
[root@h1 ~]# drbdsetup /dev/drbd0 secondary
[root@h1 ~]# cat /proc/drbd
version: 8.0.7 (api:86/proto:86)
GIT-hash: cf14288833afe95db396075f8530a5960d29e498 build by buildsystem@linbit, 2007-11-02 15:08:55
 0: cs:Connected st:Secondary/Secondary ds:UpToDate/UpToDate C r---
    ns:72313830 nr:0 dw:1153913 dr:71160107 al:568 bm:4599 lo:0 pe:0 ua:0 ap:0
        resync: used:0/31 hits:4443152 misses:4344 starving:0 dirty:0 changed:4344
        act_log: used:0/257 hits:2306894 misses:795 starving:0 dirty:227 changed:568

手動でフェールオーバ(セカンダリノード)

[root@h2 ~]# drbdsetup /dev/drbd0 primary
[root@h2 ~]# cat /proc/drbd
version: 8.0.7 (api:86/proto:86)
GIT-hash: cf14288833afe95db396075f8530a5960d29e498 build by buildsystem@linbit, 2007-11-02 15:08:55
 0: cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate C r---
    ns:0 nr:72313830 dw:72313830 dr:0 al:0 bm:4344 lo:0 pe:0 ua:0 ap:0
        resync: used:0/31 hits:4443152 misses:4344 starving:0 dirty:0 changed:4344
        act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0
[root@h2 ~]# mount /dev/drbd0 /mnt/drbd/
[root@h2 ~]# ls /mnt/drbd/
lost+found/ test.txt

でprimary側で作成したファイルを確認できる。
  • Comments (Close): 0
  • TrackBack (Close): 0

DRBDとHeartbeat2でMySQLをHA対応にしてみる: 1/4 - DRBDのインストールと設定 -

  • August 4, 2008 2:18 PM

2007/12に書いたものが埋もれていたので整理。


DRBDのインストール方法は、いくつかある。
1. drbd.orgからソースをダウンロードしてビルド、インストール
2. LINBIT社提供のRPMを利用する(有償)
3. MySQL Enterpriseのオプションを購入して、LINBIT社提供のRPMを利用する(有料)
4. CentOSのyumを利用する。(CentOS4.5ではVer.0.7.23のみdrbd本体とkernel module共に用意されているが、CentOS5ではVer.8.0.3のdrbd本体のみでkernel moduleは提供されていない。 )
5. SUSE Linux(SUSE Linux Professional 9.3以降、SUSE Linux Enterprise Server 9以降)では標準パッケージとして提供されている(らしい)

今回は「LINBIT社提供のRPMを使ってDRBD 8.0.7をインストール」した。 RPMを使ったインストールにあたっては、「kernelのバージョンを(uname -aなどで)ちゃんと確認すること」、くらい。

DRBDのインストール

[root@h1 ~]# rpm -ivh drbd-8.0.7-3.x86_64.rpm
Preparing...                ########################################### [100%]
   1:drbd                   ########################################### [100%]
[root@h1 ~]# rpm -ivh drbd-km-2.6.9_42.ELsmp-8.0.7-3.x86_64.rpm
Preparing...                ########################################### [100%]
   1:drbd-km-2.6.9_42.ELsmp ########################################### [100%]
[root@h2 ~]# rpm -ivh drbd-8.0.7-3.x86_64.rpm
Preparing...                ########################################### [100%]
   1:drbd                   ########################################### [100%]
[root@h2 ~]# rpm -ivh drbd-km-2.6.9_42.ELsmp-8.0.7-3.x86_64.rpm
Preparing...                ########################################### [100%]
   1:drbd-km-2.6.9_42.ELsmp ########################################### [100%]

DRBD用パーティションの準備

fdisk /dev/sdbなどでパーティションを作成。(h1/h2)

コマンド (m でヘルプ): p

Disk /dev/sdb: 73.4 GB, 73407820800 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = シリンダ数 of 16065 * 512 = 8225280 bytes

デバイス Boot Start End Blocks Id System
/dev/sdb1 1 65 522081 83 Linux
/dev/sdb2 66 8924 71159917+ 83 Linux

設定

/usr/share/doc/drbd/drbd.confを参考にして/etc/drbd.conf設定ファイルを作成する。

resource d0 {
  protocol C;
  startup {
    degr-wfc-timeout 120;    # 2 minutes.
  }
  disk {
    on-io-error   detach;
  }
  net {
  }
  syncer {
    rate 500M;
    al-extents 257;
  }
  on h1 {
    device     /dev/drbd0;
    disk       /dev/sdb2;
    address    10.0.0.11:7788;
    meta-disk  /dev/sdb1[0];
  }

on h2 {
device /dev/drbd0;
disk /dev/sdb2;
address 10.0.0.12:7788;
meta-disk /dev/sdb1[0];
}
}


resource
ここでは、d0という名前のresourceを設定している。

protocol
DRBDを使う以上、Cでリモートのディスクへの書き込みまで確認するべき。ただし、Write Cacheアリのストレージを使う場合も、Bはありえない。理由は、"remote buffer cache"はLinux buffer cache(VFSの一部)で、File SystemとDRBDの中間に位置する。一方、"disk write cache"はDiskとDRBDの中間に位置するので。

# transfer protocol to use.
 # C: write IO is reported as completed, if we know it has
 #    reached _both_ local and remote DISK.
 #    * for critical transactional data.
 # B: write IO is reported as completed, if it has reached
 #    local DISK and remote buffer cache.
 #    * for most cases.
 # A: write IO is reported as completed, if it has reached
 #    local DISK and local tcp send buffer. (see also sndbuf-size)
 #    * for high latency networks
 #**********
 # uhm, benchmarks have shown that C is actually better than B.
 # this note shall disappear, when we are convinced that B is
 # the right choice "for most cases".
 # Until then, always use C unless you have a reason not to.
 #     --lge
 #**********

このコメントによると、ベンチマークするとCの方がBよりもいいとのこと。

C
クリティカルなトランザクションデータ向け。ローカルディスクへの書き込みと、リモートのディスクへの書き込みが完了したことを確認して「書き込み完了」(write IO is completed)とする。

B
多くの場合に使えるでしょう。ローカルディスクへの書き込みと、リモートのバッファキャッシュへの書き込みが完了したことを確認して「書き込み完了」(write IO is completed)とする。

A
高いレイテンシのネットワークで有効。ローカルディスクへの書き込みと、書き込みの要求をリモートのサーバへ送信したことを確認して「書き込み完了」(write IO is completed)とする。

on-io-error
on-io-errorでは、低レベルデバイスでIOエラーが発生した場合の挙動を設定する。

Ver. 0.8系ではpanic(カーネルパニックを引き起こす)が無くなってcall-local-io-errorが新しく追加されている。
可用性を考慮するのであれば、ディスクレスモードで動作するdetachを選択する。


   # if the lower level device reports io-error you have the choice of
# "pass_on" -> Report the io-error to the upper layers.
# Primary -> report it to the mounted file system.
# Secondary -> ignore it.
# "call-local-io-error"
# -> Call the script configured by the name "local-io-error".
# "detach" -> The node drops its backing storage device, and
# continues in disk less mode.

pass_on

 上位層にI/Oエラーを返す。プライマリの場合はマウントしたファイルシステムへ、セカンダリでは無視される。実際の挙動は稼働中にディスクを抜いくことで確認できる。

call-local-io-error

 local-io-errorという名前のスクリプトを実行する。

detach

 該当のストレージデバイスを切り離し、ディスクレスモードで継続して動作する。 挙動は、その名のとおり、ローカルディスクへのアクセス無しで動作する。

device fileの作成

for i in `seq 0 15` ; do mknod /dev/drbd$i b 147 $i; done

DRBDモジュールのロードと確認(両方のノードで実施)

minor_countで管理する最大の共有ディスクの数を指定する。

[root@h1 ~]# lsmod |grep drbd
[root@h1 ~]# modprobe drbd minor_count=1
[root@h1 ~]# lsmod |grep drbd
drbd                  225832  0
[root@h1 ~]# cat /proc/drbd
version: 8.0.7 (api:86/proto:86)
GIT-hash: cf14288833afe95db396075f8530a5960d29e498 build by buildsystem@linbit, 2007-11-02 15:08:55

参考:


[root@h2 ha]# modinfo drbd
filename: /lib/modules/2.6.9-42.ELsmp/kernel/drivers/block/drbd.ko
author: Philipp Reisner , Lars Ellenberg
description: drbd - Distributed Replicated Block Device v8.0.7
license: GPL
parm: minor_count:Maximum number of drbd devices (1-255)
alias: block-major-147-*
parm: allow_oos:DONT USE!
license: GPL
author: Evgeniy Polyakov
description: Generic userspace <-> kernelspace connector.
parm: cn_idx:Connector's main device idx.
parm: cn_val:Connector's main device val.
vermagic: 2.6.9-42.ELsmp SMP 686 REGPARM 4KSTACKS gcc-3.4
depends:

meta dataの作成(両方のノードで実施)

[root@h1 ~]# drbdadm create-md d0
v08 Magic number not found
v07 Magic number not found
About to create a new drbd meta data block
on /dev/sdb1.

==> This might destroy existing data! <==

Do you want to proceed?
[need to type 'yes' to confirm] yes

Creating meta data...
initialising activity log
NOT initialized bitmap (131036 KB)
New drbd meta data block sucessfully created.

--== Creating metadata ==--
As with nodes we count the total number of devices mirrored by DRBD at
at http://usage.drbd.org.

The counter works completely anonymous. A random number gets created for
this device, and that randomer number and the devices size will be sent.

[cut]

Enter 'no' to opt out, or just press [return] to continue:
success

開始と確認(両方のノードで実施)

[root@h1 ~]# drbdadm up all
[root@h1 ~]# cat /proc/drbd
version: 8.0.7 (api:86/proto:86)
GIT-hash: cf14288833afe95db396075f8530a5960d29e498 build by buildsystem@linbit, 2007-11-02 15:08:55
 0: cs:Connected st:Secondary/Secondary ds:Inconsistent/Inconsistent 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

同期開始(primary node側で実施)

[root@h1 ~]# drbdadm -- --overwrite-data-of-peer primary all

これは0.7系の--do-what-I-sayオプションの名前が変わったもの。

service開始

次のどちらかのコマンドでサービスを起動する。

/etc/init.d/drbd start
service drbd start

同期途中

[root@h1 ~]# service drbd status
drbd driver loaded OK; device status:
version: 8.0.3 (api:86/proto:86)
SVN Revision: 2881 build by buildsystem@linbit, 2007-05-07 19:20:34
 0: cs:SyncSource st:Primary/Secondary ds:UpToDate/Inconsistent C r---
   ns:14648428 nr:0 dw:0 dr:14656512 al:0 bm:894 lo:1 pe:6 ua:253 ap:0
       [======>.............] sync'ed: 30.1% (33246/47551)M
       finish: 0:48:29 speed: 11,696 (11,460) K/sec
       resync: used:1/31 hits:914879 misses:895 starving:0 dirty:0 changed:895
       act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0

cs:SyncSourceは、自ノード(h1)からピアノード(h2)へ同期中であると。このとき、h2では、cs:SyncTargetとなっている。

  • Comments (Close): 0
  • TrackBack (Close): 0

Index of all entries

Home > Archives > August 2008 Archive

Search
Feeds

Return to page top