Deploy seekdb by using yum install
This topic describes how to deploy seekdb by using yum install.
Prerequisites
Before performing the operations in this topic, you need to confirm the following information:
-
Your environment is an RPM platform system. The currently verified supported systems are as follows:
-
Anolis OS 8.X (Linux kernel 4.19 or later)
-
Anolis OS 23.X (Linux kernel 6.6 or later)
-
CentOS Linux 7.X, 9.X (Linux kernel 4.19 or later)
-
Debian 11, 12, and 13 (Linux kernel 4.19 or later)
-
openEuler 22.03 and 24.03 (Linux kernel 5.10.0 or later)
-
Ubuntu 20.04, 22.04, and 24.04 (Linux kernel 4.19 or later)
-
-
The minimum CPU requirement in the current environment is 1 core.
-
The minimum available memory in the current environment is 2 GB.
-
The jq command-line tool is installed in your environment, and systemd is correctly configured as the system and service manager.
-
Database connection tools (MySQL client or OBClient) are installed in your environment.
-
The user you are using has permission to execute sudo commands.
Deploy seekdb
Step 1: Install seekdb
Depending on whether the environment can connect to an external network, there are two installation methods: online installation and offline installation.
Online installation
-
Add the seekdb repository
[admin@test001 ~]$ sudo yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo -
Install seekdb
[admin@test001 ~]$ sudo yum install seekdb obclient
Offline installation
-
You can download the required version of seekdb from the OceanBase Software Download Center. After downloading, copy the installation package to your machine. It is recommended that you use the latest version of the installation package.
-
In the directory where the installation package is located, run the rpm command to install seekdb.
[admin@test001 ~]$ sudo rpm -ivh seekdb-*.rpm
Step 2: Start seekdb
After installing seekdb, you can start seekdb by following these steps.
-
(Optional) Modify the configuration file.
You can modify the configuration file in this step. If not modified, the default configuration in the configuration file will be used for deployment.
[admin@test001 ~]$ sudo vim /etc/oceanbase/seekdb.cnfThe configuration items in this file are as follows:
port=2881
data-dir=/var/lib/oceanbase/store
redo-dir=/var/lib/oceanbase/store/redo
datafile_size=2G
datafile_next=2G
datafile_maxsize=50G
cpu_count=4
memory_limit=2G
log_disk_size=2GThe configuration items in the configuration file are described in the following table:
Configuration item Required Default value Description port Optional 2881 The SQL service protocol port number of seekdb. redo_dir Optional /var/lib/oceanbase/store/redo Directory for clog, ilog, and slog. It is recommended to configure it as an independent disk. Note
The available disk space of the data disk (default:
/var/lib/oceanbase/) should be greater than 15 GB.data_dir Optional /var/lib/oceanbase/store Directory for storing SSTable and other data. It is recommended to configure it as an independent disk. Note
The available disk space of the data disk (default:
/var/lib/oceanbase/) should be greater than 15 GB.datafile_size Optional 2G Specifies the size of data files (block_file). If not configured, the datafile_disk_percentageconfiguration item is used. For details, see datafile_size and datafile_disk_percentage.datafile_next Optional 2G Specifies the growth step size of data files. datafile_maxsize Optional 50G Specifies the maximum size of data files. cpu_count Optional 4 Total number of CPUs that seekdb can use. If set to 0, it will be automatically detected. memory_limit Optional 2G Maximum memory that seekdb can obtain from the environment. log_disk_size Optional 2G Used to set the size of the Redo log disk. If not configured, the log_disk_percentageconfiguration item is used. For details, see log_disk_size and log_disk_percentage. -
Start seekdb.
[admin@test001 ~]$ sudo systemctl start seekdb -
Check the startup status of seekdb.
[admin@test001 ~]$ sudo systemctl status seekdbWhen the status displays
Service is ready, it indicates that seekdb has started successfully.
Step 3: Connect to seekdb
Here, connecting to seekdb through OBClient is used as an example. The command is as follows:
[admin@test001 ~]$ obclient -h<IP> -uroot -P<Port> -p<Passwd> -A oceanbase
Parameter description:
-
-h: Provides the seekdb connection IP. The default IP for seekdb started with systemd is
127.0.0.1. -
-u: Provides the seekdb connection account in the format:
username. The default username for seekdb instances isroot. -
-P: Provides the seekdb connection port, which is the value of
portin/etc/oceanbase/seekdb.cnf. -
-p: Provides the seekdb connection password. The default is empty.
-
-A: Indicates that OBClient does not automatically obtain statistics when connecting to the database.
-
oceanbase: The name of the database to access, which can be changed to a business database name.
Manage seekdb
Currently, only start, stop, and status operations are supported for seekdb through systemd.
Check seekdb status
You can run the following command to check the seekdb status.
[admin@test001 ~]$ sudo systemctl status seekdb
The seekdb status has the following scenarios:
-
Activedisplaysactive (running), andStatusdisplaysseekdb is ready and running, indicating that seekdb has started successfully. -
Activedisplaysinactive (dead), indicating that the service has stopped, that is, seekdb has stopped. -
Activedisplaysfailed, indicating that an error occurred in the service. You need to check the logs for troubleshooting.
Clear seekdb
You can clear seekdb started with systemd by following these steps.
-
Stop seekdb.
[admin@test001 ~]$ sudo systemctl stop seekdb -
Uninstall seekdb.
-
Delete the seekdb database package
For online installation, you can run the following command:
[admin@test001 ~]$ sudo yum erase seekdbpackageneeds to be replaced with the name of the package to be deleted. You can check the package name using theyum list | grep seekdbcommand.For offline installation, you can run the following command:
[admin@test001 ~]$ sudo rpm -e seekdbpackageneeds to be replaced with the name of the package to be deleted. You can check the package name using therpm -qa | grep seekdbcommand. -
Delete seekdb data.
After executing the first step, the return result will display
To clean OceanBase : bash /var/lib/oceanbase/oceanbase_clean.sh. You can use this command to completely delete seekdb.After executing this step to delete seekdb data, your deployed seekdb will be completely uninstalled.
[admin@test001 ~]$ sudo bash /var/lib/oceanbase/oceanbase_clean.sh
-