Initial commit
This commit is contained in:
@@ -0,0 +1,223 @@
|
||||
---
|
||||
|
||||
slug: /prepare-servers
|
||||
---
|
||||
|
||||
# Prepare servers
|
||||
|
||||
This section describes the number and specifications of servers required for deploying seekdb, as well as the software and hardware requirements for servers, including the operating system and BIOS settings.
|
||||
|
||||
## Server configuration requirements
|
||||
|
||||
Servers must meet the minimum configuration requirements shown in the following table.
|
||||
|
||||
| Product | Number of servers | Minimum configuration | Disk type |
|
||||
|---------|-----------|-------------|-------------|
|
||||
| seekdb | 1 | 1 CPU core, 2 GB available memory | SSD storage |
|
||||
|
||||
:::info
|
||||
<ul>
|
||||
<li>The log disk must be at least 1 times the memory size, and the data disk must meet the storage requirements for the target data volume.</li>
|
||||
<li>The resource requirements listed here refer to the resources reserved for seekdb, not the total resources of the server itself.</li>
|
||||
</ul>
|
||||
:::
|
||||
|
||||
## Hardware environment requirements
|
||||
|
||||
### Memory
|
||||
|
||||
Run the following command to check the memory:
|
||||
|
||||
```shell
|
||||
free -g
|
||||
```
|
||||
|
||||
The return result is as follows:
|
||||
|
||||
```shell
|
||||
total used free shared buff/cache available
|
||||
Mem: 174 38 6 0 129 123
|
||||
Swap: 0 0 0
|
||||
```
|
||||
|
||||
Ensure that the available Mem value is sufficient to meet the configuration in the **Server configuration requirements** section above. If it is insufficient, you can try clearing the cache to free up some resources or replace the server.
|
||||
|
||||
Run the following command to clear the cache:
|
||||
|
||||
```shell
|
||||
sudo sysctl -w vm.drop_caches=3
|
||||
# or
|
||||
sudo echo 3 > /proc/sys/vm/drop_caches
|
||||
```
|
||||
|
||||
## Software environment requirements
|
||||
|
||||
### Operating system
|
||||
|
||||
#### seekdb operating system
|
||||
|
||||
seekdb can be installed on the Linux operating systems shown in the following table.
|
||||
|
||||
| Linux operating system | Version | Server architecture |
|
||||
|-------------------------|-----------|-------------------------------|
|
||||
| Rocky Linux | 9 | x86_64 (including Hygon), ARM_64 (Kunpeng, Phytium) |
|
||||
| Alibaba Cloud Linux | 2, 3 | x86_64 (including Hygon), ARM_64 (Kunpeng, Phytium) |
|
||||
| AnolisOS | 8.6 and later | x86_64 (including Hygon), ARM_64 (Kunpeng, Phytium) |
|
||||
| KylinOS | V10 | x86_64 (including Hygon), ARM_64 (Kunpeng, Phytium) |
|
||||
| UOS | V20 | x86_64 (including Hygon), ARM_64 (Kunpeng, Phytium) |
|
||||
| NFSChina | 4.0 and later | x86_64 (including Hygon), ARM_64 (Kunpeng, Phytium) |
|
||||
| Inspur kos | 5.8 | x86_64 (including Hygon), ARM_64 (Kunpeng, Phytium) |
|
||||
| CentOS / Red Hat Enterprise Linux | 7.x, 8.x | x86_64 (including Hygon), ARM_64 (Kunpeng, Phytium) |
|
||||
| SUSE Enterprise Linux | 12SP3 and later | x86_64 (including Hygon) |
|
||||
| Debian | 8.3 and later | x86_64 (including Hygon) |
|
||||
| openEuler | 20.03 LTS SP1/SP2 and 22.10 LTS | x86_64 (including Hygon), ARM_64 (Kunpeng, Phytium) |
|
||||
| LinxOS | V6.0.99, V6.0.100 | x86_64 (including Hygon), ARM_64 (Kunpeng, Phytium) |
|
||||
|
||||
:::info
|
||||
|
||||
The operating system must be configured with network and software manager (yum or zypper repositories).
|
||||
:::
|
||||
|
||||
#### Check the operating system
|
||||
|
||||
##### Red Hat Enterprise Linux Server 7.X
|
||||
|
||||
Run the following command to check the operating system information:
|
||||
|
||||
```shell
|
||||
cat /etc/redhat-release
|
||||
```
|
||||
|
||||
The return result is as follows:
|
||||
|
||||
```shell
|
||||
Red Hat Enterprise Linux Server release 7.2 (Maipo)
|
||||
```
|
||||
|
||||
##### CentOS 7.X
|
||||
|
||||
Run the following command to check the operating system information:
|
||||
|
||||
```shell
|
||||
cat /etc/redhat-release
|
||||
```
|
||||
|
||||
The return result is as follows:
|
||||
|
||||
```shell
|
||||
CentOS Linux release 7.2.1511 (Core)
|
||||
```
|
||||
|
||||
##### Anolis OS 8.X
|
||||
|
||||
Run the following command to check the operating system information:
|
||||
|
||||
```shell
|
||||
cat /etc/os-release
|
||||
```
|
||||
|
||||
The return result is as follows:
|
||||
|
||||
```shell
|
||||
NAME="Anolis OS"
|
||||
VERSION="8.2"
|
||||
ID="anolis"
|
||||
ID_LIKE="rhel fedora centos"
|
||||
VERSION_ID="8.2"
|
||||
PLATFORM_ID="platform:an8"
|
||||
PRETTY_NAME="Anolis OS 8.2"
|
||||
ANSI_COLOR="0;31"
|
||||
HOME_URL="https://openanolis.cn/"
|
||||
```
|
||||
|
||||
##### Ubuntu
|
||||
|
||||
Run the following command to check the operating system information:
|
||||
|
||||
```shell
|
||||
cat /etc/os-release
|
||||
```
|
||||
|
||||
The return result is as follows:
|
||||
|
||||
```shell
|
||||
NAME="Ubuntu"
|
||||
VERSION="20.04.2 LTS (Focal Fossa)"
|
||||
ID=ubuntu
|
||||
ID_LIKE=debian
|
||||
PRETTY_NAME="Ubuntu 20.04.2 LTS"
|
||||
VERSION_ID="20.04"
|
||||
HOME_URL="https://www.ubuntu.com/"
|
||||
SUPPORT_URL="https://help.ubuntu.com/"
|
||||
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
|
||||
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
|
||||
VERSION_CODENAME=focal
|
||||
UBUNTU_CODENAME=focal
|
||||
```
|
||||
|
||||
##### Debian 9
|
||||
|
||||
Run the following command to check the operating system information:
|
||||
|
||||
```shell
|
||||
cat /etc/os-release
|
||||
```
|
||||
|
||||
The return result is as follows:
|
||||
|
||||
```shell
|
||||
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
|
||||
NAME="Debian GNU/Linux"
|
||||
VERSION_ID="9"
|
||||
VERSION="9 (stretch)"
|
||||
VERSION_CODENAME=stretch
|
||||
ID=debian
|
||||
HOME_URL="https://www.debian.org/"
|
||||
SUPPORT_URL="https://www.debian.org/support"
|
||||
BUG_REPORT_URL="https://bugs.debian.org/"
|
||||
```
|
||||
|
||||
#### Check the kernel
|
||||
|
||||
Check the server kernel information to ensure that the operating system is 3.10.0 or later, and select the corresponding deployment package based on the kernel information.
|
||||
|
||||
Run the following command to check the kernel information:
|
||||
|
||||
```shell
|
||||
uname -a
|
||||
```
|
||||
|
||||
### seekdb server BIOS settings
|
||||
|
||||
#### BIOS options to disable
|
||||
|
||||
* Cstate
|
||||
|
||||
* Pstate
|
||||
|
||||
* EIST
|
||||
|
||||
* Power saving
|
||||
|
||||
#### BIOS options to configure
|
||||
|
||||
* Automatic Power on After Power Loss: Always on
|
||||
|
||||
* Intel Virtualization Technology: Enabled
|
||||
|
||||
* Hyper-threading: Enabled
|
||||
|
||||
* Hardware prefetcher: Enabled
|
||||
|
||||
* VT-d: Enabled
|
||||
|
||||
* SR-IOV: Enabled
|
||||
|
||||
* Turbo Mode: Enabled
|
||||
|
||||
* Energy performance: Set to maximum performance
|
||||
|
||||
:::info
|
||||
|
||||
The method for modifying BIOS settings varies by server. For specific operations, refer to the server operation manual.
|
||||
:::
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
|
||||
slug: /deploy-overview
|
||||
---
|
||||
|
||||
# Deployment overview
|
||||
|
||||
seekdb provides two deployment modes. You can choose the appropriate deployment mode based on your business scenario.
|
||||
|
||||
* **Embedded mode**: seekdb runs as a "library" inside your application. It can easily run on various "endpoints", making it suitable for mobile application development, desktop application development, and application development on IoT and edge devices. In this mode, you can connect and manage seekdb through Python scripts or SDKs.
|
||||
|
||||
* **Server mode**: Uses single-machine deployment, suitable for CI/CD and testing. It is simple, has low operational costs, and the server starts quickly. In this mode, you can connect and manage seekdb through MySQL, OBClient, or SDKs.
|
||||
|
||||
## Deployment methods
|
||||
|
||||
Different deployment modes provide various deployment methods that you can choose based on your needs.
|
||||
|
||||
* **Embedded mode**:
|
||||
|
||||
* Deploy seekdb using the pyseekdb SDK provided by seekdb.
|
||||
|
||||
For detailed deployment operations, see [Embedded deployment mode](600.python-seekdb.md).
|
||||
|
||||
* Deploy seekdb using Python.
|
||||
|
||||
For detailed deployment operations, see [Embedded deployment mode](600.python-seekdb.md).
|
||||
|
||||
* **Server mode**:
|
||||
|
||||
* Deploy seekdb using yum install.
|
||||
|
||||
For detailed deployment operations, see [Deploy seekdb using yum install](700.server-mode/100.deploy-by-systemd.md).
|
||||
|
||||
* Deploy seekdb in a container environment.
|
||||
|
||||
For detailed deployment operations, see [Deploy seekdb in a container environment](700.server-mode/200.deploy-by-docker.md).
|
||||
|
||||
* Deploy OceanBase Desktop.
|
||||
|
||||
OceanBase Desktop is a desktop application for managing and operating seekdb. It provides a graphical interface that enables users to easily perform database management, query execution, data import and export, and other operations.
|
||||
|
||||
For detailed deployment operations, see [Deploy OceanBase Desktop](700.server-mode/300.deploy-oceanbase-desktop.md).
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
|
||||
slug: /configurations-overview
|
||||
---
|
||||
|
||||
# Pre-deployment configuration overview
|
||||
|
||||
To ensure that seekdb can be used effectively, you need to configure the operating system and installation environment as follows:
|
||||
|
||||
| Configuration item | Required | Description |
|
||||
| ------ | ------- | ---- |
|
||||
| [Create a user](300.create-regular-user.md) | <ul><li>For personal trial scenarios, you can use the root user.</li><li>For production environments, it is recommended to use a user with sudo privileges.</li></ul> | You can use a regular user with sudo privileges. |
|
||||
| [Plan disks](400.plan-disks.md) | <ul><li>For personal trial scenarios, no configuration is required.</li><li>For production environments, it is recommended to configure.</li></ul> | In production environments, it is recommended to use different disks for the log storage directory and data storage directory to avoid performance issues in high-pressure scenarios when both directories are planned on the same disk. |
|
||||
| [Configure limits.conf](500.configure-limits-conf.md) | <ul><li>For personal trial scenarios, no configuration is required.</li><li>For production environments, configuration is required.</li></ul> | Improves the stability and performance of the cluster during runtime. |
|
||||
| [Configure sysctl.conf](600.configure-sysctl-conf.md) | <ul><li>For personal trial scenarios, no configuration is required.</li><li>For production environments, configuration is required.</li></ul> | Improves Linux system performance, thereby improving seekdb performance. |
|
||||
| [Disable the firewall and SELinux](700.disable-firewall-and-selinux.md) | <ul><li>For personal trial scenarios, no configuration is required.</li><li>For production environments, configuration is required.</li></ul> | Prevents access to the database from being blocked. |
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
|
||||
slug: /create-regular-user
|
||||
---
|
||||
|
||||
# Create a user
|
||||
|
||||
For enterprise users, when deploying seekdb, it is recommended to use the admin user, or you can use other users. However, the user must have sudo privileges and be the owner of database-related directories. This topic describes how to create a regular user and set sudo privileges for the regular user.
|
||||
|
||||
1. Run the following commands to create the user group admin and create the user admin.
|
||||
|
||||
```shell
|
||||
[root@test001 ~]# useradd -U admin -d /home/admin -s /bin/bash
|
||||
[root@test001 ~]# chown -R admin:admin /home/admin
|
||||
```
|
||||
|
||||
2. Run the following command to set a password for the admin account.
|
||||
|
||||
```shell
|
||||
[root@test001 ~]# passwd admin
|
||||
```
|
||||
|
||||
3. Set sudo privileges for the admin account.
|
||||
|
||||
Run the following command to open the `/etc/sudoers` file:
|
||||
|
||||
```shell
|
||||
[root@test001 ~]# vim /etc/sudoers
|
||||
```
|
||||
|
||||
Add the following content at the end of the `/etc/sudoers` file:
|
||||
|
||||
```shell
|
||||
## Same thing without a password
|
||||
# %wheel ALL=(ALL) NOPASSWD: ALL
|
||||
admin ALL=(ALL) NOPASSWD: ALL
|
||||
```
|
||||
@@ -0,0 +1,269 @@
|
||||
---
|
||||
|
||||
slug: /plan-disks
|
||||
---
|
||||
|
||||
# Plan disks
|
||||
|
||||
seekdb servers depend on data disks, transaction log disks, and seekdb installation disks. If you are a personal user, you can put all data on a single disk and skip this step. If you are an enterprise user, it is recommended to mount data to three separate disks.
|
||||
|
||||
If your machine does not have three disks, or if you are using a RAID disk array, you need to partition the disk or the logical volumes of the disk array. It is recommended that you partition using the following scheme:
|
||||
|
||||
* Data disk
|
||||
|
||||
The data disk is used to store baseline data, and the path is specified by the configuration parameter `data_dir`. When you start seekdb for the first time, `${data_dir}/{sstable,slog}` will be created automatically. The size of the data disk is determined by the `datafile_disk_percentage`/`datafile_size` parameters. You can also dynamically expand disk files after deployment through the `datafile_next` and `datafile_maxsize` configuration items. For details, see [Configure dynamic expansion of disk data files](https://en.oceanbase.com/docs/common-oceanbase-database-10000000001971412).
|
||||
|
||||
* Transaction log disk
|
||||
|
||||
The path of the transaction log disk is specified by the configuration parameter `redo-dir`. It is recommended that you set the size of the transaction log disk to 3 to 4 times or more of the seekdb memory. When you start seekdb for the first time, `${redo-dir}` will be created automatically. The transaction log disk contains multiple fixed-size files, and you can automatically create and clear transaction logs as needed. When transaction logs reach 80% of the total disk capacity, automatic clearing will be triggered. However, transaction logs can only be deleted when the memory data corresponding to the transaction logs has been merged into the baseline data.
|
||||
|
||||
With the same data volume, the size of transaction logs is approximately three times the size of memory data. Therefore, the upper limit of the space required for the transaction log disk is proportional to the total data volume after two merges. Empirical formula: Transaction log file size = 3~4 times the upper limit of incremental data memory.
|
||||
|
||||
* seekdb installation disk
|
||||
|
||||
The path of the seekdb installation disk is specified by the configuration parameter `base-dir`. The seekdb RPM package installation directory is located under `${base-dir}`. Baseline data files and transaction log files are linked to independent data disks and transaction log disks respectively through soft links. seekdb runtime logs are located under `${base-dir}/log`. Runtime logs continue to grow, and seekdb cannot automatically delete runtime logs, so you need to regularly delete runtime logs.
|
||||
|
||||
## Disk mounting
|
||||
|
||||
The disk mount point requirements for seekdb are shown in the following table.
|
||||
|
||||
* Personal users
|
||||
|
||||
For personal users, disk mounting is not required. It is recommended that the minimum available disk space be 5 GB when in use.
|
||||
|
||||
* Enterprise users
|
||||
|
||||
| Directory | Size | Purpose | File system format |
|
||||
|------------|----------------|----------------|-------------------------|
|
||||
| /home | 100 GB~300 GB | seekdb database installation disk | ext4 or xfs recommended |
|
||||
| /data/log1 | 2 times the memory size allocated to seekdb | seekdb process log disk | ext4 or xfs recommended |
|
||||
| /data/1 | Depends on the size of data to be stored | seekdb process data disk | ext4 or xfs recommended |
|
||||
|
||||
:::info
|
||||
<ul><li>It is recommended that the root directory be at least 50 GB. If using LVM, it is recommended to use striping parameters when creating. Example: <code>lvcreate -n data -L 3000G obvg --stripes=3 --stripesize=128</code></li>
|
||||
<li>In production environments, it is recommended to use different disks for the data disk, log disk, and installation disk to avoid performance issues.</li></ul>
|
||||
:::
|
||||
|
||||
## Disk mounting operations
|
||||
|
||||
Disk mounting must be performed under the root user, and there are two operation methods:
|
||||
|
||||
* Mount disks using LVM tools (recommended).
|
||||
* Mount disks using fdisk tools.
|
||||
|
||||
### Mount disks using LVM tools
|
||||
|
||||
1. Check disk information
|
||||
|
||||
Use the `fdisk -l` command to identify available disks and partitions, and confirm the target device (such as `/dev/sdb1`).
|
||||
|
||||
```shell
|
||||
fdisk -l
|
||||
```
|
||||
|
||||
2. Install LVM tools
|
||||
|
||||
If LVM is not pre-installed, run the following command to install LVM. If LVM is already installed, skip this step.
|
||||
|
||||
* Debian/Ubuntu systems
|
||||
|
||||
```shell
|
||||
apt-get install lvm2
|
||||
```
|
||||
|
||||
* CentOS/RHEL systems
|
||||
|
||||
```shell
|
||||
yum install lvm2
|
||||
```
|
||||
|
||||
3. Create a physical volume (PV).
|
||||
|
||||
1. Initialize the partition as a physical volume.
|
||||
|
||||
```shell
|
||||
pvcreate /dev/sdb1
|
||||
```
|
||||
|
||||
2. Verify the PV creation result
|
||||
|
||||
```shell
|
||||
pvs
|
||||
```
|
||||
|
||||
4. Create a volume group (VG).
|
||||
|
||||
1. Combine multiple physical volumes into one VG.
|
||||
|
||||
```shell
|
||||
vgcreate vg01 /dev/sdb1 /dev/sdc1
|
||||
```
|
||||
|
||||
2. View VG information
|
||||
|
||||
```shell
|
||||
vgs
|
||||
```
|
||||
|
||||
5. Create a logical volume (LV).
|
||||
|
||||
1. Create a 100 GB logical volume from the VG.
|
||||
|
||||
```shell
|
||||
lvcreate -L 100G -n lv01 vg01
|
||||
```
|
||||
|
||||
The size of the logical volume here can be set according to actual needs.
|
||||
|
||||
2. View LV information.
|
||||
|
||||
```shell
|
||||
lvs
|
||||
```
|
||||
|
||||
6. Format and mount.
|
||||
|
||||
1. Format as ext4 file system.
|
||||
|
||||
```shell
|
||||
mkfs.ext4 /dev/vg01/lv01
|
||||
```
|
||||
|
||||
2. Create a mount point.
|
||||
|
||||
```shell
|
||||
mkdir -p /data/1
|
||||
```
|
||||
|
||||
3. Temporarily mount.
|
||||
|
||||
```shell
|
||||
mount /dev/vg01/lv01 /data/1
|
||||
```
|
||||
|
||||
7. Set automatic mounting on boot.
|
||||
|
||||
Edit the `/etc/fstab` file and add the mount configuration:
|
||||
|
||||
```shell
|
||||
vim /etc/fstab
|
||||
```
|
||||
|
||||
Add the following content to the configuration file:
|
||||
|
||||
```shell
|
||||
/dev/vg01/lv01 /data/1 ext4 defaults,noatime,nodiratime,nodelalloc,barrier=0 0 0
|
||||
```
|
||||
|
||||
### Mount disks using fdisk tools
|
||||
|
||||
1. Check disk information
|
||||
|
||||
Use the `fdisk -l` command to identify available disks and partitions, and confirm the target device (such as `/dev/sdb1`).
|
||||
|
||||
```shell
|
||||
fdisk -l
|
||||
```
|
||||
|
||||
2. Create a partition
|
||||
|
||||
Use the fdisk tool to create a new partition, for example `fdisk /dev/sdb1`, enter n to create a primary partition, and finally save (w).
|
||||
|
||||
```shell
|
||||
fdisk /dev/sdb1
|
||||
```
|
||||
|
||||
3. Format and mount.
|
||||
|
||||
1. Format as ext4 file system.
|
||||
|
||||
```shell
|
||||
mkfs.ext4 /dev/sdb1
|
||||
```
|
||||
|
||||
2. Create a mount point.
|
||||
|
||||
```shell
|
||||
mkdir -p /data/1
|
||||
```
|
||||
|
||||
3. Temporarily mount.
|
||||
|
||||
```shell
|
||||
mount /dev/sdb1 /data/1
|
||||
```
|
||||
|
||||
4. Set automatic mounting on boot.
|
||||
|
||||
Edit the `/etc/fstab` file and add the mount configuration:
|
||||
|
||||
```shell
|
||||
vim /etc/fstab
|
||||
```
|
||||
|
||||
Add the following content to the configuration file:
|
||||
|
||||
```shell
|
||||
/dev/sdb1 /data/1 ext4 defaults,noatime,nodiratime,nodelalloc,barrier=0 0 0
|
||||
```
|
||||
|
||||
## Check disks
|
||||
|
||||
After disks are mounted, run the following command to check the disk mounting status:
|
||||
|
||||
```shell
|
||||
df -h
|
||||
```
|
||||
|
||||
The following result is returned:
|
||||
|
||||
```shell
|
||||
Filesystem Size Used Avail Use% Mounted on
|
||||
devtmpfs 31G 0 31G 0% /dev
|
||||
tmpfs 31G 0 31G 0% /dev/shm
|
||||
tmpfs 31G 516K 31G 1% /run
|
||||
tmpfs 31G 0 31G 0% /sys/fs/cgroup
|
||||
/dev/vda1 493G 171G 302G 37% /
|
||||
tmpfs 6.2G 0 6.2G 0% /run/user/0
|
||||
/dev/sdb1 984G 77M 934G 1% /data/1
|
||||
/dev/vdc1 196G 61M 186G 1% /data/log1
|
||||
/dev/vdb1 492G 73M 467G 1% /home/admin/seekdb
|
||||
```
|
||||
|
||||
Result description
|
||||
|
||||
* `/data/1` is the data disk with a size of 1 TB.
|
||||
|
||||
* `/data/log1` stores logs.
|
||||
|
||||
* `/home/admin/seekdb` stores seekdb binary files and runtime logs.
|
||||
|
||||
Ensure that the disks corresponding to `data_dir`, `redo_dir`, and `home_path` in the configuration file have been mounted. The directories corresponding to `data_dir` and `redo_dir` are empty, and the disk usage of the directory corresponding to `data_dir` must be less than 4%.
|
||||
|
||||
## Set directory permissions
|
||||
|
||||
After disk mounting is complete, you need to check the permissions of the directories corresponding to the mounted disks.
|
||||
|
||||
Run the following command to check the permissions of cluster-related file directories.
|
||||
|
||||
Here, the `data` directory is used as an example:
|
||||
|
||||
```shell
|
||||
[root@test001 data]# ls -al
|
||||
```
|
||||
|
||||
The following result is returned:
|
||||
|
||||
```shell
|
||||
drwxr-xr-x 2 admin admin 4096 Feb 9 18:43 .
|
||||
drwxr-xr-x 2 admin admin 4096 Feb 9 18:43 log1
|
||||
```
|
||||
|
||||
If you find that the `admin` user does not have permissions for related files after checking directory permissions, run the following command to change the file owner:
|
||||
|
||||
```shell
|
||||
[root@test001 ~]# chown -R admin:admin /data/log1
|
||||
[root@test001 ~]# chown -R admin:admin /data
|
||||
```
|
||||
|
||||
Here, `/data/log1` and `/data` are example mount directories. You need to replace them with your actual mount directories.
|
||||
@@ -0,0 +1,84 @@
|
||||
---
|
||||
|
||||
slug: /configure-limits-conf
|
||||
---
|
||||
|
||||
# Configure limits.conf
|
||||
|
||||
This topic describes how to limit the number of processes by configuring `limits.conf`.
|
||||
|
||||
If you are a personal user, you can skip this step. If you are an enterprise user, it is recommended to configure `limits.conf`.
|
||||
|
||||
You can modify resource limits using the following method:
|
||||
|
||||
Modify at the global level through the configuration file `/etc/security/limits.conf`.
|
||||
|
||||
The limits involved in seekdb processes include the maximum stack space size, maximum number of open files, and core file size.
|
||||
|
||||
## Modify configuration
|
||||
|
||||
Set the maximum stack space size at the session level to `unlimited`, the maximum number of open files to `655350`, and the core file size to `unlimited`.
|
||||
|
||||
Run the following command to open the `/etc/security/limits.conf` configuration file:
|
||||
|
||||
```shell
|
||||
sudo vim /etc/security/limits.conf
|
||||
```
|
||||
|
||||
Add the following content to the `/etc/security/limits.conf` configuration file:
|
||||
|
||||
```shell
|
||||
* soft nofile 655350
|
||||
* hard nofile 655350
|
||||
* soft stack unlimited
|
||||
* hard stack unlimited
|
||||
* soft nproc 655360
|
||||
* hard nproc 655360
|
||||
* soft core unlimited
|
||||
* hard core unlimited
|
||||
```
|
||||
|
||||
:::info
|
||||
|
||||
<ul><li>You need to check whether the nproc configuration exists in the <code>/etc/security/limits.d/20-nproc.conf</code> file. If it exists, you need to synchronously modify the nproc value in that file.</li>
|
||||
<li>The limits.conf configuration only takes effect for newly logged-in sessions (such as newly opened terminals, SSH connections, or newly started processes). Existing sessions or processes will not automatically inherit the new configuration and need to log in again or restart related services.</li></ul>
|
||||
:::
|
||||
|
||||
## View configuration
|
||||
|
||||
Exit the current session and log in again. Run the following command to check whether the configuration has taken effect.
|
||||
|
||||
```shell
|
||||
ulimit -a
|
||||
```
|
||||
|
||||
The output is as follows.
|
||||
|
||||
```shell
|
||||
core file size (blocks, -c) unlimited
|
||||
data seg size (kbytes, -d) unlimited
|
||||
scheduling priority (-e) 0
|
||||
file size (blocks, -f) unlimited
|
||||
pending signals (-i) 252876
|
||||
max locked memory (kbytes, -l) 64
|
||||
max memory size (kbytes, -m) unlimited
|
||||
open files (-n) 655350
|
||||
pipe size (512 bytes, -p) 8
|
||||
POSIX message queues (bytes, -q) 819200
|
||||
real-time priority (-r) 0
|
||||
stack size (kbytes, -s) unlimited
|
||||
cpu time (seconds, -t) unlimited
|
||||
max user processes (-u) 655360
|
||||
virtual memory (kbytes, -v) unlimited
|
||||
file locks (-x) unlimited
|
||||
```
|
||||
|
||||
From the results, you can see:
|
||||
|
||||
* Core file size indicates the maximum threshold of core files (in blocks), corresponding to the core parameter in the `limits.conf` configuration file. Check whether the value is unlimited.
|
||||
|
||||
* Open files indicates the maximum number of open file descriptors, corresponding to the nofile parameter in the `limits.conf` configuration file. Check whether the value is 655350.
|
||||
|
||||
* Stack size indicates the stack size (in kilobytes), corresponding to the stack parameter in the `limits.conf` configuration file. Check whether the value is unlimited.
|
||||
|
||||
* Max user processes indicates the maximum number of user processes, corresponding to the nproc parameter in the `limits.conf` configuration file. Check whether the value is 655360.
|
||||
@@ -0,0 +1,94 @@
|
||||
---
|
||||
|
||||
slug: /configure-sysctl-conf
|
||||
---
|
||||
|
||||
# Configure sysctl.conf
|
||||
|
||||
This topic describes how to improve Linux system performance by modifying the `sysctl.conf` configuration on the machine.
|
||||
|
||||
If you are a personal user, you can skip this step. If you are an enterprise user, it is recommended to configure `sysctl.conf`.
|
||||
|
||||
## Modify configuration
|
||||
|
||||
Run the following command to open the `/etc/sysctl.conf` configuration file:
|
||||
|
||||
```shell
|
||||
sudo vim /etc/sysctl.conf
|
||||
```
|
||||
|
||||
Add the following content to the `/etc/sysctl.conf` configuration file:
|
||||
|
||||
```shell
|
||||
# for seekdb
|
||||
## Modify kernel asynchronous I/O limits
|
||||
fs.aio-max-nr = 1048576
|
||||
|
||||
## Network optimization
|
||||
net.core.somaxconn = 2048
|
||||
net.core.netdev_max_backlog = 10000
|
||||
net.core.rmem_default = 16777216
|
||||
net.core.wmem_default = 16777216
|
||||
net.core.rmem_max = 16777216
|
||||
net.core.wmem_max = 16777216
|
||||
|
||||
net.ipv4.ip_forward = 0
|
||||
net.ipv4.conf.default.rp_filter = 1
|
||||
net.ipv4.conf.default.accept_source_route = 0
|
||||
net.ipv4.tcp_syncookies = 1
|
||||
net.ipv4.tcp_rmem = 4096 87380 16777216
|
||||
net.ipv4.tcp_wmem = 4096 65536 16777216
|
||||
net.ipv4.tcp_max_syn_backlog = 16384
|
||||
net.ipv4.tcp_fin_timeout = 15
|
||||
net.ipv4.tcp_slow_start_after_idle=0
|
||||
|
||||
vm.swappiness = 0
|
||||
vm.min_free_kbytes = 2097152
|
||||
vm.overcommit_memory = 0
|
||||
|
||||
fs.file-max = 6573688
|
||||
fs.pipe-user-pages-soft = 0
|
||||
|
||||
# Modify the number of virtual memory areas a process can own
|
||||
vm.max_map_count = 655360
|
||||
|
||||
# Set the filename format and directory for core files
|
||||
kernel.core_pattern = /data/core-%e-%p-%t
|
||||
```
|
||||
|
||||
Here, `/data` in `kernel.core_pattern` is the `data` directory of seekdb.
|
||||
|
||||
:::tip
|
||||
<ul><li>If the <code>max_map_count</code> configuration is unreasonable, it may cause serious memory leaks.</li>
|
||||
<li>You need to reserve at least the same amount of disk space as the memory_limit configured for seekdb for the core file directory, and avoid affecting the available space of the data directory and log directory.</li></ul>
|
||||
:::
|
||||
|
||||
## Load configuration
|
||||
|
||||
After modifying the configuration, run the following command to load the configuration and make it take effect.
|
||||
|
||||
```shell
|
||||
sysctl -p
|
||||
```
|
||||
|
||||
## ARM environment deployment recommendations
|
||||
|
||||
* Enable NUMA support in BIOS/UEFI and kernel boot parameters.
|
||||
* In ARM and Hygon architecture environments, it is recommended to modify the configuration file `/etc/sysctl.conf` and set the parameters `kernel.numa_balancing`, `vm.zone_reclaim_mode`, and `vm.swappiness` to `0`, as follows:
|
||||
|
||||
```shell
|
||||
[root@xxx /]
|
||||
$vi /etc/sysctl.conf
|
||||
## Disable NUMA balancing to avoid performance jitter during balancing
|
||||
kernel.numa_balancing = 0
|
||||
## Disable memory reclaim and reallocation functions
|
||||
vm.zone_reclaim_mode = 0
|
||||
vm.swappiness = 0
|
||||
```
|
||||
|
||||
Apply the values in the sysctl.conf configuration file:
|
||||
|
||||
```shell
|
||||
[root@xxx /]
|
||||
$sysctl -p
|
||||
```
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
|
||||
slug: /disable-firewall-and-selinux
|
||||
---
|
||||
|
||||
# Disable the firewall and SELinux
|
||||
|
||||
This topic describes how to disable the firewall and SELinux. If you are a personal user, you can skip this step. If you are an enterprise user, it is recommended that you refer to this topic to disable the firewall and SELinux.
|
||||
|
||||
## Disable the firewall
|
||||
|
||||
Run the following commands in sequence to disable the firewall:
|
||||
|
||||
```shell
|
||||
systemctl disable firewalld
|
||||
systemctl stop firewalld
|
||||
systemctl status firewalld
|
||||
```
|
||||
|
||||
## Disable SELinux
|
||||
|
||||
Run the following command to open the `/etc/selinux/config` configuration file:
|
||||
|
||||
```shell
|
||||
vi /etc/selinux/config
|
||||
```
|
||||
|
||||
Modify the corresponding configuration item in the `/etc/selinux/config` configuration file to the following:
|
||||
|
||||
```shell
|
||||
SELINUX=disabled
|
||||
```
|
||||
|
||||
Run the following command or restart the server to make the changes take effect:
|
||||
|
||||
```shell
|
||||
setenforce 0
|
||||
```
|
||||
|
||||
Run the following command to check whether the changes have taken effect:
|
||||
|
||||
```shell
|
||||
sestatus
|
||||
```
|
||||
@@ -0,0 +1,62 @@
|
||||
---
|
||||
|
||||
slug: /deploy-embedded-seekdb
|
||||
---
|
||||
|
||||
# Embedded mode
|
||||
|
||||
seekdb provides an embedded deployment method that runs as a "library" inside your application. It can easily run on various "endpoints", making it suitable for mobile application development, desktop application development, and application development on IoT and edge devices.
|
||||
|
||||
You can deploy embedded seekdb through pyseekdb (the Python SDK provided by seekdb) or Python.
|
||||
|
||||
## Environment requirements
|
||||
|
||||
* **Supported operating systems**: Linux (glibc >= 2.28)
|
||||
|
||||
* **Supported Python versions**:
|
||||
|
||||
* **Use seekdb via pyseekdb**: Python 3.11 to 3.13
|
||||
|
||||
* **Use seekdb via Python**: CPython 3.8 to 3.14
|
||||
|
||||
* **Supported system architectures**: x86_64, aarch64
|
||||
|
||||
You can run the following command to check whether your environment meets the requirements.
|
||||
|
||||
```python
|
||||
python3 -c 'import sys;import platform; print(f"Python: {platform.python_implementation()} {platform.python_version()}, System: {platform.system()} {platform.machine()}, {platform.libc_ver()[0]}: {platform.libc_ver()[1]}");'
|
||||
```
|
||||
|
||||
The following result is returned:
|
||||
|
||||
```python
|
||||
Python: CPython 3.8.17, System: Linux x86_64, glibc: 2.32
|
||||
```
|
||||
|
||||
## (Recommended) Deploy seekdb using pyseekdb
|
||||
|
||||
Use pip to install, which automatically loads embedded seekdb. The specific commands are as follows.
|
||||
|
||||
```shell
|
||||
pip install pyseekdb
|
||||
# Or specify an installation source for faster installation
|
||||
pip install pyseekdb -i https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
```
|
||||
|
||||
## Deploy seekdb using Python
|
||||
|
||||
Use pip to install, which automatically detects the default Python version and platform.
|
||||
|
||||
```shell
|
||||
pip install pylibseekdb
|
||||
# Or specify an installation source for faster installation
|
||||
pip install pylibseekdb -i https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
```
|
||||
|
||||
## Considerations
|
||||
|
||||
If you are prompted that the pip version is too low when deploying seekdb, upgrade pip first before installing.
|
||||
|
||||
```bash
|
||||
pip install --upgrade pip
|
||||
```
|
||||
@@ -0,0 +1,202 @@
|
||||
---
|
||||
|
||||
slug: /deploy-by-systemd
|
||||
---
|
||||
|
||||
# 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
|
||||
|
||||
1. Add the seekdb repository
|
||||
|
||||
```shell
|
||||
[admin@test001 ~]$ sudo yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo
|
||||
```
|
||||
|
||||
2. Install seekdb
|
||||
|
||||
```shell
|
||||
[admin@test001 ~]$ sudo yum install seekdb obclient
|
||||
```
|
||||
|
||||
#### Offline installation
|
||||
|
||||
1. You can download the required version of seekdb from the [OceanBase Software Download Center](https://en.oceanbase.com/softwarecenter). After downloading, copy the installation package to your machine. It is recommended that you use the latest version of the installation package.
|
||||
|
||||
2. In the directory where the installation package is located, run the rpm command to install seekdb.
|
||||
|
||||
```shell
|
||||
[admin@test001 ~]$ sudo rpm -ivh seekdb-*.rpm
|
||||
```
|
||||
|
||||
### Step 2: Start seekdb
|
||||
|
||||
After installing seekdb, you can start seekdb by following these steps.
|
||||
|
||||
1. (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.
|
||||
|
||||
```shell
|
||||
[admin@test001 ~]$ sudo vim /etc/oceanbase/seekdb.cnf
|
||||
```
|
||||
|
||||
The configuration items in this file are as follows:
|
||||
|
||||
```shell
|
||||
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=2G
|
||||
```
|
||||
|
||||
The 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.<main id="notice" type='explain'><h4>Note</h4><p>The available disk space of the data disk (default: <code>/var/lib/oceanbase/</code>) should be greater than 15 GB.</p></main> |
|
||||
| data_dir | Optional | /var/lib/oceanbase/store | Directory for storing SSTable and other data. It is recommended to configure it as an independent disk.<main id="notice" type='explain'><h4>Note</h4><p>The available disk space of the data disk (default: <code>/var/lib/oceanbase/</code>) should be greater than 15 GB.</p></main> |
|
||||
| datafile_size | Optional | 2G | Specifies the size of data files (block_file). If not configured, the `datafile_disk_percentage` configuration item is used. For details, see [datafile_size](https://en.oceanbase.com/docs/common-oceanbase-database-10000000001971955) and [datafile_disk_percentage](https://en.oceanbase.com/docs/common-oceanbase-database-10000000001971961). |
|
||||
| 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_percentage` configuration item is used. For details, see [log_disk_size](https://en.oceanbase.com/docs/common-oceanbase-database-10000000001971764) and [log_disk_percentage](https://en.oceanbase.com/docs/common-oceanbase-database-10000000001971945). |
|
||||
|
||||
2. Start seekdb.
|
||||
|
||||
```shell
|
||||
[admin@test001 ~]$ sudo systemctl start seekdb
|
||||
```
|
||||
|
||||
3. Check the startup status of seekdb.
|
||||
|
||||
```shell
|
||||
[admin@test001 ~]$ sudo systemctl status seekdb
|
||||
```
|
||||
|
||||
When 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:
|
||||
|
||||
```shell
|
||||
[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 is `root`.
|
||||
|
||||
* -P: Provides the seekdb connection port, which is the value of `port` in `/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.
|
||||
|
||||
```shell
|
||||
[admin@test001 ~]$ sudo systemctl status seekdb
|
||||
```
|
||||
|
||||
The seekdb status has the following scenarios:
|
||||
|
||||
* `Active` displays `active (running)`, and `Status` displays `seekdb is ready and running`, indicating that seekdb has started successfully.
|
||||
|
||||
* `Active` displays `inactive (dead)`, indicating that the service has stopped, that is, seekdb has stopped.
|
||||
|
||||
* `Active` displays `failed`, 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.
|
||||
|
||||
1. Stop seekdb.
|
||||
|
||||
```shell
|
||||
[admin@test001 ~]$ sudo systemctl stop seekdb
|
||||
```
|
||||
|
||||
2. Uninstall seekdb.
|
||||
|
||||
1. Delete the seekdb database package
|
||||
|
||||
For online installation, you can run the following command:
|
||||
|
||||
```shell
|
||||
[admin@test001 ~]$ sudo yum erase seekdb
|
||||
```
|
||||
|
||||
`package` needs to be replaced with the name of the package to be deleted. You can check the package name using the `yum list | grep seekdb` command.
|
||||
|
||||
For offline installation, you can run the following command:
|
||||
|
||||
```shell
|
||||
[admin@test001 ~]$ sudo rpm -e seekdb
|
||||
```
|
||||
|
||||
`package` needs to be replaced with the name of the package to be deleted. You can check the package name using the `rpm -qa | grep seekdb` command.
|
||||
|
||||
2. 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.
|
||||
|
||||
```shell
|
||||
[admin@test001 ~]$ sudo bash /var/lib/oceanbase/oceanbase_clean.sh
|
||||
```
|
||||
@@ -0,0 +1,145 @@
|
||||
---
|
||||
|
||||
slug: /deploy-by-docker
|
||||
---
|
||||
|
||||
# Deploy seekdb in a container environment
|
||||
|
||||
This topic describes how to deploy seekdb through Docker containers.
|
||||
|
||||
## Overview
|
||||
|
||||
The `seekdb` Docker image is available from [dockerhub](https://hub.docker.com/r/oceanbase/seekdb), [quay.io](https://quay.io/repository/oceanbase/seekdb), and [ghcr.io](https://ghcr.io/oceanbase/seekdb), and is designed to help users quickly set up a seekdb environment for testing.
|
||||
|
||||
:::tip
|
||||
<ul><li>When running this image on macOS with Intel chips, there is a known issue if the Docker version is higher than 4.9.0. You can download the required version of <a href="https://desktop.docker.com/mac/main/amd64/81317/Docker.dmg?_gl=17jelfd_gcl_auOTk5Nzk0MDUwLjE3MTE4ODMyNzM._gaNDQyMjE1MDE5LjE3MTE4ODMyNzQ._ga_XJWPQMJYHQ*MTcxOTIxOTEwMy4xMS4xLjE3MTkyMjEwMTAuNjAuMC4w">Docker</a> here.</li>
|
||||
<li>This image is for testing only; do not use it in production environments.</li></ul>
|
||||
:::
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before deploying `seekdb`, ensure that the following requirements are met:
|
||||
|
||||
* Docker is installed and the Docker service is started. For details, see [Docker documentation](https://docs.docker.com/get-docker/).
|
||||
|
||||
* Your machine has at least 1 physical core and 2 GB of memory.
|
||||
|
||||
## Start a seekdb instance
|
||||
|
||||
To start a seekdb instance, use the following command:
|
||||
|
||||
```shell
|
||||
docker run -d -p 2881:2881 oceanbase/seekdb
|
||||
```
|
||||
|
||||
:::info
|
||||
<ul>
|
||||
<li>
|
||||
If pulling the Docker image fails, you can also pull the image from the quay.io or ghcr.io repository by replacing <code>oceanbase/seekdb</code> in the above command with <code>quay.io/oceanbase/seekdb</code> or <code>ghcr.io/oceanbase/seekdb</code>, for example, run <code>sudo docker run -d -p 2881:2881 quay.io/oceanbase/seekdb</code> to pull the image from quay.io.
|
||||
</li>
|
||||
<li>
|
||||
The above command pulls the latest version by default. You can select a version from <a href="https://hub.docker.com/r/oceanbase/seekdb">dockerhub</a>, <a href="https://quay.io/repository/oceanbase/seekdb">quay.io</a>, or <a href="https://ghcr.io/oceanbase/seekdb">ghcr.io</a> according to your actual needs.
|
||||
</li>
|
||||
</ul>
|
||||
:::
|
||||
|
||||
If you want to execute initialization SQL scripts after startup, you need to mount a directory containing initialization scripts and then specify the mounted directory in the container through the environment variable `INIT_SCRIPTS_PATH`. Example command:
|
||||
|
||||
```shell
|
||||
docker run -d -p 2881:2881 -v {init_sql_folder_path}:/root/boot/init.d -e INIT_SCRIPTS_PATH=/root/boot/init.d oceanbase/seekdb
|
||||
```
|
||||
In the command, `{init_sql_folder_path}` is the path to the initialization SQL scripts on the host machine.
|
||||
|
||||
:::tip
|
||||
Do not change the root user password in SQL scripts. If you want to change the root user password, use the environment variable <code>ROOT_PASSWORD</code>, for example: <code>docker run -d -p 2881:2881 -e ROOT_PASSWORD="******" oceanbase/seekdb</code>.
|
||||
:::
|
||||
|
||||
The supported environment variables are as follows:
|
||||
|
||||
| Variable name | Description | Default value |
|
||||
|-----------|--------------------|----------|
|
||||
| ROOT_PASSWORD | Password for the root user. | Empty by default |
|
||||
| CPU_COUNT | Value of cpu_count.| 4 |
|
||||
| MEMORY_LIMIT | Value of memory_limit.| 2G |
|
||||
| LOG_DISK_SIZE | Value of log_disk_size.| 2G |
|
||||
| DATAFILE_SIZE | Value of datafile_size.| 2G |
|
||||
| DATAFILE_NEXT | Value of datafile_next.| 2G |
|
||||
| DATAFILE_MAXSIZE | Value of datafile_maxsize.| 50G |
|
||||
| INIT_SCRIPTS_PATH | Path to initialization scripts in the container.| \ |
|
||||
|
||||
|
||||
If you want to modify more seekdb parameters, you can deploy seekdb using a configuration file.
|
||||
|
||||
You can mount the configuration file to `/etc/oceanbase/seekdb.cnf` in the container.
|
||||
|
||||
1. Create a configuration file on the host server. The default configuration file is as follows:
|
||||
|
||||
```shell
|
||||
datafile_size=2G
|
||||
datafile_next=2G
|
||||
datafile_maxsize=50G
|
||||
cpu_count=4
|
||||
memory_limit=8G
|
||||
log_disk_size=2G
|
||||
# config the parameter in the following format
|
||||
# key=value
|
||||
```
|
||||
|
||||
2. Start seekdb.
|
||||
|
||||
```shell
|
||||
docker run -d -p 2881:2881 -v {config_file}:/etc/oceanbase/seekdb.cnf oceanbase/seekdb
|
||||
```
|
||||
|
||||
In the command, `{config_file}` is the path to the configuration file on the host machine.
|
||||
|
||||
:::tip
|
||||
If you decide to use a configuration file, do not specify resource-related environment variables.
|
||||
:::
|
||||
|
||||
|
||||
## Data persistence
|
||||
|
||||
seekdb is deployed in the `/var/lib/oceanbase` directory. If you want to persist data to the host server, mount an empty directory on the host server to this path.
|
||||
|
||||
```shell
|
||||
mkdir -p seekdb
|
||||
docker run -d -p 2881:2881 -v $PWD/seekdb:/var/lib/oceanbase --name seekdb oceanbase/seekdb
|
||||
```
|
||||
|
||||
## Connect to a seekdb instance
|
||||
|
||||
You can use the OBClient or MySQL client on the host to connect to the seekdb instance.
|
||||
|
||||
```shell
|
||||
[admin@test001 ~]$ mysql -uroot -h127.0.0.1 -P2881 -p
|
||||
```
|
||||
|
||||
:::info
|
||||
If the password is not configured through environment variables when starting the seekdb instance, users created in the instance use empty passwords by default.
|
||||
:::
|
||||
|
||||
After a successful connection, the terminal displays the following content:
|
||||
|
||||
```shell
|
||||
Welcome to the MariaDB monitor. Commands end with ; or \g.
|
||||
Your MySQL connection id is 3221628904
|
||||
Server version: 5.7.25 OceanBase 4.3.5.3 seekdb (r1.0.0.0) (Built 102025110516-83ac0ad994286047a3e713e82e9541383f6df531 Nov 5 2025)
|
||||
|
||||
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
|
||||
|
||||
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
|
||||
|
||||
MySQL [(none)]>
|
||||
```
|
||||
|
||||
## Access the obshell dashboard
|
||||
|
||||
The container also starts obshell, which provides a user-friendly web interface. If you want to access the obshell dashboard, you can also map the obshell dashboard port.
|
||||
|
||||
```shell
|
||||
# 2886 is the port for the obshell dashboard
|
||||
docker run -d -p 2881:2881 -p 2886:2886 oceanbase/seekdb
|
||||
```
|
||||
|
||||
You can access `http://${server_ip}:2886` through a browser. The login password is the same as the root user password. If `ROOT_PASSWORD` is not set, leave the password field empty.
|
||||
@@ -0,0 +1,249 @@
|
||||
---
|
||||
|
||||
slug: /deploy-oceanbase-desktop
|
||||
---
|
||||
|
||||
# Deploy OceanBase Desktop
|
||||
|
||||
This topic describes how to deploy OceanBase Desktop on Windows or macOS.
|
||||
|
||||
## Overview
|
||||
|
||||
OceanBase Desktop is a desktop application for managing and operating seekdb. It provides a graphical interface that enables users to easily perform database management, query execution, data import and export, and other operations.
|
||||
|
||||
OceanBase Desktop has the following features:
|
||||
|
||||
* **Graphical interface:** An intuitive and easy-to-use graphical interface that simplifies database management tasks.
|
||||
|
||||
* **Database management:** Supports creating and managing database instances.
|
||||
|
||||
* **Query execution:** Provides an SQL query command line.
|
||||
|
||||
* **Monitoring and logs:** Real-time monitoring of database status.
|
||||
|
||||
## Check configuration
|
||||
### Windows
|
||||
|
||||
Before installing OceanBase Desktop on Windows, ensure that your machine meets the following requirements:
|
||||
|
||||
* The operating system is Windows (x86-64 chip). WSL 2 requires Windows 10 version 1903 or later (build 18362 or later), or Windows 11.
|
||||
|
||||
* At least 1 vCPU, 2 GB memory, and 5 GB disk space are available.
|
||||
|
||||
You can check whether your machine meets the requirements as follows:
|
||||
|
||||
* Check the Windows version
|
||||
|
||||
Press [Win] + [Q] on your keyboard, search for **Settings**, and click **Settings**. On the **Settings** page, click **System**, scroll down to find **About**, and you can view the Windows operating system build number.
|
||||
|
||||
<!---->
|
||||
|
||||
* Check memory and CPU
|
||||
|
||||
Press [Win] + [Q] on your keyboard, search for **Task Manager**, and click to open it. Go to the **Performance** interface. Switch to the **CPU** tab to view the number of CPU cores. Switch to the **Memory** tab to view memory usage.
|
||||
|
||||
<!---->
|
||||
|
||||
* Check disk
|
||||
|
||||
Press [Win] + [Q] on your keyboard, search for **File Explorer**, and click to open it. In **File Explorer**, click **This PC** on the left to view the disk information displayed under **Devices and drives**.
|
||||
|
||||
### macOS
|
||||
|
||||
Before installing OceanBase Desktop on macOS, ensure that your machine meets the following requirements:
|
||||
|
||||
* The operating system is macOS (Apple Silicon chip and Intel chip).
|
||||
|
||||
* At least 1 vCPU, 2 GB memory, and 5 GB disk space are available.
|
||||
|
||||
You can check whether your machine meets the requirements as follows:
|
||||
|
||||
* Check CPU and memory
|
||||
|
||||
Open Finder, click **Applications**, select the **Utilities** folder in the **Applications** module, and then double-click to open **Activity Monitor**. You can view CPU usage in the **CPU** tab of Activity Monitor. Switch to the **Memory** tab to view memory usage.
|
||||
|
||||
<!---->
|
||||
|
||||
* Check disk
|
||||
|
||||
Click the Apple icon in the upper-left corner of your computer, then click **About This Mac**. In the window that appears, click **More Info** to view the disk information displayed under **Storage**.
|
||||
|
||||
<!---->
|
||||
|
||||
## Procedure
|
||||
|
||||
### Windows
|
||||
|
||||
1. Install dependencies
|
||||
|
||||
Installing OceanBase Desktop on Windows requires WSL (Windows Subsystem for Linux). WSL is a feature released by Microsoft in 2016 on the Windows 10 platform that enables users to run Linux executables in ELF format on Windows.
|
||||
|
||||
WSL has released two generations: WSL 1 and WSL 2. WSL 1 implements a Linux compatibility layer that converts Linux system calls to Windows NT system calls. WSL 2 uses Windows Hyper-V functionality to run Linux virtual machines directly through virtualization technology, providing an experience closer to native Linux.
|
||||
|
||||
:::tip
|
||||
WSL 2 is not an upgrade of WSL 1, so you do not need to install WSL 1 before installing WSL 2. OceanBase Desktop images can only use WSL 2.
|
||||
:::
|
||||
|
||||
1. Check whether virtualization is enabled.
|
||||
|
||||
Press [Win] + [Q] on your keyboard, search for **Task Manager**, and click to open it. Go to the **Performance** interface and view **CPU**. As shown in the following figure, if virtualization is enabled, the **Virtualization** field displays **Enabled**. If the **Virtualization** field displays **Disabled**, refer to the following steps to enable virtualization in BIOS.
|
||||
|
||||
<!---->
|
||||
|
||||
2. Enable motherboard virtualization.
|
||||
|
||||
This section uses ThinkPad (a Lenovo brand) as an example to describe how to enter BIOS and enable motherboard virtualization. The operations for entering BIOS and enabling motherboard virtualization vary slightly for different computer brands. You can visit the official websites of your brand to view specific operations, such as [Dell](https://www.dell.com/support/kbdoc/zh-cn/000195978/how-to-enable-or-disable-hardware-virtualization-on-dell-systems?lang=en), [Lenovo](https://support.lenovo.com/us/en/solutions/ht500006-how-to-enable-virtualization-technology-on-lenovo-computers), [ThinkPad (a Lenovo brand)](https://support.lenovo.com/us/en/solutions/ht500006-how-to-enable-virtualization-technology-on-lenovo-computers), [HP](https://support.hp.com/us-en/search?q=enable%20virtualization), or search for your computer model in a browser.
|
||||
|
||||
1. Open the **Start** menu, click the **Power** button, and click **Restart**.
|
||||
|
||||
2. After the computer restarts, immediately press the **F1** key on your keyboard to access BIOS settings.
|
||||
|
||||
3. On the BIOS page, click the **Security** option, and then click **Security Virtualization** on the **Security** page.
|
||||
|
||||
4. After entering the corresponding settings page, set the button after **Virtualization Technology** to **no**.
|
||||
|
||||
5. After adjustment, click **Save and Exit** to save the changes and exit BIOS settings, and wait for the system to restart.
|
||||
|
||||
:::info
|
||||
After enabling, you can refer to the previous step to verify again whether virtualization is enabled.
|
||||
:::
|
||||
|
||||
2. Install OceanBase Desktop
|
||||
|
||||
1. Download the installation package.
|
||||
|
||||
Visit the [OceanBase Software Download Center](https://en.oceanbase.com/softwarecenter), find **OceanBase Desktop One-Click Deployment Installation Package**, and click to download **Windows Version-1.3**.
|
||||
|
||||
2. Install the application.
|
||||
|
||||
1. Double-click the downloaded `OceanBase-Desktop-Setup-x.x.x.exe` file.
|
||||
|
||||
2. In the **User Account Control** window that appears, click **Yes** to allow the application to make changes to the device.
|
||||
|
||||
3. On the `Installer Language` page that appears, select the installation language. The default is Chinese (Simplified).
|
||||
|
||||
<!---->
|
||||
|
||||
4. Select the application installation location. By default, it is installed on drive C. You can click **Browse** to select another folder for installation. After confirmation, click **Install**.
|
||||
|
||||
<!---->
|
||||
|
||||
5. After installation is complete, click **Finish**. OceanBase Desktop will automatically run.
|
||||
|
||||
<!---->
|
||||
|
||||
3. Start OceanBase Desktop.
|
||||
|
||||
After installation is complete, open the desktop version. A login interface for obshell Dashboard appears. The default login password is empty. Click **Login** to enter.
|
||||
|
||||
<!---->
|
||||
|
||||
After entering the obshell Dashboard page, the instance starts automatically. You can view instance information and manage instances on this page.
|
||||
|
||||
<!---->
|
||||
|
||||
3. Connect to OceanBase Desktop
|
||||
|
||||
After OceanBase Desktop starts successfully, you can connect to OceanBase Desktop through the command line interface. The connection string example is as follows:
|
||||
|
||||
```shell
|
||||
wsl.exe -d oceanbase-desktop --exec bash -c "obclient -h127.0.0.1 -P2881 -uroot -Doceanbase -A"
|
||||
```
|
||||
|
||||
### macOS
|
||||
|
||||
Two installation methods are available on macOS: installation through Homebrew and installation through a dmg installation package. This section describes both methods.
|
||||
|
||||
* Install through Homebrew
|
||||
|
||||
1. Install Homebrew
|
||||
|
||||
If Homebrew is not installed in the current environment, run the following command to install it.
|
||||
|
||||
```shell
|
||||
/bin/bash -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
|
||||
```
|
||||
|
||||
2. Add the OceanBase Desktop Tap.
|
||||
|
||||
After adding the OceanBase Desktop Tap to Homebrew, you can install the official package provided by seekdb using the `brew install` command.
|
||||
|
||||
```shell
|
||||
brew tap oceanbase/homebrew-oceanbase-desktop https://gitee.com/oceanbase/homebrew-oceanbase-desktop.git
|
||||
```
|
||||
|
||||
3. Install OceanBase Desktop.
|
||||
|
||||
```shell
|
||||
brew install --cask oceanbase-desktop
|
||||
```
|
||||
|
||||
After the command is executed, the latest version of OceanBase Desktop will be automatically downloaded, and OrbStack will be installed as a dependency (if not already installed in the environment). After successful installation, the application will be placed in the Applications folder.
|
||||
|
||||
4. Start the application.
|
||||
|
||||
Find `OceanBase Desktop` in the Applications folder, or use Spotlight to search for `OceanBase Desktop`, and double-click to start it. Please wait patiently when starting the application for the first time, as the program will complete initialization in the background. After entering the application, click the **Start** button on the page to start seekdb.
|
||||
|
||||
:::info
|
||||
To uninstall OceanBase Desktop, run the <code>brew uninstall --cask oceanbase-desktop</code> command. This command will also clean up application files, application support data, saved application state, and application virtual machines.
|
||||
:::
|
||||
|
||||
* Install through a dmg installation package
|
||||
|
||||
1. Install dependencies
|
||||
|
||||
Installing OceanBase Desktop on macOS requires OrbStack. OrbStack is a modern container and virtual machine management tool designed for macOS users, aiming to provide efficient container runtime (such as Docker containers) and lightweight virtual machine support. Its goal is to replace Docker Desktop and other cumbersome virtualization tools while significantly improving performance, saving system resources, and simplifying the developer experience.
|
||||
|
||||
:::info
|
||||
There are two installation methods in the OrbStack official tutorial: downloading the installation package and running the brew command. This section uses downloading the installation package as an example. For other methods, see the <a href="https://docs.orbstack.dev/quick-start">official tutorial</a>.
|
||||
:::
|
||||
|
||||
1. Download the installation package.
|
||||
|
||||
You can visit the [official download link](https://orbstack.dev/download) to download the installation package. The link provides two installation packages based on the chip used by the operating system (Apple Silicon chip and Intel chip). You can click the Apple icon in the upper-left corner of your computer, then click **About This Mac** to view the chip type used by your computer.
|
||||
|
||||

|
||||
|
||||
2. Install.
|
||||
|
||||
Double-click the corresponding dmg installation package and drag the icon to the Applications folder for installation.
|
||||
|
||||
:::tip
|
||||
If this is the first installation, be sure to complete the OrbStack initial setup process; otherwise, images cannot be imported normally.
|
||||
:::
|
||||
|
||||
<!---->
|
||||
|
||||
3. (Optional) Verify whether the installation is successful.
|
||||
|
||||
Select the Machines (Virtual Machines) section and install the latest Ubuntu image. This process may take a long time. Please wait patiently.
|
||||
|
||||
<!---->
|
||||
|
||||
After installation is complete, double-click the corresponding virtual machine. If you can enter the command line connection interface, it means OrbStack has been successfully installed.
|
||||
|
||||
<!---->
|
||||
|
||||
2. Install OceanBase Desktop
|
||||
|
||||
1. Download the installation package.
|
||||
|
||||
Visit the [OceanBase Software Download Center](https://en.oceanbase.com/softwarecenter), find **OceanBase Desktop One-Click Deployment Installation Package**, and click to download **Mac Version-1.3**.
|
||||
|
||||
|
||||
2. Install the application.
|
||||
|
||||
Click the corresponding installation package and drag the icon to the Applications folder for installation.
|
||||
|
||||
3. Start OceanBase Desktop.
|
||||
|
||||
After installation is complete, a seekdb instance in the `Stopped` state will be automatically deployed. Click the **Start** button on the graphical page to start seekdb.
|
||||
|
||||
|
||||
### Connect to OceanBase Desktop
|
||||
|
||||
After seekdb starts successfully, click the **Connect** button in OceanBase Desktop to automatically connect to seekdb. You can also manually connect to seekdb. The connection string example is as follows:
|
||||
|
||||
```shell
|
||||
mysql -h127.0.0.1 -P2881 -uroot -Doceanbase -A
|
||||
```
|
||||
Reference in New Issue
Block a user