Versions available for this page: CUBRID 8.2.1 | CUBRID 8.3.0 | CUBRID 8.3.1 |
To use the HA feature, the following configuration is required.
For HA configuration, the CUBRID heartbeat feature must be activated in both active and standby servers. The broker and the database server can be configured either on a single device or in separate systems. The following figure describes how to configure the environment and run.

Create the same user account (e.g. ha_user1) for Active and Standby servers and start CUBRID with this account. The UNIX user account that is created becomes the node group ID of the server that will run in HA mode.
The HA script is located in the CUBRID/share/init.d/cubrid-ha. Prepare it in an active and a standby (etc/init.d/) server, respectively. If you configure HA with a different account in one host and then register this configuration to the system server, you should changer the HA start script name into cubrid-ha-{unix user id}. And then you should copy each script to /etc/init.d directory. Note that a root authorization is required to register the system service; otherwise, you can omit the script name change and copy the script.
[root@server_s1 init.d]# cd /home/ha_user1/CUBRID/share/init.d/
[root@server_s1 init.d]# cp cubrid-ha /etc/init.d/
Create a new DB (e.g. tdb01) in the active server and copy it to the standby server. You can use one of the following methods - data volume copy, backup/recovery and unloaddb/loaddb.
You must add the HA related parameter to the cubrid.conf configuration file. The HA related parameter must be configured in [common] section. For databases that will not run in HA mode, set the value of the ha_mode to no in [@<database>] section. An error will occur when the value of the ha_mode is no in [common] section and the value of the ha_mode is yes in [@<database>] section.
#cubrid.conf
[common]
...
ha_mode = on
ha_port_id = 41523
ha_node_list = ha_user1@server_s1:server_s2
Add the following configuration to the HA start script files prepared in active and standby database servers.
"#cubrid-ha
CUBRID_USER = ha_user1
DB_LIST = ’tdb01’
# DB_LIST = ’tdb01 tdb02 tdb03’
The default operation mode of the broker is one that requires read and write operations. If necessary, you can set it as a Read only or Slave only broker by using the ACCESS_MODE parameter in the cubrid_broker.conf file.
#cubrid_broker.conf
ACCESS_MODE = RW|RO|SO
RW := Read-Write broker (default value)
RO := Read-Only broker
SO := Slave-Only broker
You can check the operation mode of a running broker with the -f parameter of the cubrid broker status utility. For more information about the broker status, see Checking Broker Status.
% broker1 - cub_cas [4430,40821] /home/CUBRID/log/broker/broker1.access /home/CUBRID/
JOB QUEUE:0, AUTO_ADD_APPL_SERVER:ON, SQL_LOG_MODE:ALL:100000
LONG_TRANSACTION_TIME:60, LONG_QUERY_TIME:60, SESSION_TIMEOUT:300
KEEP_CONNECTION:AUTO, ACCESS_MODE:RW
-----------------------------------------------------------------------------------------------------------------------
ID PID QPS LQS PSIZE STATUS LAST ACCESS TIME DB HOST LAST CONNECT TIME CLIENT IP
-----------------------------------------------------------------------------------------------------------------------
1 26946 0 0 51168 IDLE 2009/11/06 16:06:41 - - - 10.0.1.101
2 26947 0 0 51172 IDLE 2009/11/06 16:06:41 - - - 10.0.1.101
3 26948 0 0 51172 IDLE 2009/11/06 16:06:41 - - - 10.0.1.101
4 26949 0 0 51172 IDLE 2009/11/06 16:06:41 - - - 10.0.1.101
5 26950 0 0 51172 IDLE 2009/11/06 16:06:41 - - - 10.0.1.101
You need to add the host information of the Active and the Standby servers to be used in the HA configuration to the database location file (databases.txt) in the broker/server system. The Active and the Standby servers are separated by a colon (:). More than one Standby servers can be added with each host being separated by a colon (:). As described above, in the environment where multiple hosts are specified for the same database, you must specify a host name (@host) next to a target database name when executing utilities such as csql, backupdb or applylogdb in client/server (CS) mode. On the other hand, in case of executing utilities in stand-alone (SA) mode, you cannot specify a host name next to a target database.
#databases.txt
#db-name vol-path db-host log-path
tbl01 /home/db/db2 server_s1:server_s2 /home/db/db2
tbl02 /home/db/db1 server_s1:server_s2 /home/db/db1