[DRBD-user] Mounting /dev/drbd0 in secondary server with Heartbeat

Faria digolinopage at yahoo.com.br
Wed Aug 6 20:32:10 CEST 2008

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


Hello,

I'm using this versions:

 heartbeat: version 1.2.3
 drbd : version drbd-8.2.6

ubuntu-cluster1 = slave
ubuntu-cluster2 = master

two network cards in each cluster.

I configured heartbeat, when i remove the network cable, the primary server give the resources form secondary server, the /dev/drbd0 is mounted, but when i try to access the folder in /home come this message:

root at ubuntu-cluster1:/home# ls 
ls: reading directory .: Input/output error

See my configuration:

* ubuntu-cluster1 - eth0 192.168.1.1 / eth1 10.0.0.1 (ha) 
  #/etc/rc.local
    drbdadm attach r0
    drbdadm connect r0
    drbdadm -- --overwrite-data-of-peer primary
    mount -t ext3 /dev/drbd0 /home
  
   - Note : the /dev/drbd0 is mounted in filesystem

    /dev/drbd0            189G  243M  179G   1% /home

* ubuntu-cluster2 eth0 192.168.1.2 / eth1 10.0.0.2 (ha)
  #/etc/rc.local  
    drbdadm attach r0
    drbdadm connect r0
    drbdadm attach r0
    drbdadm secondary 

   - Note : using the command "cat /proc/drdb"
   
root at ubuntu-cluster2:~# cat /proc/drbd 
version: 8.2.5 (api:88/proto:86-88)
GIT-hash: 9faf052fdae5ef0c61b4d03890e2d2eab550610c build by root at ubuntu-cluster2, 2008-07-30 09:11:50
 0: cs:SyncSource st:Primary/Secondary ds:UpToDate/Inconsistent C r---
    ns:18144 nr:0 dw:12 dr:18266 al:0 bm:66 lo:0 pe:0 ua:0 ap:0
	[>....................] sync'ed:  0.1% (186823/186841)M
	finish: 132:51:09 speed: 340 (324) K/sec
	resync: used:0/31 hits:1131 misses:3 starving:0 dirty:0 changed:3
	act_log: used:0/127 hits:3 misses:0 starving:0 dirty:0 changed:0

root at ubuntu-cluster1:~# cat /proc/drbd 
version: 8.2.6 (api:88/proto:86-88)
GIT-hash: 3e69822d3bb4920a8c1bfdf7d647169eba7d2eb4 build by root at ubuntu-cluster1, 2008-07-31 17:17:24
 0: cs:SyncTarget st:Secondary/Primary ds:Inconsistent/UpToDate C r---
    ns:0 nr:31072 dw:31072 dr:0 al:0 bm:4 lo:0 pe:0 ua:0 ap:0 oos:191294692
	[>....................] sync'ed:  0.1% (186811/186841)M
	finish: 132:50:36 speed: 344 (320) K/sec

My /etc/drbd.conf

