Prerequisites
You have installed and configured a Java environment later than version 1.8.0_161 in the
/usr/bindirectory. For more information, see the How do I configure the Java environment before I deploy OCP Express? section in the FAQ topic.You have installed the
clockdiffcommand.Your account has the privilege to run the
sudocommand without a password.
Note
This topic assumes that the server mentioned in this topic can connect to the Internet or the required software programs such as OceanBase Database, OceanBase Database Proxy (ODP), and OceanBase Cloud Platform (OCP) are installed on the server. For more information about how to configure the required software, see the Configure obd section in the Install and configure obd topic.
Configuration files
OceanBase Deployer (obd) provides sample configuration files for deploying OCP. You can modify the files based on your server resources.
If obd is directly downloaded and installed on your server, you can view the sample configuration files in the
/usr/obd/exampledirectory.If you have installed obd by using the all-in-one installation package, you can view the sample configuration files in the
~/.oceanbase-all-in-one/obd/usr/obd/exampledirectory.You can also view the sample configuration files provided by obd on GitHub.
obd provides the following sample configuration files for deploying OCP:
Sample configuration file for deploying OCP separately:
ocp-only-example.yamlSample configuration file for distributed deployment of ODP and OCP:
distributed-with-obproxy-and-ocp-example.yaml
Deploy OCP separately
Note
When you deploy OCP separately, you must create MetaDB and corresponding tenants (ocp_meta and ocp_monitor) for OCP.
- For more information, see Deploy OceanBase Database on a single OBServer node or Deploy an OceanBase cluster on the GUI of obd.
- You can create a tenant manually or by using an obd command as needed. For more information about how to manually create a tenant, see Create a tenant. For more information about how to create a tenant by using an obd command, see obd cluster tenant create in Cluster commands.
Create a configuration file.
Run the following command to create a configuration file named
ocp-only-example.yaml. You can also specify a custom file name.vim ocp-only-example.yamlModify user information.
Copy and paste the following content to the file and modify the parameters as needed.
## 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 30usernamespecifies the username of the account used to log on to the target server. Make sure that this account has the write privilege on the home directory.passwordandkey_fileare used for user verification. Generally, you need to specify only one of them.Notice
After you specify the path of the key, comment out or delete the
passwordfield if your key does not require a password. Otherwise, the value of thepasswordparameter will be taken as the password of the key and used for logon, leading to a logon verification failure.Modify OCP configurations.
Copy and paste the following content to the file and modify the parameters as needed. For more information about the parameters, see the Parameters section in the Description of the configuration file topic.
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/software log_dir: /home/admin/logs ocp_site_url: http://10.10.10.1:8080 port: 8080 admin_password: ******** memory_size: 4G manage_info: machine: 10 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.yamlocpspecifies the cluster name. You can use a custom name as needed. After OCP is deployed, the command returns a start command: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 OCP is started, the command returns the logon information of OCP:
+----------------------------------------------------------+ | 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
Deploy OCP based on OceanBase Database
Step 1: Create a configuration file
Run the following command to create a configuration file named distributed-ocp.yaml. You can also specify a custom file name.
vim distributed-ocp.yaml
Step 2: Modify the configuration file
Modify user information.
Copy and paste the following content to the file and modify the parameters as needed.
## 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 30usernamespecifies the username of the account used to log on to the target server. Make sure that this account has the write privilege on the home directory.passwordandkey_fileare used for user verification. Generally, you need to specify only one of them.Notice
After you specify the path of the key, comment out or delete the
passwordfield if your key does not require a password. Otherwise, the value of thepasswordparameter will be taken as the password of the key and used for logon, leading to a logon verification failure.Modify OceanBase Database configurations.
Copy and paste the following content to the file and modify the parameters as needed.
oceanbase-ce: version: 4.3.0.1 # 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 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: ******** ocp_meta_tenant_log_disk_size: 6656M 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 information about the parameters of OceanBase Database, see the Parameters section in the Description of the configuration file topic. The following table describes the parameters related to OCP.
Parameter Required? Default value Effective mode of modification Description ocp_meta_tenant Yes tenant_name: meta_tenantmax_cpu: 1memory_size: 2147483648 Redeployment The information about the OCP meta tenant. tenant_name: the name of the tenant.max_cpu: the maximum number of CPU cores for OCP MetaDB.memory_size: the size of memory for OCP MetaDB.
ocp_meta_username No meta Process restart The username for connecting to the OCP meta tenant. ocp_meta_password Yes oceanbase Process restart The password corresponding to the username specified by ocp_meta_username.ocp_meta_db No meta_database Redeployment The database name of OCP MetaDB. ocp_monitor_tenant Yes tenant_name: monitor_tenantmax_cpu: 1memory_size: 2147483648 Redeployment The information about the OCP monitor tenant. tenant_name: the name of the tenant. When OCP is deployed separately, you must confirm that the specified tenant has been created.max_cpu: the maximum number of CPU cores for OCP MonitorDB.memory_size: the size of memory for OCP MonitorDB.
ocp_monitor_username No monitor_user Process restart The username for connecting to the OCP monitor tenant. ocp_monitor_password Yes oceanbase Process restart The password corresponding to the username specified by ocp_monitor_username.ocp_monitor_db No monitor_database Redeployment The database name of OCP MonitorDB. ocp_meta_tenant_log_disk_size No 2048M Redeployment The size of the log disk for tenants in OCP MetaDB. Modify ODP configurations.
Copy and paste the following content to the file and modify the parameters as needed. For more information about the parameters, see the Parameters section in the Description of the configuration file topic.
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 OCP configurations.
Copy and paste the following content to the file and modify the parameters as needed. For more information about the parameters, see the Parameters section in the Description of the configuration file topic.
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/software log_dir: /home/admin/logs ocp_site_url: http://10.10.10.1:8080 port: 8080 admin_password: ******** memory_size: 8G manage_info: machine: 10
Step 3: Deploy OCP
Deploy OCP.
obd cluster deploy ocp -c ocp-only-example.yamlocpspecifies the cluster name. You can use a custom name as needed. After OCP is deployed, the command returns a start command: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 OCP is started, the command returns cluster information:
+-------------------------------------------------+ | observer | +---------------+---------+------+-------+--------+ | ip | version | port | zone | status | +---------------+---------+------+-------+--------+ | 10.10.10.1 | 4.3.0.1 | 2881 | zone1 | ACTIVE | | 10.10.10.2 | 4.3.0.1 | 2881 | zone2 | ACTIVE | | 10.10.10.3 | 4.3.0.1 | 2881 | zone3 | ACTIVE | +---------------+---------+------+-------+--------+ obclient -h10.10.10.1 -P2881 -uroot -p'********' -Doceanbase -A +-------------------------------------------------+ | obproxy | +---------------+------+-----------------+--------+ | 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 restart/reload, stop, or destroy the cluster by using obd. For more information, see Cluster commands.
For more information about how to use OCP after OCP is deployed, see OCP documentation.