Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.3.0 |  CUBRID 8.3.1 | 

HA Start Mode

cubrid-ha start

cubrid-ha start is a command that starts the database server in HA mode. This command starts cub_master, cub_server, copylogdb and applylogdb processes in that order, and creates the path to which the replication log (copylog) is saved. Active and standby servers are determined depending on the order in which the cubrid-ha start command is executed.

The database of the server node (server_s1) that starts first becomes the master database.

[root@server_s1 ~]# service cubrid-ha start

Starting cubrid-ha: [ OK ]

The database of the server node (server_s2) that starts later becomes the slave database.

[root@server_s2 ~]# service cubrid-ha start

Starting cubrid-ha: [ OK ]  

cubrid-ha status

cubrid-ha status is a command that checks the status information of the database server running in HA mode. The status information of the HA node where this command was executed and of the HA-related processes is displayed.

[root@server_s2 ~]# service cubrid-ha status

 

HA-Node Info (current server_s2, state slave)

   Node server_s2 (priority 2, state slave)

   Node server_s1 (priority 1, state master)

 

HA-Process Info (master 30519, state slave)

   Applylogdb tdb01@localhost:/home1/cubrid1/DB/tdb01_server_s1 (pid 30796, state registered)

   Copylogdb tdb01@server_s1:/home1/cubrid1/DB/tdb01_server_s1 (pid 30788, state registered)

Server tdb01 (pid 30551, state registered)

 

++ cubrid heartbeat list: success

Status cubrid-ha: [ OK ]

cubrid-ha stop

cubrid-ha stop is a command that stops the database server running in HA mode. This command stops the applylogdb, copylogdb, cub_server and cub_master processes in that order. Note that all related processes are also terminated. If the command is executed on only one node (server_s1), failover is performed on the other node (server_s1): if it is executed on both nodes (server_s1, server_s2), the service will stop.

[root@server_s1 ~]# service cubrid-ha start

Starting cubrid-ha: [ OK ]  

To stop the service, execute this command on the other node (server_s2).

[root@server_s2 ~]# service cubrid-ha start

Starting cubrid-ha: [ OK ]

cubrid-ha deact

cubrid-ha deact is a command used to failover a service node to a different node to perform the batch operation at the node in service mode. This command changes the status of the node in service mode (server_s1) to unknown, and automatically failovers to a standby server node (server_s2).

[root @server_s1 ~]# service cubrid-ha deact

deactivate cubarid-ha                                        [  OK  ]

[root @server_s1 ~]# service cubrid-ha status

 

HA-Node Info (current server_s1, state unknown)

 

HA-Process Info (master 13396, state unknown)

 

Status cubrid-ha: [ OK ]  

cubrid-ha act

cubrid-ha act is a command that is used to recover the node to a service node after a batch operation is completed on the node in which cubrid-ha deact is executed. This command changes the status of the node (server_s1) from "unknown" to "active."

root@server_s1 ~]# service cubrid-ha act

activate cubrid-ha: [ OK ]

cubrid heartbeat deregister

cubrid heartbeat deregister is a command that is used to stop a certain process running on the current node and delete it from the list of processes to manage. The process ID must be specified. Even if the process stops, failover is not performed on the standby server.

The following is an example that stops the tdb01 server process running on the current node and deletes it from the process list when tdb01 and tdb02 are included in the database list and running in HA mode.

[ha_user1@server_s1 ~]$ cubrid heartbeat deregister 4087

@ cubrid heartbeat deregister: 4087

 

 HA-Process Info (master 4072, state master)

   Applylogdb tdb01@localhost:/home1/cubrid1/DB/tdb01_server_s2 (pid 4307, state registered) 

   Applylogdb tdb02@localhost:/home1/cubrid1/DB/tdb02_server_s2 (pid 4313, state registered)

   Copylogdb tdb02@server_s2:/home1/cubrid1/DB/tdb01_server_s2 (pid 4311, state registered)

   Copylogdb tdb01@server_s2:/home1/cubrid1/DB/tdb01_server_s2 (pid 4305, state registered)

   Server tdb02 (pid 4195, state registered_and_active)

   Server tdb01 (pid 4087, state deregistered)