Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support the arbitration service.
When you no longer need the arbitration service or when the arbitration service fails, you can remove the arbitration service from the cluster.
Prerequisites
Before removing the arbitration service, confirm that the arbitration service is disabled for all tenants (including the sys tenant). If any tenant has not disabled the arbitration service, the remove operation will fail. For more information about disabling the arbitration service, see Disable the arbitration service.
Procedure
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 remove the arbitration service.
ALTER SYSTEM REMOVE ARBITRATION SERVICE 'arb_server_ip:arb_server_port';The parameters are described as follows:
arb_server_ip: The IP address of the arbitration service to be removed.arb_server_port: The RPC port of the arbitration service to be removed. The default value is 2882.
Example:
ALTER SYSTEM REMOVE ARBITRATION SERVICE 'xx.xx.xx.192:2882';After the remove command is executed successfully, if the arbitration service was in normal state before removal, the system automatically clears residual cluster information on the arbitration server. If the arbitration service was in faulty state before removal, the system displays a warning message, indicating that after the arbitration service is successfully removed, the original arbitration server still contains residual cluster information and you need to choose whether to manually clear the residual information by using the ob_admin tool. For more information about clearing residual cluster information, see Clear residual cluster information.
Execute the following statement to view the warning message:
SHOW WARNINGS;The warning message is as follows:
+---------+-------+--------------------------------------------------------------------------------------------------------------------------+ | Level | Code | Message | +---------+-------+--------------------------------------------------------------------------------------------------------------------------+ | Warning | 4757 | Cluster info may remain on arbitration server 'xx.xx.xx.192:2882', please make sure whether to use ob_admin to clean it. | +---------+-------+--------------------------------------------------------------------------------------------------------------------------+ 1 rows in set(Optional) After the arbitration service is successfully removed, you can query the removal history of the arbitration service by specifying the
modulein theDBA_OB_ROOTSERVICE_EVENT_HISTORYview.The syntax is as follows:
SELECT * FROM oceanbase.DBA_OB_ROOTSERVICE_EVENT_HISTORY WHERE module LIKE "%arb_service%";The query result is as follows:
+----------------------------+-------------+-----------------------------------+-------+--------+-------+--------------------------------------------------------------------------------------------------+-------+--------+-------+--------+-------+--------+-------+--------+------------+----------------+-------------+ | TIMESTAMP | MODULE | EVENT | NAME1 | VALUE1 | NAME2 | VALUE2 | NAME3 | VALUE3 | NAME4 | VALUE4 | NAME5 | VALUE5 | NAME6 | VALUE6 | EXTRA_INFO | RS_SVR_IP | RS_SVR_PORT | +----------------------------+-------------+-----------------------------------+-------+--------+-------+--------------------------------------------------------------------------------------------------+-------+--------+-------+--------+-------+--------+-------+--------+------------+----------------+-------------+ | 2023-06-26 19:30:19.245664 | arb_service | admin_add_arbitration_service | ret | 0 | arg | {arbitration_service_:"xx.xx.xx.192:2882"} | | | | | | | | | | xx.xx.xx.194 | 2882 | | 2023-06-30 09:42:35.623655 | arb_service | admin_replace_arbitration_service | ret | 0 | arg | {arbitration_service_:"xx.xx.xx.64:2882", previous_arbitration_service_:"xx.xx.xx.192:2882"} | | | | | | | | | | xx.xx.xx.194 | 2882 | | 2023-06-30 09:51:09.756970 | arb_service | admin_remove_arbitration_service | ret | -4179 | arg | {arbitration_service_:"xx.xx.xx.192:2882"} | | | | | | | | | | xx.xx.xx.194 | 2882 | | 2023-06-30 10:10:48.858650 | arb_service | admin_replace_arbitration_service | ret | 0 | arg | {arbitration_service_:"xx.xx.xx.192:2882", previous_arbitration_service_:"172.xx.xxx.xx:2882"} | | | | | | | | | | xx.xx.xx.194 | 2882 | | 2023-06-30 10:42:32.688523 | arb_service | admin_remove_arbitration_service | ret | -4179 | arg | {arbitration_service_:"xx.xx.xx.192:2882"} | | | | | | | | | | xx.xx.xx.194 | 2882 | | 2023-06-30 10:43:41.913339 | arb_service | admin_remove_arbitration_service | ret | -4179 | arg | {arbitration_service_:"xx.xx.xx.192:2882"} | | | | | | | | | | xx.xx.xx.194 | 2882 | | 2023-06-30 10:44:05.616094 | arb_service | admin_remove_arbitration_service | ret | 0 | arg | {arbitration_service_:"xx.xx.xx.192:2882"} | | | | | | | | | | xx.xx.xx.194 | 2882 | +----------------------------+-------------+-----------------------------------+-------+--------+-------+--------------------------------------------------------------------------------------------------+-------+--------+-------+--------+-------+--------+-------+--------+------------+----------------+-------------+ 7 rows in set
What to do next
After you remove the arbitration service, if you need to use the arbitration service again, you must redeploy it. For the specific operations, see Deploy an OceanBase cluster with two replicas and the arbitration service.
References
For more information about the arbitration service, see the following: