cubrid changemode

Description

This utility is used to check and change the server status of CUBRID HA.

Syntax

cubrid changemode [option] <database-name>

Options

Option

Default

Description

-m

none

Changes the server status. You can enter one of the followings: standby, maintenance, or active.

-f

 

Configures whether or not to forcibly change the server status. This option must be configured if you want to change the server status from to-be-active to active. If it is not configured, the status will not be changed to active.

Forcibly change may cause replication inconsistency; so it is not recommended.

-t

5(second)

Configures the waiting time for the normal completion of the transaction that is being processed when the node status switches from standby to maintenance. If the transaction is still in progress beyond the configured time, it will be forced to terminate and switch to maintenance status; if all transactions have completed normally within the configured time, it will switch to maintenance status immediately.

Status Changeable Map

This table shows changeable modes depending on current status. However, replication inconsistency may occur if the status of the current server is changed from to-be-active to active. Therefore, it is recommended that only a user who is familiar with this condition uses this option.

 

Future Status

active

standby

maintenance

Current Status

standby

X

O

O

to-be-standby

X

X

X

active

O

X

X

to-be-active

O*

X

X

maintenance

X

O

O

* When the server status is to-be-active, forcibly change may cause replication inconsistency. It is not recommended if you are not skilled enough.

Example

The following example shows how to switch the testdb01 server status in the localhost node to maintenance. The waiting time for all transactions in progress to complete normally is 5 seconds, which is the default value for the -t option. If all transactions are complete within this time limit, the status will be switched immediately. However, if there are transactions still being processed after this time limit, they will be rolled back before changing the status.

$ cubrid changemode -m maintenance testdb01@localhost

The server 'testdb01@localhost''s current HA running mode is maintenance.

The following example shows how to look up the testdb01 server status in the localhost node.

$ cubrid changemode tesetdb01@localhost

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