Experience client/server mode seekdb with SQL
seekdb can be used both with SDK and SQL. This topic describes how to use client/server mode seekdb with SQL.
For more information about how to use seekdb with SDK, see Experience embedded seekdb with Python SDK.
In this example, we perform the following operations:
- Deploy client/server mode seekdb.
- Connect to seekdb.
- Create a database.
- Create a table and insert data.
- Perform hybrid search.
- Optimize the search.
- Clean up the environment.
Deployment modes
seekdb provides flexible deployment modes, from rapid prototyping to handling massive users, fully meeting your application needs.
-
Embedded mode
seekdb is embedded as a lightweight library in your application and supports one-click installation via pip. Suitable for personal learning, rapid prototyping, and efficient operation on various edge devices.
-
Client/server mode
Recommended for deployment in testing and production environments, it is lightweight and easy to use, ideal for providing stable and efficient services.
For more detailed and comprehensive deployment methods of seekdb, see Overview of deployment.
Step 1: Deploy seekdb in client/server mode
Prerequisites
Before deployment, ensure that your environment meets the following requirements:
-
Your environment is an RPM-based system. The following systems have been verified to be supported.
- Anolis OS 8.X (Linux kernel 3.10.0 or later)
- Alibaba Cloud Linux 2/3 (Linux kernel 3.10.0 or later)
- Red Hat Enterprise Linux Server 7.X, 8.X (Linux kernel 3.10.0 or later)
- CentOS Linux 7.X, 8.X (Linux kernel 3.10.0 or later)
- Debian 9.X or later (Linux kernel 3.10.0 or later)
- Ubuntu 20.X or later (Linux kernel 3.10.0 or later)
- SUSE/OpenSUSE 15.X or later (Linux kernel 3.10.0 or later)
- openEuler 22.03 and 24.03 (Linux kernel 5.10.0 or later)
- KylinOS V10
- UnionTech UOS 1020a/1021a/1021e/1001c
- NFSChina 4.0 or later
- Inspur KOS 5.8
-
The minimum CPU requirement for the current environment is 1 core.
-
The minimum available memory requirement for the current environment is 2 GB.
-
You have installed MySQL client in your environment.
-
The user you are using has permission to execute sudo commands.
-
Requirements for deploying using yum install:
- You have installed the jq command-line tool in your environment and correctly configured systemd as the system and service manager.
-
Requirements for deploying using Docker:
- You have installed Docker and started the Docker service.
Deploy seekdb using yum install
-
Add the seekdb image source.
sudo yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo -
Install seekdb.
sudo yum install seekdb obclient -
Start seekdb.
sudo systemctl start seekdb -
Check the startup status of seekdb.
sudo systemctl status seekdbIf the status is
Service is ready, seekdb has started normally. -
Connect to seekdb.
mysql -h127.0.0.1 -uroot -P2881 -A oceanbase
Deploy seekdb in a container environment
If Docker is installed and the Docker service is running in your environment, you can also deploy seekdb in a Docker container. For more information about Docker deployment, see Deploy seekdb in a container environment.
Start a seekdb instance directly.
sudo docker run -d -p 2881:2881 oceanbase/seekdb
If you fail to pull the Docker image, you can also pull it from the quay.io or ghcr.io repositories. Simply replace oceanbase/seekdb in the pull command with quay.io/oceanbase/seekdb or ghcr.io/oceanbase/seekdb, for example, execute sudo docker run -d -p 2881:2881 quay.io/oceanbase/seekdb to pull the image from quay.io.
Step 2: Connect to seekdb
Use the MySQL client to connect to seekdb. The specific connection command is as follows:
mysql -h127.0.0.1 -uroot -P2881 -p****** -A