This topic describes how to deploy an OceanBase cluster by using the obd graphical interface based on the CentOS Linux 7.9 image for the x86 architecture.
Background information
OceanBase Database supports GUI deployment of OceanBase Database and related components, such as OBAgent and ODP, since V2.0.0. You can deploy a single cluster by following the configuration instructions on the GUI.
Terminology
OceanBase Database
OceanBase Database is an enterprise-level native distributed database independently developed by Alibaba Group.
OceanBase Database Proxy (ODP)
OceanBase Database Proxy (ODP) is a dedicated proxy server for OceanBase Database. It is also known as OBProxy.
OBAgent
OBAgent is the monitoring and data collection framework of OceanBase Database. It supports two data collection modes: push and pull. This framework can meet different application scenarios.
OceanBase Configserver (obconfigserver)
OceanBase Configserver (obconfigserver) provides metadata registration, storage, and query services for OceanBase Database. For more information, see ob-configserver.
Grafana
Grafana is an open-source data visualization tool that can visualize various metrics from data sources to help you understand the system status and performance metrics more intuitively. For more information, see Grafana official website.
Prometheus
Prometheus is an open-source service monitoring system and time series database. It provides a general data model and fast data collection, storage, and query interfaces. For more information, see Prometheus official website.
Alertmanager
Alertmanager is an open-source alerting manager that processes alerts from monitoring systems such as Prometheus. It provides features such as alert deduplication, grouping, routing, and muting. For more information, see Prometheus official website.
Prerequisites
Before you start, make sure that you meet the following requirements:
Your machine meets the software and hardware requirements.
To deploy only OceanBase Database, you need at least 2 vCPU cores, 6 GB of memory, and 20 GB of disk space. Note that the memory limit refers to the value in the
availablecolumn of the output when you run thefree -gcommand.To deploy OceanBase Database and all components, you need at least 4 vCPU cores, 10 GB of memory, and 25 GB of disk space. We recommend that you use at least 16 GB of memory. Note that the memory limit refers to the value in the
availablecolumn of the output when you run thefree -gcommand.
Note
If your environment has fewer CPU cores, the minimum CPU_Count value set by default by obd is 8. A low CPU core count will negatively impact the performance of OceanBase Database.
Prepare the software
Note
This section describes how to obtain the installation package for OceanBase Database Community Edition. If you plan to deploy OceanBase Database Enterprise Edition, contact Technical Support to obtain the installation package and execute the obd mirror clone command to upload the installation package to the local image repository of obd.
When you use obd to deploy OceanBase Database, you can choose to deploy it online or offline.
Online deployment: The machine where obd is installed must be able to access the Internet. You do not need to preconfigure the installation package. During deployment, obd will fetch the required installation package from the remote image repository.
Offline deployment: You do not need to access the Internet during deployment. You must pre-upload the required installation package to the local image repository of obd. We recommend that you directly download the all-in-one installation package of the required version.
Depending on the deployment method, the software preparation method varies. You can choose the appropriate method based on your actual situation.
Online deployment
When you choose online deployment, you can refer to the commands in this section to install obd on the control machine.
[admin@test001 ~]$ sudo yum install -y yum-utils
[admin@test001 ~]$ sudo yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo
[admin@test001 ~]$ sudo yum install -y ob-deploy
[admin@test001 ~]$ source /etc/profile.d/obd.sh
Offline deployment
When you choose offline deployment, you can refer to the commands in this section to download and install the all-in-one installation package.
You can download the latest all-in-one installation package from OceanBase Software Download Center and copy it to the control machine. Execute the following commands to decompress and install it:
[admin@test001 ~]$ tar -xzf oceanbase-all-in-one-*.tar.gz
[admin@test001 ~]$ cd oceanbase-all-in-one/bin/
[admin@test001 bin]$ ./install.sh
[admin@test001 bin]$ source ~/.oceanbase-all-in-one/bin/env.sh
Deploy an OceanBase cluster
Note
obd supports deploying OceanBase Database Community Edition and OceanBase Database Enterprise Edition. This topic describes how to deploy OceanBase Database Community Edition.
Step 1: Start the graphical interface
Start the graphical interface
Run the
obd webcommand in the command line to start the graphical interface, and click the provided address to access it.[admin@test001 ~]$ obd web start OBD WEB in 0.0.0.0:8680 please open http://10.10.10.1:8680Note
The graphical interface by default uses port 8680. You can use the
obd web -p <PORT>command to specify a port, which must be in the range [1025, 65535].In an Alibaba Cloud or other cloud environment, the program may fail to obtain a public IP address, and instead output an internal IP address. This IP address is not a public IP address, so you need to use the correct IP address to access the graphical interface.
The
obd webcommand is bound to 0.0.0.0. In a multi-network interface deployment, you can access the graphical interface through any accessible IP address.You can use the nohup or screen command to run the
obd webcommand in the background.
(Optional) Place the cursor on the Chinese character in the upper-right corner of the graphical interface and click to switch between Chinese and English interfaces based on the displayed language.
Click Start the Experience in the graphical interface. In the Welcome to OceanBase Deployment Wizard window, select the OceanBase and Companion Tools module and click Install to enter the OceanBase Database deployment interface.
Step 2: Configure deployment
You can configure the cluster name, workload type, and deployment components on the Deployment Configuration page. The content of the Deployment Configuration page is as follows.
Cluster configuration
ModuleDescriptionDeployment Configuration The cluster name is the unique name for the dedicated deployment product of OceanBase Database. By default, it is myoceanbase, but you can customize it as long as it does not conflict with existing deployment names. The cluster name must start with an English letter and end with an English letter or a digit. It can contain English letters, digits, and underscores, and its length must be between 2 and 32 characters. You can run theobd cluster listcommand to view the clusters managed by obd.Deployment Mode You can choose to deploy a distributed database or a single-node database. - A distributed cluster provides financial-grade high availability and smooth scaling capabilities. It is highly compatible with Oracle (only available in the commercial edition) and MySQL modes, making it suitable for core business systems with high data security requirements.
- A single-node cluster requires only one host, making it simple to deploy and ready to use immediately. However, it lacks multi-replica capabilities and scaling capabilities, making it suitable for development and testing environments with lower data security requirements.
Deploy Database Click the dropdown list under Version to select the version of OceanBase Database. Click Learn More after the corresponding component to view the documentation for that component. Workload Type Click the dropdown list under Type to select the workload type of the OceanBase cluster. Different workload types have corresponding descriptions, helping you understand the applicable scenarios for each type. Note
This module is displayed only when the version of the OceanBase Database to be deployed is V4.2.5 or later.
Component selection
By default, only the OBProxy component is selected. You can click the checkbox before the corresponding component under Optional Components to enable or disable the deployment of that component. The component version is fixed to the latest version. Click Learn More after the corresponding component to view the documentation for that component.
Note
The deployment of the Grafana and AlertManager components depends on the OBAgent and Prometheus components, respectively. The deployment of the Prometheus component depends on the OBAgent component. Specifically:
- When you select the Grafana or AlertManager component, the OBAgent and Prometheus components are automatically selected.
- When you deselect the OBAgent component, the Grafana, AlertManager, and Prometheus components are automatically deselected.
After completing the configuration, click Next to proceed to the Node Configuration page.
Step 3: Configure nodes
You can configure the database and component nodes, deploy users, and software installation path in the Node Configuration page. The Node Configuration page is as follows:
Module |
Parameter |
Description |
|---|---|---|
| Database node configuration | Zone name | Configure the zone name in OceanBase Database. You can customize the zone name. The zone name must start with an English letter and end with an English letter or a number. It can contain English letters, numbers, and underscores. The length of the zone name must be between 2 and 32 characters. An OceanBase cluster with multiple zones must have a zone in the same region as the primary zone. You can click + Add Zone or the delete icon after the zone to add or delete a zone. |
| OBServer node | Configure the IP address of the OBServer node in the OceanBase cluster. You can enter multiple IP addresses by pressing the Enter key.
Notice
|
|
| RootServer node | You can select an IP address from the drop-down list in the OBServer node field as the RootServer node of the OceanBase cluster. For an OceanBase cluster with multiple replicas, you must specify a RootServer node for each zone. | |
| Component node configuration | OBProxy node | You can configure multiple nodes. You can select an IP address from the drop-down list in the OBServer node field or enter a new IP address. We recommend that you use an IP address other than 127.0.0.1. You can enter multiple IP addresses by pressing the Enter key. |
| Load balancing management | You can click the expand icon to set up load balancing for business access to the OceanBase cluster. We recommend that you deploy multiple OBProxy nodes and provide a VIP or DNS address to avoid changing the OBProxy access address later. If you do not configure load balancing, the system will use the first IP address configured in the OBProxy node field as the connection string. You can select whether to use a VIP or a DNS (domain name) for access from the drop-down list under Access Method:
Noticeobd does not provide load balancing deployment. If you need to set up load balancing, you must deploy and configure the corresponding load balancer in advance. |
|
| Prometheus node | You can configure multiple nodes. You can select an IP address from the drop-down list in the OBServer node field or enter a new IP address. We recommend that you use an IP address other than 127.0.0.1. You can enter multiple IP addresses by pressing the Enter key. |
|
| Grafana node | You can configure multiple nodes. You can select an IP address from the drop-down list in the OBServer node field or enter a new IP address. We recommend that you use an IP address other than 127.0.0.1. You can enter multiple IP addresses by pressing the Enter key. |
|
| AlertManager node | You can configure only one node. We recommend that you use an IP address other than 127.0.0.1. |
|
| OBConfigServer node | You can configure multiple nodes. You can select an IP address from the drop-down list in the OBServer node field or enter a new IP address. We recommend that you use an IP address other than 127.0.0.1. You can enter multiple IP addresses by pressing the Enter key.
NoteWhen you configure multiple nodes for obconfigserver, you must configure load balancing in advance and click the More button in the Component Configuration section of the Cluster Configuration page to configure |
|
| Deployment connection configuration | Username | Configure the username for deploying the OceanBase cluster. The default username is the startup user of the current process. You can customize the username. The username can contain only English letters, numbers, and dots, and its length must be no more than 20 characters. You must ensure that the selected username exists on all hosts. |
| Password | The login password of the user corresponding to the Username field. If password-free access is configured between nodes, you do not need to enter a password. | |
| SSH port | The default port is 22. You can customize the SSH port. | |
| Software path configuration | Software path | The default path is the home directory of the deployment user. You can customize the path. The path must be an absolute path starting with / and can contain only letters, numbers, and special characters (-_:@/.). After you configure the path, a folder with the same name as the Cluster Name will be created in the corresponding directory. |
After you configure the parameters, click Next to go to the Cluster Configuration page.
Step 4: Configure the cluster
The Configure Cluster page allows you to configure the cluster, including the password of the administrator user (root@sys) of the sys tenant, data and log directories, port and parameter configurations of databases and components, and so on. This section will introduce each configuration item separately.
Cluster configuration
ParameterDescriptionMode You can choose Max Utilization or Min Available. Max Utilization maximizes the utilization of environment resources to ensure the performance and stability of the cluster. We recommend that you choose this mode. Min Available configures the resource parameters required for the cluster to run normally. For more information about the two modes, see Configure the mode. root@sys Password You can click Randomly Generate to let obd generate a random string. You can also set a custom password. When you set a custom password, it must meet the following requirements: - Length: 8 to 32 characters
- At least three of the following four types of characters: digits (0~9), uppercase letters (A~Z), lowercase letters (a~z), and special characters (
~!@#%^&*_-+=|(){}[]:;,.?/)
Data Directory By default, the data directory is set to /data/1. You can set a custom data directory. The data directory must be an absolute path that starts with/and can contain only letters, digits, and special characters (-_:@/.). Ensure that the directory is empty and that the user configured in Node Configuration has read and write permissions on the directory.Log Directory By default, the log directory is set to /data/log1. You can set a custom log directory. The log directory must be an absolute path that starts with/and can contain only letters, digits, and special characters (-_:@/.). Ensure that the directory is empty and that the user configured in Node Configuration has read and write permissions on the directory.SQL Port The port number of the SQL service protocol. By default, it is 2881. You can set a custom port number (1025 to 65535). Ensure that the port is not occupied.RPC Port The port number of the remote access protocol. By default, it is 2882. You can set a custom port number (1025 to 65535). Ensure that the port is not occupied.obshell Port The port number of the OceanBase Database O&M tool. By default, it is 2886. You can set a custom port number (1025 to 65535). Ensure that the port is not occupied.More Configurations You can click the expand icon before More Settings to view and configure the cluster parameters. You can use the automatically assigned values or set custom values for each parameter. Note
You can use the
enable_auto_startparameter in More Configurations to enable or disable the auto-start feature of the observer process. To enable this feature, ensure that the deployment user has sudo privileges and that the deployment environment is not a container environment.Component configuration
ParameterDescriptionGrafana Password The login password for the Grafana administrator account. You can click Randomly Generate so that obd generates a random string, or you can set a custom password. If you set a custom password, it must meet the following requirements: - Length: 8 to 32 characters
- At least 2 characters of each of the following types: digits (0~9), uppercase letters (A~Z), lowercase letters (a~z), and special characters (
~!@#%^&*_-+=|(){}[]:;,.?/`$"<>\)
Prometheus Password The login password for the Prometheus service. You can click Randomly Generate so that obd generates a random string, or you can set a custom password. If you set a custom password, it must meet the following requirements: - Length: 8 to 32 characters
- At least 2 characters of each of the following types: digits (0~9), uppercase letters (A~Z), lowercase letters (a~z), and special characters (
~!@#%^&*_-+=|(){}[]:;,.?/`$"<>\)
AlertManager Password The login password for the Alertmanager service. You can click Randomly Generate so that obd generates a random string, or you can set a custom password. If you set a custom password, it must meet the following requirements: - Length: 8 to 32 characters
- At least 2 characters of each of the following types: digits (0~9), uppercase letters (A~Z), lowercase letters (a~z), and special characters (
~!@#%^&*_-+=|(){}[]:;,.?/`$"<>\)
OBProxy SQL Port The SQL port for ODP. The default value is 2883. You can set a custom value in the range of 1025 to 65535. Make sure that the port is not occupied.OBProxy Exporter Port The Exporter port for OBProxy, which is used by Prometheus to pull monitoring data from OBProxy. The default value is 2884. You can set a custom value in the range of 1025 to 65535. Make sure that the port is not occupied.OBProxy RPC Port The RPC port for OBProxy. The default value is 2885. You can set a custom value in the range of 1025 to 65535. Make sure that the port is not occupied.OBAgent Monitoring Service Port The monitoring service port for OBAgent. The default value is 8088. You can set a custom value in the range of 1025 to 65535. Make sure that the port is not occupied.OBAgent Management Service Port The management service port for OBAgent. The default value is 8089. You can set a custom value in the range of 1025 to 65535. Make sure that the port is not occupied.OBConfigserver Service Port The service port for obconfigserver. The default value is 8080. You can set a custom value in the range of 1025 to 65535. Make sure that the port is not occupied.Prometheus Service Port The service port for Prometheus. The default value is 9090. You can set a custom value in the range of 1025 to 65535. Make sure that the port is not occupied.Grafana Service Port The HTTP port for accessing the Grafana page. The default value is 3000. You can set a custom value in the range of 1025 to 65535. Make sure that the port is not occupied.AlertManager Service Port The HTTP port for accessing the Alertmanager page. The default value is 9093. You can set a custom value in the range of 1025 to 65535. Make sure that the port is not occupied.More Configurations You can click the expand icon before More Settings to view and configure the parameters of the corresponding component. You can use the automatically assigned values or set custom values for each parameter. Note
If you have configured multiple nodes in the OBConfigServer Node section of Node Configuration, you must configure
vip_addressandvip_portin More Configurations. Otherwise, an error will be reported during precheck.
After you complete all configurations, click Next to go to the Configuration Confirmation page.
Step 5: Confirm the configuration
On the Previous page, you can view all the configuration information. If you find any issues, you can click Previous to modify them. After confirming that the configurations are correct, click Precheck to go to the Precheck page. On this page, the system will verify whether your environment and configurations meet all the requirements for deploying an OceanBase cluster.
If you select Deployment Mode as Distributed and the number of configured zones is greater than or equal to 2, the Topology tab will be displayed on the Previous page. You can click this tab to view the cluster topology.
Step 6: Precheck
The Precheck page displays the check results. If any errors occur during the precheck, you can either click Auto Repair for check items that can be automatically repaired or click View More Solutions to jump to the error code documentation and modify the configurations as needed. After all errors are resolved, click Recheck to perform the precheck again.
If the precheck is successful, click Deploy to start deploying the OceanBase cluster.
Step 7: Deploy
Here is the explanation of the parameters:
After the deployment is successful, you can copy the displayed connection string to connect to the corresponding component. In the command-line interface, the connection string will be used to connect to the OceanBase cluster as the root@sys user for OceanBase Database components and as the root@proxysys user for OBProxy components.
You can click the connection strings of the Prometheus, Grafana, AlertManager, and obshell Dashboard components to jump to their login pages. You can log in using the account and password displayed on the deployment page.
Note
In Alibaba Cloud or other cloud environments, the program may fail to obtain the public IP address and instead output the private IP address. This IP address is not a public IP address. You need to use the correct IP address to access the graphical interface.
You can click the expand icon before each component in the Deployment Report to view the deployment log information. After clicking View Details in the component list, you can click the copy icon next to the corresponding command to copy the command. You can then execute the command in the central control machine to view the log location of the component.
Click Copy Information to copy and save all the account and password information of the OceanBase cluster. You can then click Exit to exit the deployment program or click Create Business Tenant to create a business tenant on the graphical interface.
Note
To deploy multiple clusters, you need to click Exit to end the current obd process before you can execute the
obd webcommand to deploy the next cluster.We recommend that you create a business tenant for the OceanBase cluster. The sys tenant is only for managing the cluster. If you use it as a business tenant, it may cause system exceptions.
(Optional) Step 8: Create a business tenant
After the OceanBase cluster is deployed, click Create Business Tenant in the lower-right corner of the deployment success page to enter the business tenant creation process. You can configure the tenant information as described in the following table.
Parameter |
Description |
|---|---|
| Tenant Name | The name of the tenant to be created. The tenant name must meet the following requirements:
|
| Tenant Mode | You can select the MySQL mode or the Oracle mode from the drop-down list.
ApplicabilityOceanBase Database Community Edition does not support creating tenants in Oracle mode. |
| Tenant Root Password | You can click Randomly Generate to let obd generate a random string, or you can set a custom password. If you set a custom password, it must meet the following requirements:
|
| Mode Configuration | You can select Maximum Usage, Minimum Available, or Custom.
|
| Business Load Type | You can select the business load type of the tenant from the drop-down list. When you select a different load type, the applicable scenarios of the load type will be displayed below the drop-down list.
NoteThis parameter is displayed only when the deployed OceanBase Database version is V4.2.5 or later. |
| Character Set | The default value is utf8mb4. You can select other character sets from the drop-down list. |
| Collation | The default value is utf8mb4_general_ci. You can select other collations from the drop-down list. |
| Table Name Case Sensitivity | You can set it to 0, 1, or 2 from the drop-down list.
|
| Time Zone | The default value is (GMT+08:00) China Standard Time. You can select other time zones from the drop-down list. |
| IP Address Whitelist | You can choose to allow access from specific IP addresses or allow access from all IP addresses. When you choose to allow access from specific IP addresses, you can specify the allowed client IP addresses in the Custom IP Address field. You can enter multiple IP addresses by pressing the Enter key or separating them with commas (,). Hover the pointer over View Configuration Instructions to view the configuration instructions for the IP addresses.
NoteWhen you choose to allow access from all IP addresses, set it to |
After the configuration is complete, click Next: Create Business Tenant. The system will create the corresponding tenant. After the tenant is created, the page will display the tenant information, including the tenant name, root user password, and connection string. Click Exit in the lower-left corner to exit the tenant creation process. You can then click Exit on the deployment result page to exit the deployment program, or you can click Create Business Tenant to continue creating the next business tenant.
Related operations
Manage a cluster after deployment
You can run the following commands to manage a cluster deployed by using obd. For more information, see Cluster commands.
# View the list of clusters.
[admin@test001 ~]$ obd cluster list
# View the status of a cluster. The following example displays the status of the cluster named myoceanbase.
[admin@test001 ~]$ obd cluster display myoceanbase
# Stop a running cluster. The following example stops the cluster named myoceanbase.
[admin@test001 ~]$ obd cluster stop myoceanbase
# Destroy a deployed cluster. The following example destroys the cluster named myoceanbase.
[admin@test001 ~]$ obd cluster destroy myoceanbase
Deploy a specific component of a specific version
When you deploy a cluster by using an all-in-one installation package, the package is based on the version of OceanBase Database. If other components in the package have newer versions, you can download the latest versions of these components from OceanBase Download Center, upload them to the local image repository, and obd automatically obtains the latest versions from the local image repository during deployment.
Go to the directory where the component installation package is stored and add the installation package to the local image repository.
[admin@test001 rpm]$ obd mirror clone *.rpmView the list of installation packages in the local image repository.
[admin@test001 rpm]$ obd mirror list local
