I am checking the HA examples at ha/dummy started with make start(all 3 nodes has status is none).
1)When I tried to make node1 or node2 as master always node0 is becoming master.
Command I tried ./ctrl master node2 (verified from status node 0 master.node1 and node2 none)
Due to above 1) be slave not working
./ctrl slave node0 node1 127.0.0.1
ctrl: ctrl.c:144: beslave: Assertion `(confd_ha_beslave(s, &nodeid, &m, 1)) == 0’ failed.
Aborted (core dumped)
How to make either node1 or node 2 as master.Is in code by default selecting node0 master?
If you look into the README you will find that you address the command to a port. I.e. node0 has port 4565, which is the node you will address with your command if you don’t specify a port number.
If you want to address node1 use port 4575, node2 use port 4585.
So for example, your “./ctrl master node2” told node0 that node0 should be master with node ID set to “node2”.
You can verify this by doing something like: