Docker方式部署OceanBase數(shù)據(jù)庫的完整步驟
前言
OceanBase是阿里巴巴、螞蟻金服自主研發(fā)的可擴展的分布式關系數(shù)據(jù)庫。
具體介紹可以參考官網

一、Docker方式部署oceanbase
OceanBase是阿里巴巴、螞蟻金服自主研發(fā)的可擴展的分布式關系數(shù)據(jù)庫。
二、OceanBase安裝步驟
1.拉取oceanbase鏡像
代碼如下(示例):
[root@localhost ~]# docker pull quay.io/oceanbase/oceanbase-ce Using default tag: latest latest: Pulling from oceanbase/oceanbase-ce 54273d8675f3: Pull complete 4f4fb700ef54: Pull complete e564f00d9405: Pull complete e5af5c4b8706: Pull complete 4facaa54b636: Pull complete 40903d073efe: Pull complete 29821a1484a7: Pull complete 7ad97f3e2e5f: Pull complete f4965e7c3ff4: Pull complete 6bcbbaa7a350: Pull complete c855931abb7c: Pull complete 3ea130b1a014: Pull complete 543dbe8ed2e5: Pull complete 2dcb3d49ca6c: Pull complete 58a4bd5b99d8: Pull complete 5c9484abca8d: Pull complete 8ce058257b10: Pull complete 62486627ca76: Pull complete Digest: sha256:13cd5a03f632a2fcd254005c0182d55890e1f783bec2a15e77f5b783a2e3547f Status: Downloaded newer image for quay.io/oceanbase/oceanbase-ce:latest quay.io/oceanbase/oceanbase-ce:latest You have mail in /var/spool/mail/root
2.啟動oceanbase容器
代碼如下(示例):
[root@localhost ~]# docker run -p 2881:2881 --name oceanbase-ce -e MINI_MODE=0 -d quay.io/oceanbase/oceanbase-ce 41103400ca56e0447f4fa67ad1ca404acb23dbe4767241d273e1a0bd404135eb
3.查看oceanbase初始化的日志信息
代碼如下(示例):
[root@localhost ~]# docker logs oceanbase-ce +--------------------------------------------------+ | Cluster List | +------+-------------------------+-----------------+ | Name | Configuration Path | Status (Cached) | +------+-------------------------+-----------------+ | demo | /root/.obd/cluster/demo | stopped | +------+-------------------------+-----------------+ Trace ID: 94fba882-e9b4-11ef-8b1e-0242ac110002 Open ssh connection ok [WARN] OBD-1007: (172.17.0.2) The recommended number of stack size is unlimited (Current value: 8192) [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-2000: (172.17.0.2) not enough memory. (Free: 5G, Need: 6G) [WARN] OBD-1012: (172.17.0.2) clog and data use the same disk (/) cluster scenario: express_oltp Start observer ok observer program health check ok Connect to observer ok Cluster bootstrap ok obshell start ok obshell program health check ok obshell bootstrap ok Connect to observer ok Wait for observer init ok +-----------------------------------------------+ | oceanbase-ce | +------------+----------+------+-------+--------+ | ip | version | port | zone | status | +------------+----------+------+-------+--------+ | 172.17.0.2 | 4.2.1.10 | 2881 | zone1 | ACTIVE | +------------+----------+------+-------+--------+ obclient -h172.17.0.2 -P2881 -uroot -Doceanbase -A cluster unique id: bf2e78c3-e718-587c-8a8c-bc579b0ce06d-194fd337e8f-0a010204 obcluster running Trace ID: 9c8cf858-e9b4-11ef-a485-0242ac110002 If you want to view detailed obd logs, please run: obd display-trace 9c8cf858-e9b4-11ef-a485-0242ac110002 Get local repositories ok Open ssh connection ok Connect to observer ok Create tenant test ok Exec oceanbase-ce-4.2.1.10-110000072024112010.el8-b03c714bf9d03e3424203240514359a9e8b9317a import_time_zone_info.py ok Exec oceanbase-ce-4.2.1.10-110000072024112010.el8-b03c714bf9d03e3424203240514359a9e8b9317a import_srs_data.py ok
4.進入oceanbase容器
代碼如下(示例):
[root@localhost ~]# docker exec -it oceanbase-ce bash
5.啟動oceanbase容器
代碼如下(示例):
[root@localhost ~]# docker run -p 2881:2881 --name oceanbase-ce -e MINI_MODE=0 -d quay.io/oceanbase/oceanbase-ce 41103400ca56e0447f4fa67ad1ca404acb23dbe4767241d273e1a0bd404135eb
6.進入oceanbase容器
代碼如下(示例):
[root@localhost ~]# docker exec -it oceanbase-ce bash
7.查看集群詳情
代碼如下(示例):
[root@41103400ca56 ~]# obd cluster list +------------------------------------------------------------+ | Cluster List | +-----------+------------------------------+-----------------+ | Name | Configuration Path | Status (Cached) | +-----------+------------------------------+-----------------+ | demo | /root/.obd/cluster/demo | stopped | | obcluster | /root/.obd/cluster/obcluster | running | +-----------+------------------------------+-----------------+ Trace ID: 4bfc8eec-e9b6-11ef-8d62-0242ac110002 If you want to view detailed obd logs, please run: obd display-trace 4bfc8eec-e9b6-11ef-8d62-0242ac110002 [root@41103400ca56 ~]# obd cluster display obcluster Get local repositories and plugins ok Open ssh connection ok Connect to observer 172.17.0.2:2881 ok Wait for observer init ok +-----------------------------------------------+ | oceanbase-ce | +------------+----------+------+-------+--------+ | ip | version | port | zone | status | +------------+----------+------+-------+--------+ | 172.17.0.2 | 4.2.1.10 | 2881 | zone1 | ACTIVE | +------------+----------+------+-------+--------+ obclient -h172.17.0.2 -P2881 -uroot -Doceanbase -A cluster unique id: bf2e78c3-e718-587c-8a8c-bc579b0ce06d-194fd337e8f-0a010204 Trace ID: 5c730850-e9b6-11ef-9d33-0242ac110002 If you want to view detailed obd logs, please run: obd display-trace 5c730850-e9b6-11ef-9d33-0242ac110002

