Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support the arbitration service.
After you execute the replace or remove arbitration service operation, if the original arbitration server is in a faulty state (down or disconnected), the machine where the original arbitration service resides may contain residual cluster information. You must manually clear the residual cluster information by using the ob_admin tool.
Prerequisites
Before clearing residual cluster information, confirm that the ob_admin tool is installed on the original arbitration server. When you deploy the arbitration service, the ob_admin tool is installed by default on the arbitration server, and the default installation path is /home/admin/oceanbase/bin. If you find that the ob_admin tool is not installed on the original arbitration server, install it before performing this operation. For more information about installing the ob_admin tool, see ob_admin overview.
Procedure
Pre-cleanup check.
Log in to the
systenant of the cluster as therootuser.Below is a connection example. Use your actual environment when connecting to the database.
obclient -h10.xx.xx.xx -P2883 -uroot@sys#obdemo -p***** -AFor more detailed guidance on connecting to the database, see Overview of connection methods (MySQL-compatible mode) and Overview of connection methods (Oracle-compatible mode).
Execute the following statement to confirm that the arbitration service of the cluster has been replaced or removed:
SELECT * FROM oceanbase.DBA_OB_ARBITRATION_SERVICE;The query result after replacing the arbitration service 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 setAccording to the query result, if the
ARBITRATION_SERVICEfield is empty or indicates another arbitration server, and thePREVIOUS_ARBITRATION_SERVICEfield is empty, the arbitration service of the cluster has been replaced or removed and you can clear the residual cluster information. Otherwise, an arbitration member may still be providing services and you may accidentally clear it.
Log in to the machine where the original arbitration service resides and clear the residual cluster information on the arbitration server.
Log in to the machine where the original arbitration service resides.
Go to the directory where the ob_admin tool is installed.
The default installation directory of ob_admin is
/home/admin/oceanbase/bin.cd /home/admin/oceanbase/binExecute the following command to clear the residual cluster information:
./ob_admin -h$ARB_SERVER_IP -p$ARB_SERVER_PORT force_clear_arb_cluster_info $CLUSTER_IDWhere:
$ARB_SERVER_IP: The IP address of the original arbitration service.$ARB_SERVER_PORT: The RPC port number of the original arbitration service. The default value is 2882.$CLUSTER_ID: The cluster ID of the current cluster. You can obtain it by connecting to the database and executing theSHOW PARAMETERS LIKE 'cluster_id';command.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 setAccording to the query result, the
cluster_idof the current cluster is20230625.
Example of clearing residual cluster information:
./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