docker pull oceanbase/oceanbase-ce
#根据当前容器部署最大规格实例
docker run -p 2881:2881 --name obstandalone -e MINI_MODE=0 -d oceanbase/oceanbase-ce
#部署 mini 的独立实例
docker run -p 2881:2881 --name obstandalone -e MINI_MODE=1 -d oceanbase/oceanbase-ce
挂载数据卷版本
docker run -d -p 2881:2881 -v $PWD/ob:/root/ob -v $PWD/obd:/root/.obd --name oceanbase oceanbase/oceanbase-ce
启动预计需要 2~5 分钟。执行以下命令,如果返回 boot success!,则表示启动成功。
root@armbian:~# docker logs obstandalone | tail -1
boot success!
/// STEP 1: Config Generation ///
oceanbase-ce docker in mini mode
/// phase end: 0.155 s ///
/// STEP 2: Ob-deploy mirror clone ///
name: ob-configserver
version: 1.0.0
release:2.el7
arch: aarch64
md5: 35c121739b84e26b57dae1276ce33ba1186411e3
add /root/pkg/ob-configserver-1.0.0-2.el7.aarch64.rpm to local mirror
name: obagent
version: 4.2.1
release:100000092023101717.el7
arch: aarch64
md5: 4c0f5de0abc7c633454642540cb458b7a855aed2
add /root/pkg/obagent-4.2.1-100000092023101717.el7.aarch64.rpm to local mirror
name: oceanbase-ce
version: 4.2.1.2
release:102000042023120514.el7
arch: aarch64
md5: 080bd5dac6f6253fd2682331be3f1353856fd240
add /root/pkg/oceanbase-ce-4.2.1.2-102000042023120514.el7.aarch64.rpm to local mirror
name: oceanbase-ce-libs
version: 4.2.1.2
release:102000042023120514.el7
arch: aarch64
md5: f1db7c86312516a4d6bb4672dc1b4848a070b315
add /root/pkg/oceanbase-ce-libs-4.2.1.2-102000042023120514.el7.aarch64.rpm to local mirror
Trace ID: 90abbfc4-9c21-11ee-a331-0242ac110003
If you want to view detailed obd logs, please run: obd display-trace 90abbfc4-9c21-11ee-a331-0242ac110003
+-----------------------------------------------------------------------------------------------------------+
| local Package List |
+-------------------+---------+------------------------+---------+------------------------------------------+
| name | version | release | arch | md5 |
+-------------------+---------+------------------------+---------+------------------------------------------+
| ob-configserver | 1.0.0 | 2.el7 | aarch64 | 35c121739b84e26b57dae1276ce33ba1186411e3 |
| obagent | 4.2.1 | 100000092023101717.el7 | aarch64 | 4c0f5de0abc7c633454642540cb458b7a855aed2 |
| oceanbase-ce | 4.2.1.2 | 102000042023120514.el7 | aarch64 | 080bd5dac6f6253fd2682331be3f1353856fd240 |
| oceanbase-ce-libs | 4.2.1.2 | 102000042023120514.el7 | aarch64 | f1db7c86312516a4d6bb4672dc1b4848a070b315 |
+-------------------+---------+------------------------+---------+------------------------------------------+
Trace ID: 929fccc6-9c21-11ee-83e5-0242ac110003
If you want to view detailed obd logs, please run: obd display-trace 929fccc6-9c21-11ee-83e5-0242ac110003
/// phase end: 6.511 s ///
/// STEP 3: Ob-deploy deploy ///
Local deploy is empty
Trace ID: 944ce3f6-9c21-11ee-9cd1-0242ac110003
If you want to view detailed obd logs, please run: obd display-trace 944ce3f6-9c21-11ee-9cd1-0242ac110003
/// STEP 4: Ob-deploy autodeploy ///
Dev Mode: ON
Trace ID: 9603be54-9c21-11ee-b213-0242ac110003
If you want to view detailed obd logs, please run: obd display-trace 9603be54-9c21-11ee-b213-0242ac110003
[WARN] Use centos 7 remote mirror repository for anolis 8.8
Package oceanbase-ce-4.2.1.2-102000042023120514.el7 is available.
[WARN] Use centos 7 remote mirror repository for anolis 8.8
Package obagent-4.2.1-100000092023101717.el7 is available.
install oceanbase-ce-4.2.1.2 for local ok
install obagent-4.2.1 for local ok
Cluster param config check ok
Open ssh connection ok
Generate observer configuration ok
Generate obagent configuration ok
[WARN] Use centos 7 remote mirror repository for anolis 8.8
[WARN] Use centos 7 remote mirror repository for anolis 8.8
+--------------------------------------------------------------------------------------------+
| Packages |
+--------------+---------+------------------------+------------------------------------------+
| Repository | Version | Release | Md5 |
+--------------+---------+------------------------+------------------------------------------+
| oceanbase-ce | 4.2.1.2 | 102000042023120514.el7 | 080bd5dac6f6253fd2682331be3f1353856fd240 |
| obagent | 4.2.1 | 100000092023101717.el7 | 4c0f5de0abc7c633454642540cb458b7a855aed2 |
+--------------+---------+------------------------+------------------------------------------+
Repository integrity check ok
Parameter check ok
Cluster status check ok
Initializes observer work home ok
Initializes obagent work home ok
Remote oceanbase-ce-4.2.1.2-102000042023120514.el7-080bd5dac6f6253fd2682331be3f1353856fd240 repository install ok
Remote oceanbase-ce-4.2.1.2-102000042023120514.el7-080bd5dac6f6253fd2682331be3f1353856fd240 repository lib check !!
Remote obagent-4.2.1-100000092023101717.el7-4c0f5de0abc7c633454642540cb458b7a855aed2 repository install ok
Remote obagent-4.2.1-100000092023101717.el7-4c0f5de0abc7c633454642540cb458b7a855aed2 repository lib check ok
Try to get lib-repository
[WARN] Use centos 7 remote mirror repository for anolis 8.8
Package oceanbase-ce-libs-4.2.1.2-102000042023120514.el7 is available.
install oceanbase-ce-libs-4.2.1.2 for local ok
Remote oceanbase-ce-libs-4.2.1.2-102000042023120514.el7-f1db7c86312516a4d6bb4672dc1b4848a070b315 repository install ok
Remote oceanbase-ce-4.2.1.2-102000042023120514.el7-080bd5dac6f6253fd2682331be3f1353856fd240 repository lib check ok
obcluster deployed
Get local repositories ok
Search plugins ok
Open ssh connection ok
Load cluster param plugin ok
Check before start observer ok
[WARN] OBD-1011: (172.17.0.3) The recommended value of fs.aio-max-nr is 1048576 (Current value: 65536)
[WARN] OBD-1007: (172.17.0.3) The recommended number of stack size is unlimited (Current value: 8192)
[WARN] OBD-1017: (172.17.0.3) The value of the "vm.max_map_count" must be within [327600, 1310720] (Current value: 262144, Recommended value: 655360)
[WARN] OBD-2000: (172.17.0.3) not enough memory. (Free: 192.7M, Buff/Cache: 3.0G, Need: 6.0G)
[WARN] OBD-1012: (172.17.0.3) clog and data use the same disk (/)
Check before start obagent ok
Start observer ok
observer program health check ok
Connect to observer ok
Initialize oceanbase-ce ok
Start obagent ok
obagent program health check ok
Connect to Obagent ok
Wait for observer init ok
+----------------------------------------------+
| observer |
+------------+---------+------+-------+--------+
| ip | version | port | zone | status |
+------------+---------+------+-------+--------+
| 172.17.0.3 | 4.2.1.2 | 2881 | zone1 | ACTIVE |
+------------+---------+------+-------+--------+
obclient -h172.17.0.3 -P2881 -uroot -Doceanbase -A
+---------------------------------------------------------------+
| obagent |
+------------+--------------------+--------------------+--------+
| ip | mgragent_http_port | monagent_http_port | status |
+------------+--------------------+--------------------+--------+
| 172.17.0.3 | 8089 | 8088 | active |
+------------+--------------------+--------------------+--------+
obcluster running
Trace ID: 97a8f238-9c21-11ee-b805-0242ac110003
If you want to view detailed obd logs, please run: obd display-trace 97a8f238-9c21-11ee-b805-0242ac110003
/// phase end: 180.265 s ///
/// STEP 5: Ob-deploy Create Tenant ///
Get local repositories and plugins ok
Open ssh connection ok
Connect to observer ok
Create tenant test ok
Trace ID: 02cee2b6-9c22-11ee-a370-0242ac110003
If you want to view detailed obd logs, please run: obd display-trace 02cee2b6-9c22-11ee-a370-0242ac110003
/// phase end: 122.693 s ///
deploy success!
boot success!
# 可以通过 root 用户连接到 oceanbase,无需密码
docker exec -it obstandalone ob-mysql sys # 使用 root 用户登录集群的 sys 租户
docker exec -it obstandalone ob-mysql root # 使用 root 用户登录集群的 test 租户
docker exec -it obstandalone ob-mysql test # 使用 test 用户登录集群的 test 租户
obclient -uroot@sys -h127.1 -P2881
root@armbian:~# mysql -uroot -h127.1 -P2881
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 3221487879
Server version: 5.7.25 OceanBase_CE 4.2.1.2 (r102000042023120514-ccdde7d34de421336c5362483d64bf2b73348bd4) (Built Dec 5 2023 14:34:15)
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)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| LBACSYS |
| mysql |
| oceanbase |
| ORAAUDITOR |
| SYS |
| test |
+--------------------+
7 rows in set (0.028 sec)
root@armbian:~# mysql -uroot -h127.1 -P2881
Command 'mysql' not found, but can be installed with:
apt install mariadb-client-core-10.5
root@armbian:~# apt install mariadb-client-core-10.5
/home/OceanBase/ob
和/home/OceanBase/bos
/home/OceanBase
|--ob
|--obs