Drbd
De Admin -- TALEVAS.
(Différences entre les versions)
| Ligne 52 : | Ligne 52 : | ||
Les machines sont en primaire / primaire pour permettre de lire/écrire des 2 cotés. Autrement les data du secondaire ne sont pas accessibles. | Les machines sont en primaire / primaire pour permettre de lire/écrire des 2 cotés. Autrement les data du secondaire ne sont pas accessibles. | ||
| + | |||
| + | |||
| + | |||
| + | RECOVERY | ||
| + | |||
| + | [root@data01 ~]# /etc/init.d/drbd start | ||
| + | Starting DRBD resources: [ | ||
| + | SERVICE | ||
| + | Found valid meta data in the expected location, 375809634304 bytes into /dev/HEBEX/DRBD. | ||
| + | d(SERVICE) s(SERVICE) n(SERVICE) ]outdated-wfc-timeout has to be shorter than degr-wfc-timeout | ||
| + | outdated-wfc-timeout implicitly set to degr-wfc-timeout (10s) | ||
| + | . | ||
| + | [root@data01 ~]# cat /proc/drbd | ||
| + | version: 8.3.8.1 (api:88/proto:86-94) | ||
| + | GIT-hash: 0d8589fcc32c874df57c930ca1691399b55ec893 build by root@data01.pooll.s1.p.fti.net, 2010-08-24 16:38:53 | ||
| + | 0: cs:StandAlone ro:Secondary/Unknown ds:Consistent/DUnknown r---- | ||
| + | ns:0 nr:0 dw:0 dr:0 al:0 bm:2 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:61440 | ||
| + | [root@data01 ~]# drbdadm -- --discard-my-data connect SERVICE | ||
| + | |||
| + | [root@data02 ~]# drbdadm connect SERVICE | ||
| + | |||
| + | [root@data01 ~]# drbdadm -- --discard-my-data connect SERVICE | ||
| + | [root@data01 ~]# cat /proc/drbd | ||
| + | version: 8.3.8.1 (api:88/proto:86-94) | ||
| + | GIT-hash: 0d8589fcc32c874df57c930ca1691399b55ec893 build by root@data01.pooll.s1.p.fti.net, 2010-08-24 16:38:53 | ||
| + | 0: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r---- | ||
| + | ns:0 nr:332264 dw:332264 dr:0 al:0 bm:27 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b | ||
| + | oos:0 | ||
| + | [root@data01 ~]# drbdadm primary all | ||
| + | [root@data01 ~]# cat /proc/drbd | ||
| + | version: 8.3.8.1 (api:88/proto:86-94) | ||
| + | GIT-hash: 0d8589fcc32c874df57c930ca1691399b55ec893 build by root@data01.pooll.s1.p.fti.net, 2010-08-24 16:38:53 | ||
| + | 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r---- | ||
| + | ns:0 nr:332264 dw:332264 dr:0 al:0 bm:27 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b | ||
| + | oos:0 | ||
| + | [root@data01 ~]# /etc/init.d/cluster | ||
| + | start stop status manuel_start manuel_stop | ||
| + | [root@data01 ~]# /etc/init.d/cluster start | ||
| + | CREATE /var/run/lfs2 | ||
| + | DRBD IS UP | ||
| + | STATUS DRBD :UpToDate/UpToDate | ||
| + | DONT START ANYTHING WHILE VOLUME IS NOT MOUNTED | ||
| + | PREPARING GFS2 | ||
| + | Starting cluster: | ||
| + | Loading modules... done | ||
| + | Mounting configfs... done | ||
| + | Starting ccsd... done | ||
| + | Starting cman... done | ||
| + | Starting daemons... done | ||
| + | Starting fencing... done | ||
| + | [ OK ] | ||
| + | /dev/drbd0 /mnt/DRBD gfs2 rw,noatime,hostdata=jid=0:id=65537:first=0 0 0 | ||
| + | /dev/drbd0 /mnt/DRBD gfs2 rw,noatime,hostdata=jid=0:id=65537:first=0 0 0 | ||
| + | Starting portmap: [ OK ] | ||
| + | Starting NFS statd: [ OK ] | ||
| + | Starting RPC idmapd: [ OK ] | ||
| + | Starting NFS services: [ OK ] | ||
| + | Starting NFS daemon: [ OK ] | ||
| + | Starting NFS mountd: [ OK ] | ||
| + | Starting High-Availability services: | ||
| + | 2010/09/09_15:17:53 INFO: Resource is stopped | ||
| + | [ OK ] | ||
| + | LETS GO | ||
| + | [root@data01 ~]# | ||
Version actuelle en date du 9 septembre 2010 à 13:19
/etc/init.d/drbd start
[root@data01 ~]# cat /proc/drbd version: 8.2.6 (api:88/proto:86-88) GIT-hash: 3e69822d3bb4920a8c1bfdf7d647169eba7d2eb4 build by buildsvn@c5-x8664-build, 2008-10-03 11:30:17 0: cs:StandAlone st:Secondary/Unknown ds:Consistent/DUnknown r--- ns:0 nr:0 dw:0 dr:0 al:0 bm:65 lo:0 pe:0 ua:0 ap:0 oos:483328
[root@data01 ~]# drbdadm connect SERVICE
[root@data01 ~]# cat /proc/drbd version: 8.2.6 (api:88/proto:86-88) GIT-hash: 3e69822d3bb4920a8c1bfdf7d647169eba7d2eb4 build by buildsvn@c5-x8664-build, 2008-10-03 11:30:17 0: cs:StandAlone st:Secondary/Unknown ds:Consistent/DUnknown r--- ns:0 nr:0 dw:0 dr:0 al:0 bm:65 lo:0 pe:0 ua:0 ap:0 oos:483328
data02-P ~ #drbdadm create-md SERVICE Valid meta data seems to be in place. Do you really want to overwrite? [need to type 'yes' to confirm] yes Writing meta data... initialising activity log NOT initialized bitmap New drbd meta data block sucessfully created.
data02-P ~ # drbdadm attach SERVICE
data02-P ~ # /etc/init.d/drbd start Starting DRBD resources: [ d(SERVICE) s(SERVICE) n(SERVICE) ]. .......... *************************************************************** DRBD's startup script waits for the peer node(s) to appear. - In case this node was already a degraded cluster before the reboot the timeout is 10 seconds. [degr-wfc-timeout] - If the peer was available before the reboot the timeout will expire after 20 seconds. [wfc-timeout] (These values are for resource 'SERVICE'; 0 sec -> wait forever) To abort waiting enter 'yes' [ 20]:
data01-P ~ # drbdadm connect SERVICE
data02-P ~ # drbdsetup /dev/drbd0 syncer -r 90M data02-P ~ # dstat 1 data02-P ~ # watch cat /proc/drbd
Les machines sont en primaire / primaire pour permettre de lire/écrire des 2 cotés. Autrement les data du secondaire ne sont pas accessibles.
RECOVERY
[root@data01 ~]# /etc/init.d/drbd start Starting DRBD resources: [ SERVICE Found valid meta data in the expected location, 375809634304 bytes into /dev/HEBEX/DRBD. d(SERVICE) s(SERVICE) n(SERVICE) ]outdated-wfc-timeout has to be shorter than degr-wfc-timeout outdated-wfc-timeout implicitly set to degr-wfc-timeout (10s) . [root@data01 ~]# cat /proc/drbd version: 8.3.8.1 (api:88/proto:86-94) GIT-hash: 0d8589fcc32c874df57c930ca1691399b55ec893 build by root@data01.pooll.s1.p.fti.net, 2010-08-24 16:38:53 0: cs:StandAlone ro:Secondary/Unknown ds:Consistent/DUnknown r---- ns:0 nr:0 dw:0 dr:0 al:0 bm:2 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:61440 [root@data01 ~]# drbdadm -- --discard-my-data connect SERVICE
[root@data02 ~]# drbdadm connect SERVICE
[root@data01 ~]# drbdadm -- --discard-my-data connect SERVICE
[root@data01 ~]# cat /proc/drbd
version: 8.3.8.1 (api:88/proto:86-94)
GIT-hash: 0d8589fcc32c874df57c930ca1691399b55ec893 build by root@data01.pooll.s1.p.fti.net, 2010-08-24 16:38:53
0: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r----
ns:0 nr:332264 dw:332264 dr:0 al:0 bm:27 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b
oos:0
[root@data01 ~]# drbdadm primary all
[root@data01 ~]# cat /proc/drbd
version: 8.3.8.1 (api:88/proto:86-94)
GIT-hash: 0d8589fcc32c874df57c930ca1691399b55ec893 build by root@data01.pooll.s1.p.fti.net, 2010-08-24 16:38:53
0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----
ns:0 nr:332264 dw:332264 dr:0 al:0 bm:27 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b
oos:0
[root@data01 ~]# /etc/init.d/cluster
start stop status manuel_start manuel_stop
[root@data01 ~]# /etc/init.d/cluster start
CREATE /var/run/lfs2
DRBD IS UP
STATUS DRBD :UpToDate/UpToDate
DONT START ANYTHING WHILE VOLUME IS NOT MOUNTED
PREPARING GFS2
Starting cluster:
Loading modules... done
Mounting configfs... done
Starting ccsd... done
Starting cman... done
Starting daemons... done
Starting fencing... done
[ OK ]
/dev/drbd0 /mnt/DRBD gfs2 rw,noatime,hostdata=jid=0:id=65537:first=0 0 0
/dev/drbd0 /mnt/DRBD gfs2 rw,noatime,hostdata=jid=0:id=65537:first=0 0 0
Starting portmap: [ OK ]
Starting NFS statd: [ OK ]
Starting RPC idmapd: [ OK ]
Starting NFS services: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
Starting High-Availability services:
2010/09/09_15:17:53 INFO: Resource is stopped
[ OK ]
LETS GO
[root@data01 ~]#