This topic describes how to deploy OCP by using an obd configuration file in an environment based on CentOS Linux 7.9 x86 architecture.
Note
Currently, obd supports only OCP Community Edition V4.2.1 and later and OCP Enterprise Edition V4.3.5 and later.
Prerequisites
You have installed obd on your server. We recommend that you install the latest version. For more information, see Install obd.
The user and server resources for deploying OCP meet the deployment requirements. For more information, see the Installation Planning section in the official documentation of OceanBase Cloud.
The clockdiff command is installed on the server where OCP is to be deployed.
If you are to deploy OCP based on OceanBase Database, ensure that the server where the OBServer node is deployed supports the AVX instruction set (this restriction applies only to servers with the x86 architecture). You can execute the
lscpu | grep Flags | grep avxcommand to check whether the server supports the AVX instruction set.Note
If you use a server with the x86 architecture, the server does not need to support the AVX instruction set when you deploy OceanBase Database of the following versions:
- V4.2.5.6 or later for V4.2.x versions.
- V4.3.5.4 or later for V4.3.x versions.
- V4.4.1.0 or later for V4.4.x versions.
In an offline deployment scenario, if you are to deploy OCP based on OceanBase Database and use an ARM server, check whether the server where the OBServer node is deployed supports the LSE instruction set. You can execute the
lscpu | grep Flags | grep atomicscommand to check whether the server supports the LSE instruction set. If the server does not support the LSE instruction set, download the OceanBase Database installation package with thenonlseparameter and use theobd mirror clonecommand to upload the installation package to the local image library of obd.Note
The OceanBase All in One package does not contain the OceanBase Database installation package with the
nonlseparameter.
Configuration files
obd provides sample configuration files for deploying OCP. You can modify them based on your machine resources.
If you installed obd by directly downloading it, you can view the sample configuration files provided by obd in the
/usr/obd/exampledirectory.If you installed obd by decompressing the all-in-one installation package, you can view the sample configuration files provided by obd in the
~/.oceanbase-all-in-one/obd/usr/obd/exampledirectory.You can also view the sample configuration files provided by obd in its GitHub repository.
The following are the sample configuration files provided by obd for deploying OCP.
Deploy OCP separately: ocp-only-example.yaml
Deploy OCP in a distributed manner with ODP: distributed-with-obproxy-and-ocp-example.yaml
Procedure
Note
OBLOADER supports deploying both the Community Edition and Enterprise Edition of OCP. This topic describes how to deploy the Community Edition of OCP.
Step 1: Obtain the installation package
Download the installation package
Visit OceanBase Download Center and search for OceanBase Cloud Platform. Download the required installation package and upload it to any directory on the obd control machine.
If you cannot find the required version of the installation package on the download center, contact technical support for assistance.
Decompress the installation package
In the directory where the installation package is located, execute the following command to decompress it:
[admin@test001 ~]$ tar -xzf ocp-all-in-one-*.tar.gz(Optional) Uninstall the original obd
If obd is already installed on the machine and it was installed using the All in One package, you can execute the following command to uninstall the current obd.
[admin@test001 ~]$ cd ocp-all-in-one/bin && bash uninstall.shStart the installation program
In the
bindirectory of the ocp-all-in-one installation directory, execute theinstall.shscript to start the obd installation program.[admin@test001 bin]$ bash install.shThis script installs obd and copies all installation packages in the
rpmsdirectory of the installation directory to the local image library of obd, while closing the remote image library. After the execution is successful, the following output will be displayed. You can copy and execute thesource ~/.oceanbase-all-in-one/bin/env.shcommand in the output to apply the environment configuration.add auto set env logic to profile: /home/admin/.bash_profile ######################################################################################### Install Finished ========================================================================================= Setup Environment: source ~/.oceanbase-all-in-one/bin/env.sh Quick Start: obd demo Use Web Service to install: obd web Use Web Service to upgrade: obd web upgrade More Details: obd -h =========================================================================================
Step 2: Deploy OCP
This section describes two methods to deploy OCP: Deploy OCP independently and Deploy OCP with OceanBase Database.
When deploying OCP independently, you need to first create the metadata database and corresponding tenants (
ocp_metaandocp_monitor) for OCP. For detailed operations on creating databases, see Deploy OceanBase Database on a single server or Deploy an OceanBase cluster by using the graphical interface. You can manually create tenants or use obd commands to create tenants. For detailed information on using obd commands to create tenants, see the obd cluster tenant create command in Cluster commands.When deploying OCP with OceanBase Database, you can configure both OceanBase Database and OCP information in the configuration file. When starting OCP, it will start the metadata database of OCP based on the configured OceanBase Database information.
Create a configuration file
Execute the following command to create a configuration file. Here, we use
ocp-only-example.yamlas an example. You can customize the filename as needed.vim ocp-only-example.yamlModify the user information
You can copy the following content and modify it according to your actual scenario.
## Only need to configure when remote login is required user: username: admin # password: your password if need key_file: /home/admin/.ssh/id_rsa # port: your ssh port, default 22 # timeout: ssh connection timeout (second), default 30usernameis the username for logging in to the target machine, and ensure that your username has write permissions to the home directory.passwordandkey_fileare both used for user verification. Typically, you only need to fill in one of them.Notice
After configuring the key path, if your key does not require a password, please comment out or delete
passwordto avoid it being considered as the key password for login, which may cause verification failure.Modify the OCP configuration
You can copy the following content and modify it according to your actual scenario. For the specific meanings of the configuration items, see Configuration file description under Configuration item description.
ocp-server-ce: # version: 4.2.2 # package_hash: 84a65bf0ec004e73b772938696b2b896a0ef2b2f # release: 20240315150922.el7 servers: - 10.10.10.1 global: home_path: /home/admin/ocp soft_dir: /home/admin/ocp/software log_dir: /home/admin/ocp/logs ocp_site_url: http://10.10.10.1:8080 port: 8080 admin_password: ******** memory_size: 4G jdbc_url: jdbc:oceanbase://10.10.10.2:2881/test jdbc_username: root@sys jdbc_password: ******** ocp_meta_tenant: tenant_name: ocp_meta max_cpu: 2.0 memory_size: 4G ocp_meta_username: root ocp_meta_password: ******** ocp_meta_db: meta_database ocp_monitor_tenant: tenant_name: ocp_monitor max_cpu: 2.0 memory_size: 4G ocp_monitor_username: root ocp_monitor_password: ******** ocp_monitor_db: monitor_databaseDeploy OCP
obd cluster deploy ocp -c ocp-only-example.yamlIn the command,
ocpis the cluster name, which you can customize according to your actual needs. After the deployment is successful, the command line will output the corresponding startup command, as follows:ocp deployed Please execute ` obd cluster start ocp ` to start Trace ID: 4e444844-0211-11ef-8e69-00163e0808cc If you want to view detailed obd logs, please run: obd display-trace 4e444844-0211-11ef-8e69-00163e0808ccStart OCP
obd cluster start ocpAfter the startup is successful, the login information of OCP will be output, as follows:
+----------------------------------------------------------+ | ocp-server-ce | +---------------------------+----------+----------+--------+ | url | username | password | status | +---------------------------+----------+----------+--------+ | http://10.10.10.1:8080 | admin | ******** | active | +---------------------------+----------+----------+--------+ ocp running Trace ID: ed5a1f4c-0218-11ef-bda1-00163e0808cc If you want to view detailed obd logs, please run: obd display-trace ed5a1f4c-0218-11ef-bda1-00163e0808cc
Step 1: Create a configuration file
Execute the following command to create a configuration file. Here, we use distributed-ocp.yaml as an example. You can customize the filename as needed.
vim distributed-ocp.yaml
Step 2: Modify the configuration file
Modify the user information
You can copy the following content and modify it based on your actual scenario.
## Only need to configure when remote login is required user: username: admin # password: your password if need key_file: /home/admin/.ssh/id_rsa # port: your ssh port, default 22 # timeout: ssh connection timeout (second), default 30usernameis the username for logging in to the target machine. Make sure that your username has write permissions to the home directory.passwordandkey_fileare both used for user verification. Typically, you only need to fill in one of them.Notice
After specifying the key path, if your key does not require a password, comment out or delete
passwordto prevent it from being mistakenly considered as the key password, which could lead to verification failure.Modify the OceanBase Database configuration
You can copy the following content and modify it based on your actual scenario.
oceanbase-ce: version: 4.3.5.3 # release: 100000242024032211.el7 # package_hash: c4a03c83614f50c99ddb1c37dda858fa5d9b14b7 servers: - name: server1 ip: 10.10.10.1 - name: server2 ip: 10.10.10.2 - name: server3 ip: 10.10.10.3 global: appname: obcluster cluster_id: 1711955629 mysql_port: 2881 rpc_port: 2882 home_path: /home/admin/oceanbase data_dir: /home/admin/oceanbase/data redo_dir: /home/admin/oceanbase/redo obshell_port: 2886 scenario: htap memory_limit: 64G system_memory: 30G log_disk_size: 192G datafile_size: 192GB ocp_meta_tenant: tenant_name: ocp_meta max_cpu: 2.0 memory_size: 4G ocp_meta_username: root ocp_meta_password: ******** ocp_meta_db: meta_database ocp_monitor_tenant: tenant_name: ocp_monitor max_cpu: 2.0 memory_size: 8G ocp_monitor_username: root ocp_monitor_password: ******** ocp_monitor_db: monitor_database proxyro_password: ******** root_password: ******** enable_syslog_recycle: true enable_syslog_wf: false max_syslog_file_count: 4 cpu_count: 20 server1: zone: zone1 server2: zone: zone2 server3: zone: zone3For more information about the configuration items of OceanBase Database, see Configuration Item Description in Configuration File Description. The following table lists the OCP-related configuration items.
Configuration ItemRequiredDefault ValueEffective After ModificationDescriptionocp_meta_tenant Required tenant_name: meta_tenant
max_cpu: 1
memory_size: 2147483648Redeployment The information about the OCP metadata tenant. - tenant_name: the name of the OCP metadata tenant.
- max_cpu: the maximum number of CPU cores allocated to the OCP metadata tenant.
- memory_size: the size of memory allocated to the OCP metadata tenant.
ocp_meta_username Optional meta Restart the process The username for connecting to the OCP metadata tenant. ocp_meta_password Required A random string by default Restart the process The password corresponding to the username specified by ocp_meta_username.ocp_meta_db Optional meta_database Redeployment The name of the database where the OCP metadata is stored. ocp_monitor_tenant Required tenant_name: monitor_tenant
max_cpu: 1
memory_size: 2147483648Redeployment The information about the OCP monitoring data tenant. - tenant_name: the name of the OCP monitoring data tenant.
- max_cpu: the maximum number of CPU cores allocated to the OCP monitoring data tenant.
- memory_size: the size of memory allocated to the OCP monitoring data tenant.
ocp_monitor_username Optional monitor_user Restart the process The username for connecting to the OCP monitoring data tenant. ocp_monitor_password Required A random string by default Restart the process The password corresponding to the username specified by ocp_monitor_username.ocp_monitor_db Optional monitor_database Redeployment The name of the database where the OCP monitoring data is stored. Modify the ODP configuration
You can copy the following content and modify it based on your actual scenario. For more information about the configuration items, see Configuration Item Description in Configuration File Description.
obproxy-ce: # version: 4.2.3.0 # package_hash: 7ca6c000887b90db111093180e6984bf4cf8f7380a948870f3eb2ac30be38f37 # release: 3.el7 depends: - oceanbase-ce servers: - 10.10.10.1 global: home_path: /home/admin/obproxy prometheus_listen_port: 2884 listen_port: 2883 obproxy_sys_password: ******** skip_proxy_sys_private_check: true enable_strict_kernel_release: false enable_cluster_checkout: false proxy_id: 5150 client_session_id_version: 2Modify the OCP configuration
You can copy the following content and modify it based on your actual scenario. For more information about the configuration items, see Configuration Item Description in Configuration File Description.
Notice
When you deploy OCP based on OceanBase Database, obd will obtain the information about the OCP metadata database from the configuration items under the OceanBase Database component. In this case, the configuration items
jdbc_xxxwill report an error.ocp-server-ce: # version: 4.2.2 # package_hash: 84a65bf0ec004e73b772938696b2b896a0ef2b2f # release: 20240315150922.el7 depends: - oceanbase-ce - obproxy-ce servers: - 10.10.10.1 global: home_path: /home/admin/ocp soft_dir: /home/admin/ocp/software log_dir: /home/admin/ocp/logs ocp_site_url: http://10.10.10.1:8080 port: 8080 admin_password: ******** memory_size: 8G
Step 3: Deploy OCP
Deploy OCP
obd cluster deploy ocp -c distributed-ocp.yamlIn the command,
ocpis the cluster name, which you can customize based on your actual scenario. After the deployment is successful, the command line will output the corresponding startup command, as shown below:ocp deployed Please execute ` obd cluster start ocp ` to start Trace ID: 990e7dba-0223-11ef-ab25-00163e0808cc If you want to view detailed obd logs, please run: obd display-trace 990e7dba-0223-11ef-ab25-00163e0808ccStart OCP
obd cluster start ocpAfter the startup is successful, the cluster information will be output, as shown below:
+-------------------------------------------------+ | oceanbase-ce | +---------------+---------+------+-------+--------+ | ip | version | port | zone | status | +---------------+---------+------+-------+--------+ | 10.10.10.1 | 4.3.5.3 | 2881 | zone1 | ACTIVE | | 10.10.10.2 | 4.3.5.3 | 2881 | zone2 | ACTIVE | | 10.10.10.3 | 4.3.5.3 | 2881 | zone3 | ACTIVE | +---------------+---------+------+-------+--------+ obclient -h10.10.10.1 -P2881 -uroot -p'********' -Doceanbase -A +-------------------------------------------------+ | obproxy-ce | +---------------+------+-----------------+--------+ | ip | port | prometheus_port | status | +---------------+------+-----------------+--------+ | 10.10.10.1 | 2883 | 2884 | active | +---------------+------+-----------------+--------+ obclient -h10.10.10.1 -P2883 -uroot@proxysys -p'********' -Doceanbase -A +----------------------------------------------------------+ | ocp-server-ce | +---------------------------+----------+----------+--------+ | url | username | password | status | +---------------------------+----------+----------+--------+ | http://10.10.10.1:8080 | admin | ******** | active | +---------------------------+----------+----------+--------+ ocp running
References
- After you deploy a cluster by using obd, you can manage the cluster by using obd commands, such as restart, reload, stop, and destroy. For more information about the obd commands, see Cluster commands.
- For information about how to upgrade OceanBase Cloud, see Upgrade OceanBase Cloud.
