This topic describes how to create a standby cluster by using SQL commands after you verify the configurations of the primary cluster.
Procedure
Determine the deployment mode of the standby cluster and install the OBServer binary file.
The OBServer version of the standby cluster must be the same as that of the primary cluster.
Start the OBServer of the standby cluster.
The standby cluster must have the same name as that of the primary cluster, but have a unique cluster ID.
Run the following bootstrap command for the standby cluster in the primary cluster:
obclient> ALTER SYSTEM BOOTSTRAP CLUSTER STANDBY server_info_list PRIMARY_CLUSTER_ID primary_cluster_id PRIMARY_ROOTSERVICE_LIST primary_rs_list;The command associates the root server of the standby cluster to the root server of the primary cluster and registers the standby cluster with the primary cluster.
In the
V$OB_STANDBY_STATUSview of the primary cluster, the value ofCLUSTER_STATUSfor the standby cluster isREGISTERED.Run the following command on the primary cluster to add the standby cluster and start data synchronization:
obclient>ALTER SYSTEM ADD CLUSTER standby_cluster_name CLUSTER_ID standby_cluster_id;In the
V$OB_STANDBY_STATUSview of the primary cluster, the value ofCLUSTER_STATUSfor the standby cluster becomesVALID.
Follow-up processing
After the standby cluster is added to the primary cluster, the standby cluster has no disaster recovery capability. You need to continuously monitor the data synchronization status of the standby cluster for further processing.
Monitor the tenant creation of the standby cluster.
After the standby cluster is added to the primary cluster, the standby cluster selects the latest major compaction version as a snapshot to obtain the tenant list and initiate a tenant creation process. Resources must be allocated for creating the tenant. When the primary and standby clusters use a heterogeneous architecture, the process may get stuck and manual processing is required. If the standby cluster has insufficient resources, you can create a custom unit configuration template to ensure successful creation of the tenant. For more information, see Tenant management.
Increase the data copy speed of the standby cluster.
After the tenant is created, the standby cluster copies full data of the latest major compaction version from the primary cluster. Before the data copying is completed, the standby cluster has no disaster recovery capability and does not support failovers. To increase the data copy speed, you can adjust the configuration items of the standby cluster.
Run the following commands to set both
SERVER_DATA_COPY_IN_CONCURRENCYandSERVER_DATA_COPY_OUT_CONCURRENCYto10:obclient> ALTER SYSTEM SET SERVER_DATA_COPY_IN_CONCURRENCY = 10; obclient> ALTER SYSTEM SET SERVER_DATA_COPY_OUT_CONCURRENCY = 10;In the commands:
SERVER_DATA_COPY_IN_CONCURRENCYindicates the maximum number of concurrent tasks for migrating data to a single node. The value ranges from 1 to 1000, and the default value is2. For more information aboutSERVER_DATA_COPY_IN_CONCURRENCY, see server_data_copy_in_concurrency.SERVER_DATA_COPY_OUT_CONCURRENCYindicates the maximum number of concurrent tasks for migrating data out from a single node. The value ranges from 1 to 1000, and the default value is2. For more information aboutSERVER_DATA_COPY_IN_CONCURRENCY, see server_data_copy_out_concurrency.
Modify
DATA_COPY_CONCURRENCY. We recommend that you setDATA_COPY_CONCURRENCYto the value ofNumber of servers×SERVER_DATA_COPY_IN_CONCURRENCY.DATA_COPY_CONCURRENCYindicates the maximum number of concurrent data migration and copying tasks in the system. The value range is [1+∞), and the default value is20. For more information aboutDATA_COPY_CONCURRENCY, see data_copy_concurrency.Sample command:
obclient> ALTER SYSTEM SET DATA_COPY_CONCURRENCY = 30Copying data from the primary cluster occupies the network bandwidth between the primary cluster and the standby cluster. You can modify
SYS_BKGD_NET_PERCENTAGEto limit the network bandwidth for each OBServer in the standby cluster as required.SYS_BKGD_NET_PERCENTAGEspecifies the percentage of network bandwidth available for background system tasks, which ranges from 0 to 100. The default value is60, indicating 60%. For more information aboutSYS_BKGD_NET_PERCENTAGE, see sys_bkgd_net_percentage.obclient>ALTER SYSTEM SET SYS_BKGD_NET_PERCENTAGE = xx;Notice
After the data is copied to the standby cluster, we recommend that you restore this configuration item to the default value, to resume the network bandwidth between the primary cluster and the standby cluster.
Monitor the data synchronization status of the standby cluster. The standby cluster supports failovers after the data copying is completed.
During the copying of full data to the standby cluster, the synchronization progress is displayed as
0to common tenants. You can log on to the standby cluster and view the synchronization progress of each common tenant in theV$OB_CLUSTER_STATSview.In the view:
MIN_SYS_TABLE_SCNindicates the synchronization progress of the system table.MIN_USER_TABLE_SCNindicates the synchronization progress of the user table.
When the synchronization progress is not displayed as
0to a common tenant, the copying of full data in all partitions of the common tenant is completed. When the copying of full data is completed for all common tenants, the value ofCURRENT_SCNin theV$OB_CLUSTERview of the standby cluster is not0. NoticeThe system tenant of the primary cluster is independent of the system tenant of the standby cluster, and the system tenants are not physically synchronized.
MIN_SYS_TABLE_SCNandMIN_USER_TABLE_SCNof a system tenant indicate the latest snapshot versions of the system tenant, rather than the synchronization progress.If the standby cluster has no common tenant, the value of
CURRENT_SCNin theV$OB_CLUSTERview of the standby cluster is always0.
After the copying of full data is completed for all partitions, the system automatically synchronizes REDO logs. You can check the
SYNCHRONIZATION_STATUSfield in theV$OB_STANDBY_STATUSview of the primary cluster to learn of the synchronization status of the standby cluster.obclient> SELECT SYNCHRONIZATION_STATUS FROM V$OB_STANDBY_STATUS WHERE CLUSTER_ID = standby_cluster_id;If the value of
SYNCHRONIZATION_STATUSisOK, the standby cluster has been synchronized with the primary cluster, and the standby cluster supports failovers.Modify the configuration items of the standby cluster.
The configurations of the primary cluster are not automatically synchronized to the standby cluster. You can modify the configuration items of the standby cluster as required. Especially, you can determine whether to apply the configuration modifications of the primary cluster to the standby cluster.
Set the protection mode.
You can modify the protection mode of the standby cluster as required. By default, the protection mode for the first standby cluster created is maximum performance. For more information, see Switch the protection mode.