Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support the arbitration service.
If you no longer need the arbitration service or the arbitration service fails, you can remove it from the cluster.
Prerequisites
The arbitration service is disabled for all tenants, including the sys tenant. Otherwise, an error occurs when you remove the arbitration service. For more information, see Disable the arbitration service.
Procedure
Log on to the
systenant of the cluster as therootuser.Note that you must specify the corresponding fields in the following sample code based on your actual database configurations.
obclient -h10.xx.xx.xx -P2883 -uroot@sys -p***** -AFor more information about how to connect to a database, see Overview (MySQL mode) or Overview (Oracle 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 server from which the arbitration service is removed.arb_server_port: the remote procedure call (RPC) port for the arbitration service to be removed. By default, Port 2882 is used.
For example:
ALTER SYSTEM REMOVE ARBITRATION SERVICE 'xx.xx.xx.192:2882';If the arbitration service works properly before the removal, the system automatically clears residual cluster information on the original OBServer node where the arbitration service resides. If the arbitration service fails before the removal, the system displays a warning, which indicates that the original OBServer node where the arbitration service resides contains residual cluster information. You can manually clear the residual cluster information by using the ob_admin tool. For more information, see Clear residual cluster information.
Execute the following statement to view the warning:
SHOW WARNINGS;The query result 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) Query the removal history of the arbitration service from the specified
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.30.140.64: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
If you want to use the arbitration service after you remove it, you must redeploy the arbitration service. For more information, see Deploy an OceanBase cluster with two replicas and the arbitration service.
References
For more information about the arbitration service, see the following topics: