Linux
Réseaux
DRBD
Test de simulation de crash système du Primary
Pour : Linux
TEST 1
Sur le serveur 1 (actuellement primary) faite ceci pour arrêter la machine:
# shutdown -h now
# drbdadm primary [nom_resource]
# drbdadm primary data
# cat /proc/drbd [...] 0: cs:WFConnection st:Primary/Unknown ds:UpToDate/DUnknown C r--- [...]
# mkdir /data
# mount /dev/drbd0 /data
# cat /proc/drbd version: 8.3.7 (api:88/proto:86-91) srcversion: EE47D8BF18AC166BE219757 1: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate C r---- ns:0 nr:36 dw:36 dr:0 al:0 bm:2 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0
# shutdown -h now
# drbdadm primary data
# mount /dev/drbd0 /data
# service drbd stop
# fdisk /dev/sdb WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u'). Command (m for help): d Selected partition 1 Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-1044, default 1): Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-1044, default 1044): +500M Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
# dd if=/dev/zero of=/dev/sdb1 bs=1M count=128 128+0 enregistrements lus 128+0 enregistrements écrits 134217728 octets (134 MB) copiés, 5,43029 s, 24,7 MB/s
# drbdadm create-md data --== Thank you for participating in the global usage survey ==-- The server's response is: node already registered Writing meta data... initializing activity log NOT initialized bitmap New drbd meta data block successfully created. success
# service drbd start
# cat /proc/drbd version: 8.3.7 (api:88/proto:86-91) srcversion: EE47D8BF18AC166BE219757 1: cs:SyncTarget ro:Secondary/Secondary ds:Inconsistent/UpToDate C r---- ns:0 nr:148608 dw:148608 dr:0 al:0 bm:9 lo:0 pe:0 ua:1 ap:0 ep:1 wo:b oos:373452 [====>...............] sync'ed: 29.0% (373452/522028)K finish: 0:15:33 speed: 128 (320) K/sec
# drbdadm primary data
# mount /dev/drbd0 /data