This topic describes how to quickly deploy OceanBase Database based on your use case, helping you master and successfully use OceanBase Database.
Note
This topic is not suitable for production environments. For information about how to deploy OceanBase Database in a production environment, see Overview of OceanBase Database Community Edition deployment and choose an appropriate deployment method.
Components
obd
OceanBase Deployer, an installation and deployment tool for OceanBase Database, is abbreviated as obd. For more information, see OceanBase Deployer in the official documentation.
ODP
OceanBase Database Proxy, an agent server for OceanBase Database, is abbreviated as ODP (also known as OBProxy). For more information, see OceanBase Database Proxy in the official documentation.
OBAgent
OBAgent is a monitoring and data collection framework for OceanBase Database. It supports both push and pull data collection modes to meet different application scenarios.
Grafana
Grafana is an open-source data visualization tool that can visually display various metrics from data sources to help you better understand the system status and performance metrics. For more information, see the Grafana official website.
Prometheus
Prometheus is an open-source service monitoring system and time series database that provides a generic data model and quick data collection, storage, and query interfaces. For more information, see the Prometheus official website.
Prerequisites
Before you install OceanBase Database, make sure that your software and hardware environment meet the following requirements:
Item |
Description |
|---|---|
| System |
|
| CPU | At least 2 cores, recommended 4 cores or more. |
| Memory | At least 6 GB, recommended 16 GB to 1024 GB. |
| Disk type | SSD |
| Disk space | At least 20 GB. |
| File system | EXT4 or XFS. When the data exceeds 16 TB, use XFS. |
| Port | Make sure that the default ports of the components are not occupied:
|
| all-in-one installation package | The all-in-one installation package must be V4.1.0 or later. |
| Docker | If you deploy OceanBase Database by using Docker, install and start Docker. For more information, see Docker documentation.
NoteOn a MAC computer with an x86 architecture, you can deploy OceanBase Database only by using Docker V4.9.0 or earlier. Click here to download Docker. |
Get started with OceanBase Database
This solution is suitable for quickly setting up a usable OceanBase Database environment on a single machine. The deployed OceanBase Database environment has the basic features of a database and can effectively help you understand OceanBase Database. However, this environment does not have any distributed capabilities or high availability features, so it is not recommended for long-term use.
You can use the following methods to quickly experience OceanBase Database.
Method 1: Use the All in One installation package
Execute the following command to download and install OceanBase All in One. This command will download and install the latest version of OceanBase All in One online.
bash -c "$(curl -s https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/download-center/opensource/oceanbase-all-in-one/installer.sh)"
source ~/.oceanbase-all-in-one/bin/env.sh
obd provides the following two quick deployment commands:
Minimum specification deployment
This command deploys and starts OceanBase Database with the minimum specifications and related components.
obd demoMaximum specification deployment
This command deploys and starts OceanBase Database with the maximum specifications and related components.
obd perfNote
obd provides the maximum specification deployment command (
obd pref) since V3.4.0 and updates the command toobd perfsince V4.0.0.
The above commands are for quick experience. They will directly deploy OceanBase Database, ODP, and monitoring components (OBAgent, Grafana, and Prometheus) using the current account. You can manage OceanBase Database and components using obd commands. For more information about the steps for offline installation of OceanBase All in One and the obd demo/obd perf commands, see the Quick Start and Quick Deployment Commands topics in the Install and Deploy OceanBase Database topic on the official website.
After the obd demo/obd perf commands are executed successfully, the connection methods of the deployed components are output. You can copy and execute the connection string of the oceanbase-ce component to log in to the sys tenant of the cluster as the root user. After you log in to the cluster, you can execute SQL statements to experience the basic features of OceanBase Database. For more information, see Basic SQL operations (MySQL mode).
Method 2: Use the RPM package
Note
- This method depends on the systemctl command. Therefore, you must perform the operations in a non-container environment.
When you install OceanBase Database by using this method, the system must be one of the following:
- Anolis OS 8.X (Linux kernel 4.19 or later)
- CentOS Linux 8.X (Linux kernel 4.19 or later)
- Debian 10, 11, and 12 (Linux kernel 4.19 or later)
- openEuler 22.03 and 24.03 (Linux kernel 5.10.0 or later)
- Ubuntu 18.04, 20.04, and 22.04 (Linux kernel 4.19 or later)
sudo bash -c "$(curl -s https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/download-center/opensource/service/installer.sh)"
The above commands are for quick experience. They will download the latest RPM package online and install it using the root account. You can manage OceanBase Database by using the systemctl command. For more information about the detailed configuration and steps for offline installation, see the Deploy OceanBase Database by using systemd topic on the official website.
After the commands are executed successfully, the connection method of OceanBase Database is output. You can copy and execute the connection string to log in to the sys tenant of the cluster as the root user. After you log in to the cluster, you can execute SQL statements to experience the basic features of OceanBase Database. For more information, see Basic SQL operations (MySQL mode).
Method 3: Use Docker
This solution is suitable for users who use non-Linux operating systems, such as Windows and macOS, and want to deploy and manage OceanBase Database by using containers. This solution has not been verified at scale, so we recommend that you use it with caution.
Note
On a MAC computer with an x86 architecture, you can deploy OceanBase Database only by using Docker V4.9.0 or earlier. Click here to download Docker.
sudo docker run -p 2881:2881 --name obstandalone -e MODE=MINI -d quay.io/oceanbase/oceanbase-ce
The above commands are for quick experience. They will download the latest image online and start OceanBase Database with the minimum specifications. You can manage OceanBase Database by using Docker commands. For more information about the detailed configuration, see the Deploy OceanBase Database in a container topic on the official website.
After OceanBase Database is deployed, execute the following commands to log in to the sys tenant of the cluster as the root user. After you log in to the cluster, you can execute SQL statements to experience the basic features of OceanBase Database. For more information, see Basic SQL operations (MySQL mode).
# Enter the Docker container.
sudo docker exec -it obstandalone bash
# Connect to the cluster. The password is empty by default.
obclient -uroot@sys -h127.0.0.1 -Doceanbase -P2881 -p
References
For more information about the deployment methods and applicable scenarios of OceanBase Database Community Edition, see Overview of OceanBase Database Community Edition deployment.
For more information about how to clean up an old cluster, see Clean up an old cluster.
