Comment 4 for bug 2012740

Revision history for this message
Scati Labs I+D (scatilabs) wrote :

Hi!

Sure, here we go.

[Test Case]

lxc launch ubuntu:22.04 node1
lxc shell node1
  apt update && apt dist-upgrade -y
  apt install pcs mysql-server resource-agents -y
  echo hacluster:hacluster | chpasswd
  mysql -e "CREATE USER 'replicator'@'localhost'"
  mysql -e "GRANT RELOAD, PROCESS, SUPER, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'replicator'@'localhost'"
  systemctl disable mysql.service
  systemctl stop mysql.service
  exit
lxc copy node1 node2
lxc start node2
lxc shell node1
  pcs host auth node1 node2 -u hacluster -p hacluster
  pcs cluster setup --force mysqlclx node1 node2 transport udpu
  pcs cluster enable --all
  pcs cluster start --all
  pcs property set stonith-enabled=false
  pcs property set no-quorum-policy=ignore
  pcs resource create p_mysql ocf:heartbeat:mysql \
    replication_user=replicator \
    test_user=root \
    op demote interval=0s timeout=120 monitor interval=20 timeout=30 monitor \
    interval=10 role=Master timeout=30 monitor interval=30 role=Slave timeout=30 \
    notify interval=0s timeout=90 promote interval=0s timeout=120 start \
    interval=0s timeout=120 stop interval=0s timeout=120 meta notify=true
  pcs resource promotable p_mysql p_mysql-master notify=true

[/Test Case]

After that there should be a crash file at /var/crash/ in some of the nodes.

Inorder to force the crash again:

* Check with crm_mon which node is promoted.
* run: pcs node standby <promotednodename>
* Check crm_mon again until the node gets in standby mode (without resources running).
** It will take a really long time.
* A crash will be created on the other node.

Hope it helps. Kind regards.