8.連接oceanbase數(shù)據(jù)庫
代碼如下(示例):
[root@localhost ~]# docker exec -it oceanbase-ce obclient -h127.0.0.1 -P2881 -uroot@sys -A Welcome to the OceanBase. Commands end with ; or \g. Your OceanBase connection id is 3221487677 Server version: OceanBase_CE 4.2.1.10 (r110000072024112010-28c1343085627e79a4f13c29121646bb889cf901) (Built Nov 20 2024 10:11:18) 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.
9.修改root密碼(默認root密碼為空)
代碼如下(示例):
obclient(root@sys)[(none)]> ALTER USER root IDENTIFIED BY '123456'; Query OK, 0 rows affected (0.062 sec)
10.新密碼連接
代碼如下(示例):
[root@localhost ~]# docker exec -it oceanbase-ce bash [root@41103400ca56 ~]# obclient -uroot@sys -h127.1 -P2881 -A -p123456 Welcome to the OceanBase. Commands end with ; or \g. Your OceanBase connection id is 3221487684 Server version: OceanBase_CE 4.2.1.10 (r110000072024112010-28c1343085627e79a4f13c29121646bb889cf901) (Built Nov 20 2024 10:11:18) 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@sys)[(none)]>
總結
到此這篇關于Docker方式部署OceanBase數(shù)據(jù)庫的文章就介紹到這了,更多相關Docker部署OceanBase數(shù)據(jù)庫內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
Docker 容器監(jiān)控原理及 cAdvisor的安裝與使用說明
這篇文章主要介紹了Docker 容器監(jiān)控原理及 cAdvisor的安裝與使用說明,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-11-11
docker swarm如何在指定的node上運行指定的容器
這篇文章主要介紹了docker swarm如何在指定的node上運行指定的容器,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-07-07
如何使用Docker和cpolar在Linux服務器上搭建DashDot監(jiān)控面板
本文主要介紹如何在Linux服務器上使用Docker和cpolar技術搭建DashDot監(jiān)控面板,實現(xiàn)實時服務器監(jiān)控,DashDot提供直觀的監(jiān)控界面和豐富的指標,通過cpolar可以實現(xiàn)公網訪問,方便用戶隨時了解服務器狀態(tài),文章詳細說明了環(huán)境準備、安裝Docker、配置DashDot和cpolar的步驟2024-09-09
docker部署nodejs開發(fā)環(huán)境詳細步驟(基礎示例篇)
這篇文章主要給大家介紹了docker部署nodejs開發(fā)環(huán)境詳細步驟,docker是一個開源的應用容器引擎,可以為我們提供安全、可移植、可重復的自動化部署的方式,需要的朋友可以參考下2023-10-10

