You can deploy OceanBase Database on a physical server or VM with the x86_64 or ARM_64 architecture. You can deploy a single-replica OceanBase cluster and add nodes to the cluster. This topic describes how to install a single-replica OceanBase cluster on a regular physical server by using RPM packages.
For more information about deploying an OceanBase cluster, see Deployment introduction.
Prepare the server and media
Requirements on the server architecture and version of Linux operating systems
The following table describes the Linux operating systems that support OceanBase Database.
Linux operating system Version Server architecture AliOS 7.2 and later x86_64 (including Hygon) and ARM_64 (only Kunpeng and Phytium) CentOS / Red Hat Enterprise Linux 7.2 and later x86_64 (including Hygon) and ARM_64 (only Kunpeng and Phytium) SUSE Enterprise Linux 12SP3 and later x86_64 (including Hygon) and ARM_64 (only Kunpeng and Phytium) Debian / Ubuntu 8.3 and later x86_64 (including Hygon) and ARM_64 (only Kunpeng and Phytium) KylinOS V10 x86_64 (including Hygon) and ARM_64 (only Kunpeng and Phytium) Server configurations
At least 4 CPU cores and 16 GB of memory.
Installation package
Prepare the RPM packages of OceanBase Antman Edition (the standalone edition), OceanBase Database V4.0, and OceanBase Client (OBClient).
File name Version Description t-oceanbase-*.rpm The latest version Provides the standard operating system configuration capability for OBServers. Contact OceanBase Technical Support to obtain the latest installation package of the Antman edition. oceanbase-*.rpm 4.0.0.0 The RPM file of OceanBase Database used to deploy the OceanBase cluster. obclient-*.rpm 1.2.6 The RPM file of OBClient. OBClient is required for connecting to Oracle instances. Note
To download the installation package, go to the official website of OceanBase Database, and then click Download in the upper-right corner of the homepage to go to the Software Center page.
Disk planning
By default,
/data/1is used as the data directory,/data/log1as the log directory, and/homeas the installation directory of OceanBase Database.
Procedure
Copy the RPM packages of OceanBase Antman Edition, OceanBase Database V4.0, and OBClient to the server where OceanBase Database V4.0 is to be installed.
Install OceanBase Antman Edition.
Log on to the server as the root user and run the following command to install OceanBase Antman Edition:
[root@hostname /]# rpm -ivh t-oceanbase-antman-x.x.x-xxxxxxxxxxxx.alios7.x86_64.rpmFor more information about how to install OceanBase Antman Edition, see Install OAT-CLI.
Add the admin user.
The observer process runs under the admin user. The owner of the related directories must be the admin user.
[root@hostname /]# cd /root/t-oceanbase-antman/clonescripts [root@hostname clonescripts]# ./clone.sh -uNote
If the admin user group and admin user already exist but the GID or UID is not 500, we recommend that you delete the admin user group and admin user and create them again by using the preceding script.
Modify the kernel configurations of the operating system.
Run the following commands to configure each OBServer:
[root@hostname /]# cd /root/t-oceanbase-antman/clonescripts [root@hostname clonescripts]# ./clone.sh -c -r obInstall dependencies.
Run the following commands on each OBServer to install the dependencies:
[root@hostname /]# cd /root/t-oceanbase-antman/clonescripts [root@hostname clonescripts]# ./clone.sh -m -r obInstall the RPM package of OceanBase Database.
Example:
[root@hostname /]# rpm -ivh oceanbase-4.0.0.0-100000152022092610.el7.x86_64.rpm Preparing... ################################# [100%] Updating / installing... 1:oceanbase-4.0.0.0-100000152022092################################# [100%]Install OBClient.
OBClient is a CLI client of OceanBase Database. You can use it to access MySQL and Oracle tenants of OceanBase Database.
Example:
[root@hostname /]# rpm -ivh obclient-1.2.6-20210510164331.el7.alios7.x86_64.rpm Preparing... ################################# [100%] Updating / installing... 1:obclient-1.2.6-20210510164331.el7################################# [100%]Run the following command to check whether OBClient is successfully installed:
[root@hostname /]# which obclient /usr/bin/obclientInitialize the directories of OceanBase Database.
We recommend that you specify the data directory of OceanBase Database to an independent disk and link this directory to the home directory of OceanBase Database by using a soft link.
$cluster_nameindicates the cluster name.Switch to the admin user.
[root@hostname /]# su - adminInitialize the directories of OceanBase Database.
-bash-4.2$ mkdir -p /data/1/$cluster_name/{etc3,sort_dir,sstable,slog} -bash-4.2$ mkdir -p /data/log1/$cluster_name/{clog,etc2,ilog,oob_clog} -bash-4.2$ mkdir -p /home/admin/oceanbase/store/$cluster_name -bash-4.2$ for t in {etc3,sort_dir,sstable,slog};do ln -s /data/1/$cluster_name/$t /home/admin/oceanbase/store/$cluster_name/$t; done -bash-4.2$ for t in {clog,etc2,ilog,oob_clog};do ln -s /data/log1/$cluster_name/$t /home/admin/oceanbase/store/$cluster_name/$t; doneIn the following sample code, the cluster name is
obdemo.-bash-4.2$ mkdir -p /data/1/obdemo/{etc3,sort_dir,sstable,slog} -bash-4.2$ mkdir -p /data/log1/obdemo/{clog,etc2,ilog,oob_clog} -bash-4.2$ mkdir -p /home/admin/oceanbase/store/obdemo -bash-4.2$ for t in {etc3,sort_dir,sstable,slog};do ln -s /data/1/obdemo/$t /home/admin/oceanbase/store/obdemo/$t; done -bash-4.2$ for t in {clog,etc2,ilog,oob_clog};do ln -s /data/log1/obdemo/$t /home/admin/oceanbase/store/obdemo/$t; doneStart the observer process.
Examples:
Note
The IP address in the sample code is for reference only. You must enter the actual IP address of your server during deployment.
Switch to the admin user.
[root@hostname /]# su - adminStart the observer process.
-bash-4.2$ cd /home/admin/oceanbase && /home/admin/oceanbase/bin/observer -i eth0 -P 2882 -p 2881 -z zone1 -d /home/admin/oceanbase/store/obdemo -r '10.10.10.1:2882:2881' -c 10001 -n obdemo -o "system_memory=16G,datafile_size=100G,config_additional_dir=/data/1/obdemo/etc3;/data/log1/obdemo/etc2" -bash-4.2$ sleep 5 -bash-4.2$ ps -ef|grep observerPerform the bootstrap operation on the cluster.
Note
- The IP address in the sample code is for reference only. You must enter the actual IP address of your server during deployment.
- Run the following OBClient command to connect to the started observer process. The password is empty.
[root@hostname /]# obclient -h127.0.0.1 -uroot@sys -P2881 -p
Enter password:
obclient> SET SESSION ob_query_timeout=1000000000;
Query OK, 0 rows affected
obclient> ALTER SYSTEM BOOTSTRAP ZONE 'zone1' SERVER '10.10.10.1:2882';
Query OK, 0 rows affected
- Verify whether the cluster is successfully initialized.
After you perform the bootstrap operation, run the SHOW DATABASES; command. If oceanbase appears in the database list, the cluster is successfully initialized.
obclient> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| oceanbase |
| information_schema |
| mysql |
| SYS |
| LBACSYS |
| ORAAUDITOR |
| test |
+--------------------+
7 rows in set
Create a user tenant
After you deploy an OceanBase cluster, the sys tenant is automatically created in the database by default. Then, you can create user tenants in the sys tenant as needed.
For more information about how to create a user tenant, see Create a tenant.
Connect to OceanBase Database
We recommend that you connect to OceanBase Database from OBClient or OceanBase Developer Center (ODC).
For more information about how to use OBClient to connect to OceanBase Database, see Connect to an OceanBase tenant by using OBClient.
For more information about how to connect to OceanBase Database by using ODC, see Connect to an OceanBase Database tenant by using ODC.
For more information about connecting to OceanBase Database, see Overview.