1. 安装 [Python 3.9.5] 和 [pip]
疑似需要的版本区间是大于3.9且小于4.0,我使用的版本是3.9.6(官网下载慢,我使用国内镜像)
wget https://mirrors.huaweicloud.com/python/3.9.5/Python-3.9.5.tgz
依赖包安装
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel
2. 安装 [Poetry]
export PATH="$PATH:/usr/local/python3/bin"
/usr/local/python3/bin/python3 -m pip install poetry
这里还遇到个问题
raise ImportError(
ImportError: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.0.2k-fips 26 Jan 2017'. See: https://github.com/urllib3/urllib3/issues/2168
卸载重装
pip3 uninstall urllib3
pip3 install urllib3==1.26.15
我这下载非常慢。若想快速点可参考#AI 实战营 #使用OB搭建RAG 聊天机器人 - 社区问答- OceanBase社区-分布式数据库
3. clone项目
git clone https://github.com/oceanbase-devhub/ai-workshop-2024.git
4. 安装 Docker
yum install -y docker-ce
5. 部署 OceanBase 集群
5.1 启动 OceanBase docker 容器
systemctl start docker
5.2 启动一个 OceanBase docker 容器
docker run --ulimit stack=4294967296 --name=ob433 -e MODE=mini -e OB_MEMORY_LIMIT=8G -e OB_DATAFILE_SIZE=10G -e OB_CLUSTER_NAME=ailab2024 -p 127.0.0.1:2881:2881 -d quay.io/oceanbase/oceanbase-ce:4.3.3.1-101000012024102216
如果上述命令执行成功,将会打印容器 ID,如下所示:
f7095ace669670874d67bf43c42bdbd046430d954e6d3dda9a708ee99d4bd607
5.3 检查 OceanBase 初始化是否完成
容器启动后,您可以使用以下命令检查 OceanBase 数据库初始化状态:
docker logs -f ob433
初始化过程大约需要 2 ~ 3 分钟。当您看到以下消息(底部的 boot success!
是必须的)时,说明 OceanBase 数据库初始化完成:
[root@localhost ~]# docker logs -f ob433
+--------------------------------------------------+
| Cluster List |
+------+-------------------------+-----------------+
| Name | Configuration Path | Status (Cached) |
+------+-------------------------+-----------------+
| demo | /root/.obd/cluster/demo | stopped |
+------+-------------------------+-----------------+
Trace ID: 715efe88-a87d-11ef-b400-0242ac110002
If you want to view detailed obd logs, please run: obd display-trace 715efe88-a87d-11ef-b400-0242ac110002
repository/
.....................................................
.....................................................
.....................................................
[WARN] OBD-1007: (172.17.0.2) The recommended number of stack size is unlimited (Current value: 4194304)
[WARN] OBD-1017: (172.17.0.2) The value of the "vm.max_map_count" must be within [327600, 1310720] (Current value: 65530, Recommended value: 655360)
[WARN] OBD-1017: (172.17.0.2) The value of the "fs.file-max" must be greater than 6573688 (Current value: 760168, Recommended value: 6573688)
[ERROR] OBD-2000: (172.17.0.2) not enough memory. (Free: 248M, Buff/Cache: 4G, Need: 8G), Please reduce the `memory_limit` or `memory_limit_percentage`
[WARN] OBD-1012: (172.17.0.2) clog and data use the same disk (/)
[ERROR] OBD-2003: (172.17.0.2) / not enough disk space. (Avail: 14G, Need: 19G), Please reduce the `datafile_size` or `datafile_disk_percentage`
See https://www.oceanbase.com/product/ob-deployer/error-codes .
Trace ID: 786cb5f8-a87d-11ef-a08d-0242ac110002
If you want to view detailed obd logs, please run: obd display-trace 786cb5f8-a87d-11ef-a08d-0242ac110002
boot failed!
好了。我失败了。
报错:8G内存不足+50G磁盘空间不足
哈哈哈!!!
周六现场再云环境实验吧。