This topic describes how to generate a configuration file when you deploy OCP on a single server.
Single-node deployment
Log on to the server where OCP is to be deployed as the root user, and run the following command to generate a configuration template.
[root@hostname /]# cd /root/t-oceanbase-antman/clonescripts [root@hostname clonescripts]# bash init_obcluster_conf.shDuring mode selection, enter 1 for single-node deployment.
The system generates the corresponding configuration file template.
Example:
## obcluster.conf ## SINGLE_OCP_MODE=TRUE ################################ Modify the configuration based on the actual situation/MUST CHANGE ACCORDING ENVIRONMENT ################################ ############ Enter the IP address and the password of the root or admin user/Edit Machine IP and Password Of root/admin ############ ZONE1_RS_IP=xxx.xxx.xxx.xxx OBSERVER01_ROOTPASS=rootpass OBSERVER01_ADMINPASS=adminpass SSH_PORT=22 ############ Edit the load balancing configuration/Edit Configuration of Load Balance ############ # lb_mode: dns/f5/none, default: dns for 3 ocp, none for 1 ocp lb_mode=none # Other information ... ################## OCP multi-cluster configurations ####################### OCP_MC_ENABLED=FALSE # Specifies whether to enable the multi-cluster mode. Only one OCP cluster is installed each time you run the install.sh command. The value of the cluster_id parameter must be unique. We recommend that you set the cluster_id parameter to a timestamp during each installation. OCP_MC_ID=1 # The ID of an OCP cluster. Set this parameter manually to ensure it is unique for each cluster. OCP_MC_NAME=oc1 # The OCP cluster name. OCP_MC_ROLE=LEADER # The OCP cluster role. Valid values: LEADER and FOLLOWER.Modify the configuration file template based on the comments.
The following information needs to be modified:
You must enter the server IP address and the passwords of the root and admin users. For single-node deployment, you need to specify the information of only one server.
For single-node deployment, set
lb_modeto none, indicating that load balancing is disabled.Allocate resources to the Docker container based on the CPU and memory resources of the server.
You can use the
docker load -i <docker image>command and thedocker imagescommand to obtain the version information of Docker containers of the OCP components, including OBServer, OBProxy, and OCP.Optional. When you deploy OCP clusters in the multi-cluster mode, specify the OCP multi-cluster configurations in the command.
OCP_MC_ENABLED: Specifies whether to enable the multi-cluster mode. Set this parameter to TRUE.
OCP_MC_ID: The ID of an OCP cluster. Set this parameter manually to ensure it is unique for each cluster.
Note
The IDs of leader and follower OCP clusters must be different. Otherwise, the follower OCP cluster cannot be registered with the leader OCP cluster.
* OCP_MC_NAME: The OCP cluster name.
* OCP_MC_ROLE: The OCP cluster role.
Note
When you deploy a leader OCP cluster, set this parameter to LEADER. When you deploy a follower OCP cluster, set this parameter to FOLLOWER.