当前位置: 主页 > 服务器技术 > 其他技术 > 实例介绍用lustre1.6.5+drbd实现主备切换

实例介绍用lustre1.6.5+drbd实现主备切换

时间:2010-1-12来源:互联网 点击:

6,在mds 和 mds1 安装使用 hearbeat,让drbd 手动切换为自动切换,hearbeat我出于升力气,就apt-get 安装了,大家可以使用源码包安装
shell $> apt-get install hearbeat
shell $> cd /usr/share/doc/heartbeat
shell $> gunzip ha.cf.gz
shell $> gunzip haresources.gz
shell $> mv ha.cf haresouroes authkeys /etc/ha.d/
shell $> chmod 600 authkeys
shell $> vim authkeys
auth 1
1 crc
把这两行注释去掉
shell $> vim ha.cf
debugfile /var/log/ha-debug
logfile    /var/log/ha-log
logfacility    local0
keepalive 2
deadtime 30
warntime 10
initdead 120
udpport    694
auto_failback off
node    mds
node    mds1
ping 192.168.6.1
respawn hacluster /usr/lib/heartbeat/ipfail
shell $> vim haresouroes
mds 192.168.6.25 drbddisk::r0 Filesystem::/dev/drbd0::/opt::lustre

7.最后的调试,于查看日志!
mds  $> /etc/init.d/hearbeat start
mds  $> tailf /var/log/messges


mds1 $> /etcinit.d/hearbeat start
mds  $> tailf /var/log/messages
Jan 15 21:40:11 mds kernel: [ 4000.216541] Lustre: MGS MGS started
Jan 15 21:40:11 mds kernel: [ 4000.240713] Lustre: Enabling user_xattr
Jan 15 21:40:11 mds kernel: [ 4000.242264] Lustre: 8634:0:(mds_fs.c:460:mds_init_server_data()) RECOVERY: service testfs-MDT0000, 1 recoverable clients, last_transno 57
Jan 15 21:40:11 mds kernel: [ 4000.268658] Lustre: MDT testfs-MDT0000 now serving dev (testfs-MDT0000/130da46d-1bef-9e79-4da2-a0e5005f60ab), but will be in recovery for at least 5:00, or until 1 client reconnect. During this time new clients will not be allowed to connect. Recovery progress can be monitored by watching /proc/fs/lustre/mds/testfs-MDT0000/recovery_status.
Jan 15 21:40:11 mds kernel: [ 4000.268691] Lustre: 8634:0:(lproc_mds.c:262:lprocfs_wr_group_upcall()) testfs-MDT0000: group upcall set to /usr/sbin/l_getgroups
Jan 15 21:40:11 mds kernel: [ 4000.268709] Lustre: testfs-MDT0000.mdt: set parameter group_upcall=/usr/sbin/l_getgroups
Jan 15 21:40:11 mds kernel: [ 4000.269073] Lustre: 8634:0:(mds_lov.c:1008:mds_notify()) MDS testfs-MDT0000: in recovery, not resetting orphans . testfs-OST0000_UUID
Jan 15 21:40:11 mds kernel: [ 4000.269079] Lustre: 8634:0:(mds_lov.c:1008:mds_notify()) Skipped 1 previous similar message
Jan 15 21:40:11 mds kernel: [ 4000.287049] Lustre: Server testfs-MDT0000 . device /dev/drbd0 has started
Jan 15 21:40:11 mds Filesystem[8579]: INFO:  Success
我们可以看到很多信息,看到最后一行,已经 Success文件系统已经被挂载,
mds $> cat /proc/drbd
version: 8.3.0 (api:88/proto:86-89)
GIT-hash: 9ba8b93e24d842f0dd3fb1f9b90e8348ddb95829 build by root@mds, 2009-01-14 00:39:29
 0: cs:WFConnection ro:Primary/Secondary ds:UpToDate/UpToDate C r---
    ns:20596 nr:660 dw:788 dr:20750 al:5 bm:10 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:12
然后我们把mds关机~在mds1一直执行这 tailf /var/log/message查看日志
mds $> shutdown -h now
mds1 $> tailf /var/log/message
Jan 15 22:00:56 mds1 kernel: [ 5250.672618] drbd0: role( Secondary -> Primary )
Jan 15 22:00:56 mds1 Filesystem[5920]: INFO:  Resource is stopped
Jan 15 22:00:56 mds1 ResourceManager[5665]: info: Running /etc/ha.d/resource.d/Filesystem /dev/drbd0 /opt lustre start
Jan 15 22:00:56 mds1 Filesystem[5996]: INFO: Running start for /dev/drbd0 . /opt
Jan 15 22:00:57 mds1 kernel: [ 5251.766369] kjournald starting.  Commit interval 5 seconds
Jan 15 22:00:57 mds1 kernel: [ 5251.768068] LDISKFS-fs warning: maximal mount count reached, running e2fsck is recommended
Jan 15 22:00:57 mds1 kernel: [ 5251.771802] LDISKFS FS . drbd0, internal journal
Jan 15 22:00:57 mds1 kernel: [ 5251.771944] LDISKFS-fs: recovery complete.
Jan 15 22:00:57 mds1 kernel: [ 5251.776258] LDISKFS-fs: mounted filesystem with ordered data mode.
Jan 15 22:00:57 mds1 kernel: [ 5251.894315] kjournald starting.  Commit interval 5 seconds
Jan 15 22:00:57 mds1 kernel: [ 5251.899051] LDISKFS-fs warning: maximal mount count reached, running e2fsck is recommended
Jan 15 22:00:57 mds1 kernel: [ 5251.903082] LDISKFS FS . drbd0, internal journal
Jan 15 22:00:57 mds1 kernel: [ 5251.903095] LDISKFS-fs: mounted filesystem with ordered data mode.
Jan 15 22:00:57 mds1 kernel: [ 5252.158408] Lustre: MGS MGS started

站长资讯网
.
分页: [1] [2] [3]
TAG: luster1.6.5 drbd 主备切换
推荐内容最近更新人气排行
关于我们 | 友情链接 | 网址推荐 | 常用资讯 | 网站地图 | RSS | 留言