Deploy seekdb with obd
This topic explains how to deploy seekdb using obd.
obd stands for OceanBase Deployer. It is OceanBase's installation and deployment tool. It standardizes complex configuration through the command line or a graphical UI, which makes cluster deployment easier. For more about obd, see the obd documentation.
Prerequisites
Before you start, make sure the following are true:
-
The servers where you will deploy seekdb meet the requirements in Prepare servers, and you have applied the settings described under Pre-deployment preparation.
-
You have installed obd V4.3.0 or later, and the machine where obd runs can reach the seekdb hosts over SSH. For installation, see Install obd. Installing the latest version is recommended.
-
The obd mirror repository contains the component packages needed for deployment (seekdb, seekdb-libs), and they must be V1.2.0 or later.
If the obd host can reach the internet, packages are fetched from the remote mirror during deployment. If the obd host cannot reach the internet, download the seekdb package from Download seekdb, run
obd mirror cloneto add it to the local obd mirror, then runobd mirror list localto verify. -
For local deployment on the same machine, the user you use must have passwordless SSH configured. For steps, see Configure passwordless SSH login.
Procedure
The steps below use CentOS Linux 7.9 on x86 as the example environment. Other environments may differ slightly.
Run obd seekdb install to start the interactive flow. You will be prompted for the following.
-
Choose an installation mode
Three modes are supported: Standalone (single-node), Primary (primary), and Standby (standby).
- Standalone mode
- Primary mode
- Standby mode
If you do not change the option, seekdb is installed in standalone mode by default.
obd seekdb install
After the command runs, configure seekdb as shown below:
# Deployment name
Instance name [myseekdb]:
# IP of the host where seekdb will be installed; default is this machine's IP
Server IP [xxx.xxx.xxx.250]:
# OS user for deployment; default is the current user
Username [admin]:
# SSH port; default is 22
SSH port [22]:
# Password for the deployment user; default is empty
# Shown only for non-local deployment; if passwordless SSH is set, press Enter
Password (default empty):
# seekdb installation directory; the user must have read/write access
Seekdb installation directory [/home/admin/myseekdb]:
# Directory for SSTable and other data; the user must have read/write access
Data directory (data_dir, optional) [/data/1]:
# Directory for redo logs; the user must have read/write access
Redo log directory (redo_dir, optional) [/data/log1]:
# seekdb SQL port
MySQL port [2881]:
# seekdb obshell port
OBShell port [2886]:
# Whether to start seekdb on boot; default is off
# Shown only outside containers; enabling requires sudo for the deploy user, or deployment fails
Do you want to enable the Seekdb service to start automatically when the system boots up? (y/yes or n/no) [no]:
Pass --primary to install seekdb in primary mode. You must set the RPC port so RPC is enabled for standby synchronization.
obd seekdb install --primary
After the command runs, configure seekdb as shown below:
# Deployment name
Instance name [myseekdb_primary]:
# IP of the host where seekdb will be installed; default is this machine's IP
Server IP [xxx.xxx.xxx.72]:
# OS user for deployment; default is the current user
Username [admin]:
# SSH port; default is 22
SSH port [22]:
# Password for the deployment user; default is empty
# Shown only for non-local deployment; if passwordless SSH is set, press Enter
Password (default empty):
# seekdb installation directory; the user must have read/write access
Seekdb installation directory [/home/admin/myseekdb_primary]:
# Directory for SSTable and other data; the user must have read/write access
Data directory (data_dir, optional) [/data/1]: /home/admin/data/1
# Directory for redo logs; the user must have read/write access
Redo log directory (redo_dir, optional) [/data/log1]: /home/admin/data/log1
# seekdb SQL port
MySQL port [2881]:
# seekdb RPC port
RPC port [2882]:
# seekdb obshell port
OBShell port [2886]:
# Whether to start seekdb on boot; default is off
# Shown only outside containers; enabling requires sudo for the deploy user, or deployment fails
Do you want to enable the Seekdb service to start automatically when the system boots up? (y/yes or n/no) [no]:
Pass --standby to install seekdb in standby mode. You must configure the primary seekdb.
obd seekdb install --standby
After the command runs, configure seekdb as shown below:
# Deployment name
Instance name [myseekdb_standby]:
# Choose the seekdb primary; if there are multiple, use the arrow keys
┌────────────────────────────┐
│ Select primary cluster │
├────────────────────────────┤
│ ▸ myseekdb_primary │
└────────────────────────────┘
↑↓ move Enter confirm q quit
Connect to primary (xxx.xxx.xxx.72:2881) ok
# If the chosen primary does not have RPC enabled, a WARN appears with options
[WARN] Primary enable_rpc_service is not enabled.
# Use arrow keys: change primary config and restart (Restart now), or exit standby deployment without changes (Exit)
┌─────────────────────────────────────────────────────────────────────────┐
│ Choose action │
├─────────────────────────────────────────────────────────────────────────┤
│ ▸ Restart now (enable in config, then stop and start primary cluster) │
│ ○ Exit (exit without changing config) │
└─────────────────────────────────────────────────────────────────────────┘
↑↓ move Enter confirm q quit
# Confirm restarting the primary; enter y to continue. Any other input repeats the menu
# Restarting the primary may affect running workloads; proceed carefully
Restarting the primary instance may affect the running business. Do you want to restart it? (y/yes or n/no) [no]:
# IP of the host where seekdb will be installed; default is this machine's IP
Server IP [xxx.xxx.xxx.72]:
# OS user for deployment; default is the current user
Username [admin]:
# SSH port; default is 22
SSH port [22]:
# Password for the deployment user; default is empty
# Shown only for non-local deployment; if passwordless SSH is set, press Enter
Password (default empty):
# seekdb installation directory; the user must have read/write access
Seekdb installation directory [/home/admin/myseekdb_standby]:
# Directory for SSTable and other data; the user must have read/write access
Data directory (data_dir, optional) [/data/1]: /home/admin/data/2
# Directory for redo logs; the user must have read/write access
Redo log directory (redo_dir, optional) [/data/log1]: /home/admin/data/log2
# seekdb SQL port
MySQL port [2881]: 3881
# seekdb RPC port
RPC port [2882]: 3882
# seekdb obshell port
OBShell port [2886]: 3886
# Whether to start seekdb on boot; default is off
# Shown only outside containers; enabling requires sudo for the deploy user, or deployment fails
Do you want to enable the Seekdb service to start automatically when the system boots up? (y/yes or n/no) [no]:
-
Choose a deployment mode
┌───────────────────────┐
│ Select mode │
├───────────────────────┤
│ ○ Dev (development) │
│ ▸ Prod (production) ││
└───────────────────────┘
↑↓ move Enter confirm q quitIf you choose
Dev, the tool prints the configuration; after you confirm, deployment starts. If you chooseProd, you set seekdb maximum memory and pick a memory strategy.SeekDB Max Memory (Configurable Range[5, 31], unit: G) [28]:
┌──────────────────────────────────────────────────────────┐
│ Memory strategy │
├──────────────────────────────────────────────────────────┤
│ ▸ Balanced (Reduce memory usage when possible) │
│ ○ Performance (Use more memory to enhance performance) │
└──────────────────────────────────────────────────────────┘
↑↓ move Enter confirm q quit -
Confirm configuration
When the prompts finish, the tool prints a summary. Verify that it is correct. Example:
--- Config summary ---
1. IP = xxx.xxx.xxx.72
2. User = admin
3. home_path = /home/admin/myseekdb_primary
4. data_dir = /data/1
5. redo_dir = /data/log1
6. mysql_port = 2881
7. rpc_port = 2882
8. obshell_port = 2886
9. memory_budget = 15G
10. datafile_maxsize = 147G
11. max_syslog_file_count = 1024
12. log_disk_size = 45G
13. auto_start = False
Confirm config? (y/yes or n/no to modify) [yes]:Enter
yornat the confirmation prompt:ystarts deployment from this configuration;nends the flow without deploying.info- Set
memory_budgetto configure instance memory. When you migrate an older configuration, removememory_limitandmemory_hard_limit. - In primary or standby mode, obd sets
log_disk_sizeto three timesmemory_budget. The value on the confirmation page is the final configuration.
- Set
-
Successful deployment
When deployment succeeds, OBD prints the instance status and connection information. Verify that the reported version matches the one you selected. The following output is from a V1.4.0 deployment:
Start seekdb ok
seekdb program health check ok
Connect to seekdb xxx.xxx.xxx.72:2881 ok
obshell start ok
obshell program health check ok
obshell bootstrap ok
Check RPC TLS status ok
Connect to seekdb xxx.xxx.xxx.72:2881 ok
Wait for seekdb init ok
+---------------------------------+
| seekdb |
+----------------+---------+------+
| ip | version | port |
+----------------+---------+------+
| xxx.xxx.xxx.72 | 1.4.0.0 | 2881 |
+----------------+---------+------+
obclient -hxxx.xxx.xxx.72 -P2881 -uroot -p'' -Doceanbase -A
myseekdb_primary running
Verify the deployment
-
List seekdb instances
Run
obd seekdb list. If you see an entry such asmyseekdb_primarywith statusrunning, seekdb is up.+--------------------------------------------------------------------------------+
| SeekDB Cluster List |
+------------------+-------------------------------------------+-----------------+
| Name | Configuration Path | Status (Cached) |
+------------------+-------------------------------------------+-----------------+
| myseekdb_primary | /home/admin/.obd/cluster/myseekdb_primary | running |
+------------------+-------------------------------------------+-----------------+ -
Show detailed status
[admin@test001 ~]$ obd seekdb display myseekdb_primaryExample output from the same V1.4.0 deployment:
Get local repositories and plugins ok
Open ssh connection ok
Connect to seekdb xxx.xxx.xxx.72:2881 ok
Wait for seekdb init ok
+---------------------------------+
| seekdb |
+----------------+---------+------+
| ip | version | port |
+----------------+---------+------+
| xxx.xxx.xxx.72 | 1.4.0.0 | 2881 |
+----------------+---------+------+
obclient -hxxx.xxx.xxx.72 -P2881 -uroot -p'******' -Doceanbase -A -
Connect to seekdb
Copy the connection string from
obd seekdb displayoutput.obclient -hxxx.xxx.xxx.72 -P2881 -uroot -p'******' -Doceanbase -AExample success output when logging in as
root:Welcome to the OceanBase. Commands end with ; or \g.
Your OceanBase connection id is 3221489761
Server version: 5.7.25
Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
obclient(root@(none))[oceanbase]>
Related operations
Use the following commands to manage seekdb deployed by obd.
-
List seekdb instances
obd seekdb list -
Show seekdb status (example deployment name
myseekdb)obd seekdb display myseekdb -
Change parameters
obd can manage seekdb through the
obd clustercommand group. Open the configuration file with:obd cluster edit-config myseekdbAfter you save and exit, obd prints how to apply changes. Run the command it shows. Example after save:
Search param plugin and load ok
Search param plugin and load ok
Parameter check ok
Save deploy "myseekdb" configuration
Use `obd cluster reload myseekdb` to make changes take effect.Run
obd cluster reload myseekdbto apply the changes. -
Stop a running seekdb instance (example deployment name
myseekdb)obd seekdb stop myseekdb -
Destroy a deployed seekdb instance (example deployment name
myseekdb)obd seekdb destroy myseekdb