0
votes

Recently I tried to install and configure Corosync Pacemaker HA on my Ubuntu 20.04. So, everything goes well in my 2-node cluster. But after I restart one of nodes, the Fail Over IP did not switch properly and stays most of the time with the Slave and not on the Master.

Here is my Pacemaker config. I really appreciate if someone could help me with my problem.

property stonith-enabled=false
property no-quorum-policy=ignore
primitive ip IPaddr2 params ip=192.168.100.100 nic=eth0:0 op monitor interval=10s
primitive drbd_res ocf:linbit:drbd params drbd_resource=www op monitor interval=3s role=Master op monitor interval=30s role=Slave
ms drbd_master_slave drbd_res meta master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true
primitive fs_res ocf:heartbeat:Filesystem params device=/dev/drbd0 directory=/var/www/ fstype=ext4
colocation fs_drbd_colo INFINITY: fs_res drbd_master_slave:Master
order fs_after_drbd mandatory: drbd_master_slave:promote fs_res:start
commit
1
Usually the logs and crm_mon output tell you much more than the config. You should include such.U. Windl

1 Answers

0
votes

By default pacemaker will try to spread resources across the nodes as balanced as possible. You have 3 primitive resources, but you specify that two must always run together (filesystem and DRBD primary) with colocation fs_drbd_colo INFINITY: fs_res drbd_master_slave:Master. Naturally, Pacemaker will then try its best to run the other resource (IP) on another node when it makes sense to do so.

If you want to run all three resources together then you'll need an additional colocation constraint to specify this. Something like either the below examples should get the behavior you want.

colocation ip_drbd_colo INFINITY: ip drbd_master_slave:Master
colocation ip_fs_colo INFINITY: ip fs_res