Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 

Starting and Verifying CUBRID HA

Starting CUBRID HA

Execute the cubrid heartbeat start at each node in the CUBRID HA group. Note that the node executing cubrid heartbeat start first will become a master node. In the example below, the host name of a master node is nodeA and that of a slave node is nodeB.

  • Master node
  • [nodeA]$ cubrid heartbeat start

  • Slave node
  • [nodeB]$ cubrid heartbeat start

Verifying CUBRID HA Status

Execute cubrid heartbeat status at each node in the CUBRID HA group to verify its configuration status. In the example below, the host name of a master node is nodeA and that of a slave node is nodeB.

[nodeA]$ cubrid heartbeat status

@ cubrid heartbeat list

 HA-Node Info (current nodeA-node-name, state master)

   Node nodeB-node-name (priority 2, state slave)

   Node nodeA-node-name (priority 1, state master)

 HA-Process Info (nodeA 9289, state nodeA)

   Applylogdb testdb@localhost:/home1/cubrid1/DB/testdb_nodeB.cub (pid 9423, state registered)

   Copylogdb testdb@nodeB-node-name:/home1/cubrid1/DB/testdb_nodeB.cub (pid 9418, state registered)

   Server testdb (pid 9306, state registered_and_active)

 

[nodeA]$

Use the cubrid changemode utility at each node in the CUBRID HA group to verify the status of the server.

  • Master node
  • [nodeA]$ cubrid changemode testdb@localhost

    The server 'testdb@localhost''s current HA running mode is active.

  • Slave node
  • [nodeB]$ cubrid changemode testdb@localhost

    The server 'testdb@localhost''s current HA running mode is standby.

Verifying the CUBRID HA Operation

Verify that action is properly applied to standby server of the slave node after performing write in an active server of the master node. To make a success connection via the CSQL Interpreter in HA environment, you must specify the host name to be connected after the database name like "@<host_name>"). If you specify a host name as localhost, it is connected to local node.

Warning Ensure that primary key must exist when creating a table to have replication successfully processed.

  • Master node
  • [nodeA]$ csql -u dba testdb@localhost -c "create table abc(a int, b int, c int, primary key(a));"

    [nodeA]$ csql -u dba testdb@localhost -c "insert into abc values (1,1,1);"

    [nodeA]$

  • Slave node
  • [nodeB]$ csql -u dba testdb@localhost -l -c "select * from abc;"

    === <Result of SELECT Command in Line 1> ===

    <00001> a: 1

            b: 1

            c: 1

    [nodeB]$