Purpose
The ALTER SYSTEM SET SYNC_STANDBY_DEST statement is used to set the downstream standby tenant for strong synchronization.
By default, the protection mode of the primary tenant is set to maximum performance mode. Starting from OceanBase Database V4.4.2 BP1, OceanBase Database V4.4.2 supports the maximum availability mode and maximum protection mode. If you want to set the protection mode of the primary tenant to maximum availability mode or maximum protection mode, you need to set a strong synchronization standby tenant for the primary tenant first.
Limitations and considerations
Starting from OceanBase Database V4.4.2 BP1, OceanBase Database V4.4.2 supports setting the downstream standby tenant for strong synchronization.
When setting the standby tenant to strong synchronization mode, the standby tenant must be a network-based standby tenant.
Only one strong synchronization standby tenant can be set, and multiple strong synchronization standby tenants cannot be set.
The downstream standby tenant for strong synchronization can be set on both the primary and standby tenants. Note that setting the downstream standby tenant for strong synchronization on the standby tenant is usually not meaningful. However, in a switchover scenario, if you want to maintain the strong synchronization relationship between the primary and standby tenants, you can set the downstream standby tenant for strong synchronization on the standby tenant before it is promoted to the primary tenant.
If you only set the downstream standby tenant for strong synchronization without setting the protection mode, the strong synchronization mode will not be enabled.
Privilege requirements
This statement must be executed by the root user of the sys tenant (root@sys) or the administrator of each tenant. Specifically:
- In MySQL mode, the default administrator is the
rootuser. - In Oracle mode, the default administrator is the
SYSuser.
Syntax
ALTER SYSTEM SET SYNC_STANDBY_DEST = 'SERVICE=ip_list NET_TIMEOUT=int_value HEALTH_CHECK_TIME=time USER=user_name@standby_tenant_name PASSWORD=password' [TENANT = tenant_name];
Parameters
Parameter |
Description |
|---|---|
| ip_list | The IP address and SQL port number (default port number is 2881) of the OBServer node where the downstream standby tenant is located. Multiple IP addresses are separated by commas (,). |
| NET_TIMEOUT | The maximum time that the primary tenant waits for the logs of the strong synchronization standby tenant to be synchronized in maximum availability mode. If the synchronization is not completed within the specified time, the primary tenant will automatically downgrade to asynchronous synchronization mode. This parameter is not applicable in other protection modes. The unit is seconds, with a default value of 30 seconds, and the value range is [10, 1200]. |
| HEALTH_CHECK_TIME | The time interval at which the primary tenant checks whether the logs of the standby tenant are synchronized in maximum availability mode. If no standby tenant is synchronized within the specified time, the primary tenant will automatically upgrade to strong synchronization mode. This parameter is not applicable in other protection modes. The unit is seconds, with a default value of 60 seconds, and the value range is [0s, +∞). |
| user_name@standby_tenant_name、password | The login information of the downstream standby tenant:
|
| tenant_name | The name of the tenant to execute the operation.
NoticeOnly the sys tenant needs to specify the tenant name using the |
Examples
Set the downstream standby tenant
standby_tenantfor strong synchronization for the primary tenantmysqlas the sys tenant.obclient(root@sys)[(none)]> ALTER SYSTEM SET SYNC_STANDBY_DEST = 'SERVICE=6.xx.xxx.xxx:2881 NET_TIMEOUT=20 HEALTH_CHECK_TIME=40s USER=rep_user@standby_tenant PASSWORD=xxxxxx' TENANT = mysql;Set the downstream standby tenant
standby_tenantfor strong synchronization for the primary tenant as the primary tenant.obclient> ALTER SYSTEM SET SYNC_STANDBY_DEST = 'SERVICE=6.xx.xxx.xxx:2881 NET_TIMEOUT=20 HEALTH_CHECK_TIME=40s USER=rep_user@standby_tenant PASSWORD=xxxxxx';
