Skip to main content
Version: V1.4.1

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 clone to add it to the local obd mirror, then run obd mirror list local to 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​

tip

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.

  1. Choose an installation mode

    Three modes are supported: Standalone (single-node), Primary (primary), and Standby (standby).

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]:
  1. Choose a deployment mode

    ┌───────────────────────┐
    │ Select mode │
    ├───────────────────────┤
    │ ○ Dev (development) │
    │ ▸ Prod (production) ││
    └───────────────────────┘
    ↑↓ move Enter confirm q quit

    If you choose Dev, the tool prints the configuration; after you confirm, deployment starts. If you choose Prod, 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
  2. 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 y or n at the confirmation prompt: y starts deployment from this configuration; n ends the flow without deploying.

    info
    • Set memory_budget to configure instance memory. When you migrate an older configuration, remove memory_limit and memory_hard_limit.
    • In primary or standby mode, obd sets log_disk_size to three times memory_budget. The value on the confirmation page is the final configuration.
  3. 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​

  1. List seekdb instances

    Run obd seekdb list. If you see an entry such as myseekdb_primary with status running, seekdb is up.

    +--------------------------------------------------------------------------------+
    | SeekDB Cluster List |
    +------------------+-------------------------------------------+-----------------+
    | Name | Configuration Path | Status (Cached) |
    +------------------+-------------------------------------------+-----------------+
    | myseekdb_primary | /home/admin/.obd/cluster/myseekdb_primary | running |
    +------------------+-------------------------------------------+-----------------+
  2. Show detailed status

    [admin@test001 ~]$ obd seekdb display myseekdb_primary

    Example 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
  3. Connect to seekdb

    Copy the connection string from obd seekdb display output.

    obclient -hxxx.xxx.xxx.72 -P2881 -uroot -p'******' -Doceanbase -A

    Example 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]>

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 cluster command group. Open the configuration file with:

    obd cluster edit-config myseekdb

    After 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 myseekdb to 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