I am using 2 machines with centos,mysql,drbd,heartbeat,asterisk.
node 1 has
- hdc :SAMSUNG HD160JJ/P, ATA DISK drive
- kernel version 1 SMP Tue Aug 21 17:50:26 EDT 2012
- kernel release 2.6.18-308.13.1.el5PAE
- mysql version 14.14 Distrib 5.1.65, for pc-linux-gnu (i686) using readline 5.1
- DRBD version version: 8.2.6 (api:88/proto:86-88)
- heartbeat version 2.1.3
- hdc4 for drbd partition
node 2
- SCSI device sda:625140335 512-byte hdwr sectors (320072 MB)
- kernel version 1 SMP Tue Aug 21 17:50:26 EDT 2012
- kernel release 2.6.18-308.13.1.el5PAE
- mysql version 14.14 Distrib 5.1.65, for pc-linux-gnu (i686) using readline 5.1
- DRBD version version: 8.2.6 (api:88/proto:86-88)
- heartbeat version 2.1.3
- sda6 for drbd partition
as per ideal conditions if node 1==primary node fails then alternate node==node 2 which secondary currently,immediately become primary. when node 1 again connect/on then it become secondary & when node 2 fails then node 1 become primary..so on...
Problem arises when i try to stimulate cases:- 1. Node 1 == primary node, all required services status ok. Node 2== secondary node,all required services status ok. Remove lan cable from node 1. Result:- For few sec node 2 become primary from secondary, then it become secondary. So mysql,asterisk services which resides in drbd partition which shared not works.
2.Now reattach lan cable to node 1. Result:- node 1 become secondary node. node 2 also secondary node. so no where mysql & asterisk working.
Same happened when at starting node 2==primary & node 1==secondary & follow these two steps. When i checks logs i found due to Mysql files owner should change at time of switching of secondary to primary as by following command works
chown mysql.mysql /repdata/mysql/*
chown mysql.mysql /repdata/mysql/mysql/*
This should do automatically. but not works, so mysql service not start properly so drbd-heartbeat give errors & so primary(which for very few sec) become secondary.
is there any solution for this? If any one want to see logs then i will post it too.