CentOS 7.6安装OceanBase seekdb
什么是 OceanBase seekdb?
OceanBase seekdb 是 OceanBase 打造的一款开发者友好的 AI 原生数据库产品,专注于为 AI 应用提供高效的混合搜索能力。它支持向量、文本、结构化与半结构化数据的统一存储与检索,并通过内置 AI Functions 支持数据嵌入、重排与库内实时推理。seekdb 在继承 OceanBase 核心引擎高性能优势与 MySQL 全面兼容特性的基础上,通过深度优化数据搜索架构,为开发者提供更符合 AI 应用数据处理需求的解决方案。
参考: https://github.com/oceanbase/seekdb/blob/develop/README_CN.md
服务器配置要求
服务器应满足的最低配置要求如下表所示。
部署产品 | 服务器数量 | 最低配置 | 磁盘类型 |
seekdb | 1 台 | 最低要求:CPU 1 核,可用内存 2G | SSD 存储 |
部署前准备
1. 内存检查
[root@cherry ~]# free -gtotal used free shared buff/cache availableMem: 3 0 2 0 0 0Swap: 1 0 1
2. 创建用户
创建普通用户并为普通用户设置 sudo 权限
创建用户组 admin 以及创建用户 admin[root@cherry ~]# useradd -U admin -d /home/admin -s /bin/bash[root@cherry ~]# chown -R admin:admin /home/admin为账户 admin 设置密码[root@cherry ~]# passwd admin为账户 admin 设置 sudo 权限[root@cherry ~]# vi /etc/sudoers --文件末尾添加如下内容## Same thing without a password# %wheel ALL=(ALL) NOPASSWD: ALLadmin ALL=(ALL) NOPASSWD: ALL
3. 规划磁盘
官方建议创建数据盘/data/1、事务日志盘/data/log1,此处我只是个人学习使用,不再单独划盘,使用配置参数data_dir指定的目录安装。
4. 配置 limits.conf限制进程数量
如果是个人用户,可以跳过此步骤。如果是企业用户,建议配置 limits.conf。
将会话级别的最大栈空间大小设置为 unlimited,最大文件句柄数设置为 655350,Core 文件大小设置为 unlimited。[root@cherry ~]# vi /etc/security/limits.conf* soft nofile 655350* hard nofile 655350* soft stack unlimited* hard stack unlimited* soft nproc 655360* hard nproc 655360* soft core unlimited* hard core unlimited
5. 配置 sysctl.conf
如果是个人用户,可以跳过此步骤;如果是企业用户,建议配置 sysctl.conf。
[root@cherry ~]# vi /etc/sysctl.conf# for seekdb## 修改内核异步 I/O 限制fs.aio-max-nr = 1048576## 网络优化net.core.somaxconn = 2048net.core.netdev_max_backlog = 10000net.core.rmem_default = 16777216net.core.wmem_default = 16777216net.core.rmem_max = 16777216net.core.wmem_max = 16777216net.ipv4.ip_forward = 0net.ipv4.conf.default.rp_filter = 1net.ipv4.conf.default.accept_source_route = 0net.ipv4.tcp_syncookies = 1net.ipv4.tcp_rmem = 4096 87380 16777216net.ipv4.tcp_wmem = 4096 65536 16777216net.ipv4.tcp_max_syn_backlog = 16384net.ipv4.tcp_fin_timeout = 15net.ipv4.tcp_slow_start_after_idle=0vm.swappiness = 0vm.min_free_kbytes = 2097152vm.overcommit_memory = 0fs.file-max = 6573688fs.pipe-user-pages-soft = 0# 修改进程可以拥有的虚拟内存区域数量vm.max_map_count = 655360# 设置 core 文件的文件名格式以及目录kernel.core_pattern = /home/admin/core-%e-%p-%t
更改配置后,执行命令: sysctl -p 使配置生效。
6. 关闭防火墙和 SELinux
关闭防火墙:
[root@cherry ~]# systemctl disable firewalld[root@cherry ~]# systemctl stop firewalld[root@cherry ~]# systemctl status firewalld
关闭 SELinux:
在 /etc/selinux/config 配置文件中修改对应配置项为以下内容:
SELINUX=disabled执行命令setenforce 0 使更改生效。
RPM安装seekdb
根据所用环境能否连接外部网络,分为在线安装和离线安装两种安装方法。
- 在线安装
添加 seekdb 镜像源
[root@cherry ~]# yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo安装 seekdb
[root@cherry ~]# yum install seekdb obclient离线安装
https://github.com/oceanbase/seekdb/releases/tag/v1.0.0
在github下载对应操作系统的rpm安装包,并上传到目录下。
[root@cherry ~]# lsseekdb-1.0.0.0-100000262025111218.el7.x86_64.rpm[root@cherry ~]# rpm -ivh seekdb-*.rpmPreparing... ################################# [100%]execute pre install scriptUpdating / installing...1:seekdb-1.0.0.0-100000262025111218################################# [100%]execute post install scriptTo configure OceanBase : edit /etc/oceanbase/seekdb.cnfTo start OceanBase : systemctl start seekdbTo enable OceanBase auto reboot : systemctl enable seekdbTo get more infomation : https://www.oceanbase.com/docs
安装obclient
# 下载wget https://mirrors.oceanbase.com/community/stable/el/7/x86_64/obclient-2.2.10-4.el7.x86_64.rpm# 安装rpm -ivh obclient-*.rpm
查看配置文件
[root@cherry ~]# cat /etc/oceanbase/seekdb.cnfport=2881base-dir=/var/lib/oceanbasedata-dir=/var/lib/oceanbase/storeredo-dir=/var/lib/oceanbase/store/redodatafile_size=2Gdatafile_next=2Gdatafile_maxsize=50Gcpu_count=4memory_limit=2Glog_disk_size=2G
连接seekdb
[root@cherry ~]# obclient -h127.0.0.1 -uroot -P2881 -p -A oceanbaseEnter password: --密码为空,回车即可Welcome to the OceanBase. Commands end with ; or \g.Your OceanBase connection id is 3221492502Server version: OceanBase 4.3.5.3 SeekDB (r1.0.0.0) (Built 100000262025111218-5343637512e28c346f938516af53b7879d4d5974 Nov 12 2025)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]> show databases;+--------------------+| Database |+--------------------+| information_schema || mysql || oceanbase || ocs || sys_external_tbs || test |+--------------------+6 rows in set (0.003 sec)obclient(root@(none))[oceanbase]> select version();+----------------------------------+| version() |+----------------------------------+| 5.7.25-OceanBase SeekDB-v1.0.0.0 |+----------------------------------+
登录网页版seekdb
http://host_ip:2883
卸载seekdb
## 停止seekdb[root@cherry ~]# systemctl stop seekdb## 卸载seekdb[root@cherry ~]# rpm -qa | grep seekdbseekdb-1.0.0.0-100000262025111218.el7.x86_64[root@cherry ~]# rpm -e seekdb-1.0.0.0-100000262025111218.el7.x86_64
由此可见seekdb对配置要求较低,虚拟机也可以稳定安装。