Strange behavior in HA mode
Hi!
I setup a ha cluster with master+slave following this tutorial: http://www.cubrid.org/manual/843/en/CUBRID%20HA.
I called my nodes : cubrid and cubrid2.
All nodes have this in cubrid.conf:
[@demodb] ha_mode=on force_remove_log_archives=no log_max_archives=100
cubrid_ha.conf:
[common] ha_copy_sync_mode=sync:sync ha_port_id=59901 ha_node_list=demodb@cubrid:cubrid2 ha_db_list=demodb ha_apply_max_mem_size=500
cubrid@cubrid:~$ cubrid heartbeat status @ cubrid heartbeat list HA-Node Info (current cubrid, state master) Node cubrid2 (priority 2, state slave) Node cubrid (priority 1, state master) HA-Process Info (master 882, state master) Applylogdb demodb@localhost:/var/opt/cubrid/databases/demodb_cubrid2 (pid 3342, state registered) Copylogdb demodb@cubrid2:/var/opt/cubrid/databases/demodb_cubrid2 (pid 3340, state registered) Server demodb (pid 3123, state registered_and_active) cubrid@cubrid2:~$ cubrid heartbeat status @ cubrid heartbeat list HA-Node Info (current cubrid2, state slave) Node cubrid2 (priority 2, state slave) Node cubrid (priority 1, state master) HA-Process Info (master 2478, state slave) Applylogdb demodb@localhost:/var/opt/cubrid/databases/demodb_cubrid (pid 2704, state registered) Copylogdb demodb@cubrid:/var/opt/cubrid/databases/demodb_cubrid (pid 2702, state registered) Server demodb (pid 2485, state registered)
When I do some benchmark on the node "cubrid2", I can see node "cubrid" sending the data to cubrid2 then cubrid2 to my client. Using "top" command I can see node "cubrid" becomes busy with many INSERT, where as node "cubrid2" idle.
When I shutdown the node "cubrid", "cubrid2" becomes the new master but I can't send any query to cubrid2, it times out (trying to fetch data from node "cubrid"). When node "cubrid" is back, cubrid2 answer (I have to reload the heartbeat).
I'm using CUBRID version 8.4.3 from Ubuntu (12.04) repository
Thanks!
After you shutdown your "cubrid" node, run the following command on "cubrid2" and please add the output to your question above. Then in the comment of this answer, let me know that you've done.
cubrid changemode demodb@localhost
I assume that when you turn off "cubrid", "cubrid2" correctly becomes master but it enters "to-be-active" mode which is the mode right before "active" mode. In this "to-be-active" mode, the demodb database on that "cubrid2" node is not available yet.
So, let me know the output of the above command.