Purpose
You can use this statement to bootstrap OceanBase clusters.
This statement is required only when OceanBase Database is started for the first time. This statement can be executed only once on each cluster. If the statement fails, you need to re-create an OceanBase cluster to execute the statement again.
Before you execute this statement, make sure that all the specified OBServer nodes have been started properly.
Syntax
alter_system_bootstrap_stmt_primary:
ALTER SYSTEM BOOTSTRAP [CLUSTER PRIMARY] region_zone_server_list;
alter_system_bootstrap_stmt_standby:
ALTER SYSTEM BOOTSTRAP CLUSTER STANDBY region_zone_server_list primary_cluster_id primary_rootservice_list;
region_zone_server_list:
region_zone_server [, region_zone_server ...]
primary_cluster_id:
PRIMARY_CLUSTER_ID [=] cluster_id
primary_rootservice_list:
PRIMARY_ROOTSERVICE_LIST server_list;
region_zone_server:
[region] zone server
region:
REGION [=] region_name
zone:
ZONE [=] zone_name
server:
SERVER [=] ip_port
ip_port:
'STR_VALUE:INT_VALUE'
Parameters
| Parameter | Description |
|---|---|
| PRIMARY | STANDBY | The primary and standby clusters. The primary and standby clusters must be specified at system startup. Otherwise, the system boots from the primary cluster by default. |
| primary_cluster_id | To bootstrap a standby cluster, you need to specify the cluster_id of the primary cluster. |
| primary_rootservice_list | To bootstrap a standby cluster, you need to specify the RootService list of the primary cluster. |
| region | The region where RootService is deployed. The region is specified during multi-region multi-IDC deployment. |
| zone | The zone to which the server that runs RootService belongs. |
| ip | The IP address of the server that runs RootService. |
| port | The port number of the server that runs RootService. |
Examples
Specify a RootService list for system bootstrap.
obclient> ALTER SYSTEM BOOTSTRAP ZONE 'xxxx1' SERVER 'xxx.xxx.xx.xx1:xxxx';If the RootService list contains more than one OBServer node, use commas (,) to separate them.
obclient> ALTER SYSTEM BOOTSTRAP ZONE 'xxxx1' SERVER 'xxx.xxx.xx.xx1:xxxx', ZONE 'xxxx2' SERVER 'xxx.xxx.xx.xx2:xxxx', ZONE 'xxxx3' SERVER 'xxx.xxx.xx.xx3:xxxx';Notice
The preceding SQL statement cannot be split into multiple statements.
Bootstrap a standby cluster.
obclient> ALTER SYSTEM BOOTSTRAP CLUSTER STANDBY ZONE 'xxxx1' SERVER 'xxx.xxx.xx.xx4:2882' PRIMARY_CLUSTER_ID 1 PRIMARY_ROOTSERVICE_LIST 'xxx.xxx.xx.xx1:2882';