Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support the arbitration service.
If the original OBServer node where the arbitration service resides is down or disconnected after you replace or remove the arbitration service, the original OBServer node may contain residual cluster information. You must manually clear the residual cluster information by using the ob_admin tool.
Prerequisites
The ob_admin tool is installed on the original OBServer node where the arbitration service resides. When you deploy the arbitration service on an OBServer node, the ob_admin tool is installed in the /home/admin/oceanbase/bin directory on the OBServer node by default. If the ob_admin tool is not installed on the original OBServer node where the arbitration service resides, you must install the ob_admin tool before you clear the residual cluster information. For more information about how to install the ob_admin tool, see ob_admin overview.
Procedure
Check the arbitration service.
Log on to the
systenant of the cluster as therootuser.Note that you must specify the corresponding parameters in the following sample code based on your actual database configurations.
obclient -h10.xx.xx.xx -P2883 -uroot@sys#obdemo -p***** -AFor more information about how to connect to a database, see Overview (MySQL mode) or Overview (Oracle mode).
Execute the following statement to verify that the arbitration service of the cluster is replaced or removed:
SELECT * FROM oceanbase.DBA_OB_ARBITRATION_SERVICE;The query result is as follows:
+---------------------+---------------------+-------------------------+---------------------+------------------------------+------+ | CREATE_TIME | MODIFY_TIME | ARBITRATION_SERVICE_KEY | ARBITRATION_SERVICE | PREVIOUS_ARBITRATION_SERVICE | TYPE | +---------------------+---------------------+-------------------------+---------------------+------------------------------+------+ | 2023-06-26 19:30:19 | 2023-06-30 09:42:40 | default | xx.xx.xx.194:2882 | | ADDR | +---------------------+---------------------+-------------------------+---------------------+------------------------------+------+ 1 row in setIf the
ARBITRATION_SERVICEfield is empty or indicates the IP address and port number of another OBServer node, and thePREVIOUS_ARBITRATION_SERVICEfield is empty, the arbitration service of the cluster is replaced or removed, and you can clear the residual cluster information. Otherwise, an arbitration member is providing services, and you cannot clear the residual cluster information.
Log on to the original OBServer node where the arbitration service resides and clear the residual cluster information on the OBServer node.
Log on to the original OBServer node where the arbitration service resides.
Go to the directory where the ob_admin tool is installed.
By default, the ob_admin tool is installed in the
/home/admin/oceanbase/bindirectory.cd /home/admin/oceanbase/binExecute the following statement to clear the residual cluster information:
./ob_admin -h$ARB_SERVER_IP -p$ARB_SERVER_PORT force_clear_arb_cluster_info $CLUSTER_IDThe parameters are described as follows:
$ARB_SERVER_IP: the IP address of the original OBServer node where the arbitration service resides.$ARB_SERVER_PORT: the RPC port number of the original OBServer node where the arbitration service resides. By default, Port 2882 is used.$CLUSTER_ID: the ID of the cluster. To obtain the cluster ID, connect to the database and execute theSHOW PARAMETERS LIKE 'cluster_id';statement.obclient> SHOW PARAMETERS LIKE 'cluster_id';The query result is as follows:
+-------+----------+----------------+----------+------------+-----------+----------+-------------------+----------+---------+---------+-------------------+---------------+-----------+ | zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level | default_value | isdefault | +-------+----------+----------------+----------+------------+-----------+----------+-------------------+----------+---------+---------+-------------------+---------------+-----------+ | zone1 | observer | 172.xx.xxx.xxx | 2882 | cluster_id | INT | 20230625 | ID of the cluster | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE | 0 | 0 | +-------+----------+----------------+----------+------------+-----------+----------+-------------------+----------+---------+---------+-------------------+---------------+-----------+ 1 row in setThe query result shows that the
cluster_idof the cluster is20230625.
The following sample statement clears the residual information of the specified cluster:
./ob_admin -hxx.xx.xx.64 -p2882 force_clear_arb_cluster_info 20230625The execution result is as follows:
succ to open, filename=ob_admin.log, fd=3, wf_fd=2 old log_file need close, old = ob_admin.log new = ob_admin.log succ to open, filename=ob_admin.log, fd=3, wf_fd=2 succ to open, filename=ob_admin_rs.log, fd=4, wf_fd=2