global { 
  usage-count yes; 
}
common {
  protocol C;
}
resource r0 {
  on ubuntu-cluster1 {
    device    /dev/drbd0;
    disk      /dev/sda8;
    address   10.0.0.1:7789;
    meta-disk internal;
  }
  on ubuntu-cluster2 {
    device    /dev/drbd0;
    disk      /dev/sda8;
    address   10.0.0.2:7789;
    meta-disk internal;
  }

Starting the drbd in two clusters:

root at ubuntu-cluster1:~# /etc/init.d/drbd start
Starting DRBD resources:    [ s(r0) ]

root at ubuntu-cluster2:~# /etc/init.d/drbd start
Starting DRBD resources:    [ s(r0) ]

My heartbeat files:

#haresources
ubuntu-cluster2	drbddisk::r0 Filesystem::/dev/drbd0::/home::ext3 drbd

#ha.cf

debugfile               /var/log/ha-debug
logfile                 /var/log/ha-log
logfacility             local0
logfacility daemon                   
node ubuntu-cluster2 
node ubuntu-cluster1   
keepalive 1                 	        
deadtime 10                          
bcast eth0                           
ping 192.168.1.254                   
auto_failback on

Hearbeat started in two clusters.

Logs drbd:

Aug  6 11:52:54 ubuntu-cluster1 kernel: [  339.460000] drbd0: Considering state change from bad state. Error would be: 'Refusing to be Primary without at least one UpToDate disk'
Aug  6 11:52:54 ubuntu-cluster1 kernel: [  339.460000] drbd0:  old = { cs:NetworkFailure st:Primary/Unknown ds:Inconsistent/DUnknown r--- }
Aug  6 11:52:54 ubuntu-cluster1 kernel: [  339.460000] drbd0:  new = { cs:Unconnected st:Primary/Unknown ds:Inconsistent/DUnknown r--- }
Aug  6 11:52:54 ubuntu-cluster1 kernel: [  339.460000] drbd0: conn( NetworkFailure -> Unconnected ) 
Aug  6 11:52:54 ubuntu-cluster1 kernel: [  339.460000] drbd0: receiver terminated
Aug  6 11:52:54 ubuntu-cluster1 kernel: [  339.460000] drbd0: receiver (re)started
Aug  6 11:52:54 ubuntu-cluster1 kernel: [  339.460000] drbd0: Considering state change from bad state. Error would be: 'Refusing to be Primary without at least one UpToDate disk'
Aug  6 11:52:54 ubuntu-cluster1 kernel: [  339.460000] drbd0:  old = { cs:Unconnected st:Primary/Unknown ds:Inconsistent/DUnknown r--- }
Aug  6 11:52:54 ubuntu-cluster1 kernel: [  339.460000] drbd0:  new = { cs:WFConnection st:Primary/Unknown ds:Inconsistent/DUnknown r--- }
Aug  6 11:52:54 ubuntu-cluster1 kernel: [  339.460000] drbd0: conn( Unconnected -> WFConnection )


logs hearbeat:

eartbeat: 2008/08/06_11:26:36 WARN: node ubuntu-cluster2: is dead
heartbeat: 2008/08/06_11:26:36 WARN: No STONITH device configured.
heartbeat: 2008/08/06_11:26:36 WARN: Shared disks are not protected.
heartbeat: 2008/08/06_11:26:36 info: Resources being acquired from ubuntu-cluster2.
heartbeat: 2008/08/06_11:26:36 info: Link ubuntu-cluster2:eth0 dead.
heartbeat: 2008/08/06_11:26:36 info: Running /etc/ha.d/rc.d/status status
heartbeat: 2008/08/06_11:26:36 info: No local resources [/usr/lib/heartbeat/ResourceManager listkeys ubuntu-cluster1] to acquire.
heartbeat: 2008/08/06_11:26:36 info: Taking over resource group drbddisk::r0
heartbeat: 2008/08/06_11:26:36 info: Acquiring resource group: ubuntu-cluster2 drbddisk::r0 Filesystem::/dev/drbd0::/home::ext3 drbd
heartbeat: 2008/08/06_11:26:36 info: Running /etc/ha.d/resource.d/drbddisk r0 start
heartbeat: 2008/08/06_11:26:49 ERROR: Return code 1 from /etc/ha.d/resource.d/drbddisk
heartbeat: 2008/08/06_11:26:49 info: Running /etc/ha.d/resource.d/Filesystem /dev/drbd0 /home ext3 start
heartbeat: 2008/08/06_11:26:49 ERROR: Couldn't mount filesystem /dev/drbd0 on /home
heartbeat: 2008/08/06_11:26:49 ERROR: Return code 1 from /etc/ha.d/resource.d/Filesystem
heartbeat: 2008/08/06_11:26:49 info: /usr/lib/heartbeat/mach_down: nice_failback: foreign resources acquired
heartbeat: 2008/08/06_11:26:49 info: mach_down takeover complete.
heartbeat: 2008/08/06_11:26:49 info: mach_down takeover complete for node ubuntu-cluster2

Any Idea ?

Best regards.

Faria



      Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara @ymail.com ou @rocketmail.com.
http://br.new.mail.yahoo.com/addresses



More information about the drbd-user mailing list