TIP’S DRBD


Langkah-langkahnya adalah sbb:

1. Tambahkan resources baru di /etc/drbd.conf
2. Create metadata untuk node1
[root@node1 ~]# drbdadm create-md asterisk
[root@node1 ~]# /etc/init.d/drbd start
[root@node1 ~]# /etc/init.d/drbd (harusnya ini masih secondary/secondary dan inconsistence
[root@node2 ~]# /etc/init.d/drbd start
3. Jadikan node1 sebagai primary
[root@node1 ~]# drbdadm — –overwrite-data-of-peer asterisk
4. Format /dev/drdb1 (lakukan hanya di node1
[root@node1 ~]# mkfs -j /dev/drbd1
[root@node1 ~]# tune2fs -j 1 -c 0 /dev/drdb1
[root@node1 ~]# mkdir /asterisk
[root@node2 ~]# mkdir /asterisk
[root@node1 ~]# mount -o rw /dev/drbd1 /asterisk
[root@node1 ~]# mkdir -p /asterisk/{01,02}
5. Jadikan node1 sbg secondary
[root@node1 ~]# umount /asterisk
[root@node1 ~]# drbdam secondary asterisk
6. Jadikan node2 sebagai primary
[root@node2 ~]# drbdadm primary asterisk
[root@node2 ~]# mount -o rw /dev/drbd1 /asterisk
[root@node2 ~]# ls -l /asterisk ( harusnya folder 01, dan 02 harus muncul)
7. Kembalikan node1 sbg primary
[root@node2 ~]# umount /asterisk
[root@node2 ~]# drbdam secondary asterisk
[root@node1 ~]# drbdadm primary asterisk
[root@node1 ~]# mount -o rw /dev/drbd1 /asterisk
[root@node1 ~]# ls -l /asterisk
8. Tambahkan di /etc/ha.d/haresources (node1 & node2)
node1 IPaddr::192.168.137.100 drbddisk::mydrbd Filesystem::/dev/drbd0::/asterisk::ext3 mysql httpd drbddisk::asterisk Filesystem::/dev/drbd1::/asterisk::ext3 asterisk
9. Restat heartbeat di masing-masing node
10.Check hasilnya
============================================================================================

[root@node1 ~]# lvcreate -n lvasterisk -L+100M /dev/vgdata
[root@node2 /]# lvcreate -n lvasterisk -L+100M /dev/vgdata
[root@node1 ~]# drbdadm create-md asterisk
[root@node1 ~]# /etc/init.d/drbd start
[root@node1 ~]# cat /proc/drbd

[root@node1 etc]# cat /proc/drbd
version: 8.0.16 (api:86/proto:86)
GIT-hash: d30881451c988619e243d6294a899139eed1183d build by mockbuild@v20z-x86-64.home.local, 2009-08-22 13:23:34
0: cs:Connected st:Secondary/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/61 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
1: 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/61 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

[root@node1 etc]# /etc/init.d/drbd status
drbd driver loaded OK; device status:
version: 8.0.16 (api:86/proto:86)
GIT-hash: d30881451c988619e243d6294a899139eed1183d build by mockbuild@v20z-x86-64.home.local, 2009-08-22 13:23:34
m:res cs st ds p mounted fstype
0:mydrbd Connected Secondary/Secondary UpToDate/UpToDate C
1:asterisk Connected Secondary/Secondary Inconsistent/Inconsistent C

[root@node2 ha.d]# cat /proc/drbd
version: 8.0.16 (api:86/proto:86)
GIT-hash: d30881451c988619e243d6294a899139eed1183d build by mockbuild@v20z-x86-64.home.local, 2009-08-22 13:23:34
0: cs:Connected st:Secondary/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/61 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
1: 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/61 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
[root@node2 ha.d]# /etc/init.d/drbd status
drbd driver loaded OK; device status:
version: 8.0.16 (api:86/proto:86)
GIT-hash: d30881451c988619e243d6294a899139eed1183d build by mockbuild@v20z-x86-64.home.local, 2009-08-22 13:23:34
m:res cs st ds p mounted fstype
0:mydrbd Connected Secondary/Secondary UpToDate/UpToDate C
1:asterisk Connected Secondary/Secondary Inconsistent/Inconsistent C
[root@node1 etc]# drbdadm — –overwrite-data-of-peer primary asterisk
[root@node1 etc]# /etc/init.d/drbd status
drbd driver loaded OK; device status:
version: 8.0.16 (api:86/proto:86)
GIT-hash: d30881451c988619e243d6294a899139eed1183d build by mockbuild@v20z-x86-64.home.local, 2009-08-22 13:23:34
m:res cs st ds p mounted fstype
0:mydrbd Connected Secondary/Secondary UpToDate/UpToDate C
… sync’ed: 36.0% (65976/102360)K
1:asterisk SyncSource Primary/Secondary UpToDate/Inconsistent C

[root@node2 ha.d]# /etc/init.d/drbd status
drbd driver loaded OK; device status:
version: 8.0.16 (api:86/proto:86)
GIT-hash: d30881451c988619e243d6294a899139eed1183d build by mockbuild@v20z-x86-64.home.local, 2009-08-22 13:23:34
m:res cs st ds p mounted fstype
0:mydrbd Connected Secondary/Secondary UpToDate/UpToDate C
1:asterisk Connected Secondary/Primary UpToDate/UpToDate C
[root@node1 etc]# mkfs -j /dev/drbd1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
25688 inodes, 102360 blocks
5118 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
13 block groups
8192 blocks per group, 8192 fragments per group
1976 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729

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

This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@node1 etc]#
[root@node1 etc]# tune2fs -c 1 -i 0 /dev/drbd1
tune2fs 1.39 (29-May-2006)
Setting maximal mount count to 1
Setting interval between checks to 0 seconds
[root@node1 etc]# mkdir /asterisk
[root@node2 ha.d]# mkdir /asterisk
[root@node1 etc]# mount -o rw /dev/drbd1 /asterisk/

[root@node1 etc]# vim /etc/ha.d/haresources
node1 IPaddr::192.168.137.100 drbddisk::mydrbd Filesystem::/dev/drbd0::/data::ext3 httpd mysqld drbddisk::asterisk Filesystem::/dev/drbd1::/asterisk::ext3 asterisk

[root@node2 ha.d]# vim /etc/ha.d/haresources
node1 IPaddr::192.168.137.100 drbddisk::mydrbd Filesystem::/dev/drbd0::/data::ext3 httpd mysqld drbddisk::asterisk Filesystem::/dev/drbd1::/asterisk::ext3 asterisk
[root@node1 etc]# /etc/init.d/drdbd restart
[root@node2 etc]# /etc/init.d/drdbd restart

Apabila terjadi WFCONNECTION OR STANDALONE

[root@node2 etc]# drbdadm secondary mydrbd
[root@node2 etc]# drbdadm — –discard-my-data connect mydrbd

[root@node1 etc]# drbdadm primary mydrbd
[root@node1 etc]# drbdadm connect mydrbd

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

shisdew

Listens until think alike

moses.spaceku@yahoo.com / voip ipbx

Hosted PBX, IP-PBX SOHO/ CALL CENTER, VOICE GATEWAY, VOICE CARD, COST EFECTIVE SOLUTIONS (LCR), GSM/CDMA GATEWAY

%d bloggers like this: