Docker安裝部署分布式數(shù)據(jù)庫(kù)?OceanBase的詳細(xì)過(guò)程
前言
快速的體驗(yàn) OceanBase 的 自動(dòng)化部署過(guò)程,以及了解 OceanBase 集群安裝成功后的目錄特點(diǎn)和使用方法
?? 1.什么是OceanBase
OceanBase是由螞蟻集團(tuán)完全自主研發(fā)的國(guó)產(chǎn)原生分布式數(shù)據(jù)庫(kù) ,始創(chuàng)于2010年。已連續(xù)9年平穩(wěn)支撐雙11, 創(chuàng)新推出“三地五中心”城市級(jí)容災(zāi)新標(biāo)準(zhǔn) ,是一個(gè)在TPC-C和TPC-H測(cè)試上都刷新了世界紀(jì)錄的國(guó)產(chǎn)原生分布式數(shù)據(jù)庫(kù)。 產(chǎn)品采用自研的一體化架構(gòu),兼顧分布式架構(gòu)的擴(kuò)展性與集中式架構(gòu)的性能優(yōu)勢(shì),用一套引擎同時(shí)支持TP和AP的混合負(fù)載, 具有數(shù)據(jù)強(qiáng)一致、高可用、高性能、在線擴(kuò)展、高度兼容SQL標(biāo)準(zhǔn)和主流關(guān)系數(shù)據(jù)庫(kù)、低成本等特點(diǎn)。
?? 2.硬件要求
1.有筆記本或服務(wù)器,內(nèi)存至少12G 。
2.操作系統(tǒng)不限,能安裝 Docker 環(huán)境即可。
Docker 官方鏡像:https://hub.docker.com/r/obpilot/oceanbase-ce
?? 3.docker部署OceanBase
? 3.1 下載ob docker鏡像
?????? 下載鏡像:
docker pull obpilot/oceanbase-ce:latest
? 3.2 創(chuàng)建容器
?????? 新容器創(chuàng)建
docker run -itd -m 10G -p 2881:2881 -p 2883:2883
–name oceanbase-ce obpilot/oceanbase-ce:latest
?????? 進(jìn)入容器
[root@jeames ~]# docker exec -it oceanbase-ce bash
進(jìn)入容器后,可以看看 readme.md 文檔
? 3.3 obd工具查看集群及啟動(dòng)
-- 查看集群列表 [admin@3ef732cfb95a ~]$ obd cluster list 配置文件:/home/admin/.obd/cluster/obdemo/config.yaml
-- 啟動(dòng)集群 [admin@3ef732cfb95a ~]$ obd cluster start obdemo 如果遇到以下兩個(gè)報(bào)錯(cuò) [ERROR] (127.0.0.1) open files number must not be less than 20000 (Current value: 1024) [ERROR] (127.0.0.1) not enough memory. (Free: 6.7G, Need: 8.0G) 一個(gè)是用戶最大打開(kāi)文件數(shù)不夠,一個(gè)是可用內(nèi)存不足8G,解決后成功啟動(dòng)。
[admin@3ef732cfb95a ~]$ obd cluster list +------------------------------------------------------------+ | Cluster List | +--------+---------------------------------+-----------------+ | Name | Configuration Path | Status (Cached) | +--------+---------------------------------+-----------------+ | obdemo | /home/admin/.obd/cluster/obdemo | running | +--------+---------------------------------+-----------------+ [admin@3ef732cfb95a ~]$ netstat -tulnp | grep 88 tcp 0 0 0.0.0.0:2881 0.0.0.0:* LISTEN 95/observer tcp 0 0 0.0.0.0:2882 0.0.0.0:* LISTEN 95/observer tcp 0 0 0.0.0.0:2883 0.0.0.0:* LISTEN 714/obproxy tcp 0 0 0.0.0.0:2884 0.0.0.0:* LISTEN 714/obproxy
? 3.4 登錄ob數(shù)據(jù)庫(kù)并創(chuàng)建租戶
admin 用戶的密碼是 : adminPWD123
[admin@3ef732cfb95a ~]$ obclient -h127.1 -uroot@sys#obce-single -P2883 -prootPWD123 -c -A oceanbase Welcome to the OceanBase. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.6.25 OceanBase 3.1.1 (r4-8c615943cbd25a6f7b8bdfd8677a13a21709a05e) (Built Oct 21 2021 10:52:05) 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 [oceanbase]> show databases; +--------------------+ | Database | +--------------------+ | oceanbase | | information_schema | | mysql | | SYS | | LBACSYS | | ORAAUDITOR | | test | +--------------------+ 7 rows in set (0.014 sec)
?????? 創(chuàng)建資源單元、資源池、租戶
MySQL [oceanbase]> CREATE resource unit S4C1G max_cpu=4, min_cpu=4, max_memory='1G', min_memory='1G', max_iops=10000, min_iops=1000, max_session_num=1000000, max_disk_size='1024G'; MySQL [oceanbase]> CREATE resource pool my_pool unit = 'S4C1G', unit_num = 1; MySQL [oceanbase]> create tenant obmysql resource_pool_list=('my_pool'), primary_zone='RANDOM',comment 'mysql tenant/instance', charset='utf8' set ob_tcp_invited_nodes='%', ob_compatibility_mode='mysql';
? 3.5 登錄obmysql tenant并創(chuàng)建數(shù)據(jù)庫(kù)及表等
[admin@3ef732cfb95a ~]$ obclient -h 127.1 -uroot@obmysql#obce-single -P2883 -p -c -A test Enter password: Welcome to the OceanBase. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 5.6.25 OceanBase 3.1.1 (r4-8c615943cbd25a6f7b8bdfd8677a13a21709a05e) (Built Oct 21 2021 10:52:05) 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 [test]> show databases; +--------------------+ | Database | +--------------------+ | oceanbase | | information_schema | | mysql | | test | +--------------------+ 4 rows in set (0.005 sec) MySQL [test]> create database mesdb charset utf8mb4; Query OK, 1 row affected (0.118 sec) MySQL [test]> use mesdb Database changed MySQL [mesdb]> MySQL [mesdb]> MySQL [mesdb]> MySQL [mesdb]> source /tmp/mysql_employees.sql
到此這篇關(guān)于Docker安裝部署分布式數(shù)據(jù)庫(kù) OceanBase的文章就介紹到這了,更多相關(guān)Docker安裝OceanBase內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
解決Docker之mysql容器數(shù)據(jù)庫(kù)更改不生效的問(wèn)題
這篇文章主要介紹了解決Docker之mysql容器數(shù)據(jù)庫(kù)更改不生效的問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2020-11-11Dockerfile中yum install無(wú)法使用的問(wèn)題及解決
在使用Dockerfile自定義CentOS 7容器過(guò)程中,可能會(huì)遇到容器內(nèi)無(wú)法使用yum命令的問(wèn)題,首先,確認(rèn)主機(jī)是否能聯(lián)網(wǎng),其次,檢查在Dockerfile打包新容器時(shí),容器是否能聯(lián)網(wǎng),若發(fā)現(xiàn)容器無(wú)法聯(lián)網(wǎng),一種解決方法是編輯/etc/docker/daemon.json文件2024-11-11Docker buildx構(gòu)建多平臺(tái)鏡像并推送到私有倉(cāng)庫(kù)的方法
這篇文章主要介紹了Docker buildx構(gòu)建多平臺(tái)鏡像并推送到私有倉(cāng)庫(kù),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2020-01-01docker容器數(shù)據(jù)卷之具名掛載和匿名掛載問(wèn)題
容器數(shù)據(jù)卷就是目錄的掛載,將我們的容器的目錄掛載到宿主機(jī)上,從而實(shí)現(xiàn)打通宿主機(jī)和容器之間的文件共享功能,這篇文章主要介紹了docker容器數(shù)據(jù)卷 - 具名掛載和匿名掛載問(wèn)題,需要的朋友可以參考下2021-11-11Docker部署及使用壓測(cè)神器sysbench的方法
sysbench 是一個(gè)開(kāi)源跨平臺(tái)的多線程性能測(cè)試工具,這篇文章主要介紹了Docker部署及使用壓測(cè)神器sysbench的相關(guān)知識(shí),需要的朋友可以參考下2022-08-08從零搭建docker+jenkins+node.js自動(dòng)化部署環(huán)境的方法
這篇文章主要介紹了從零搭建docker+jenkins+node.js自動(dòng)化部署環(huán)境的方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2019-01-01docker啟動(dòng)容器服務(wù)后訪問(wèn)失敗的解決方案
初學(xué)Docker容器的基本操作,拉取了tomcat鏡像,輸入運(yùn)行容器命令運(yùn)行容器一系列操作都沒(méi)有問(wèn)題,但是在瀏覽器訪問(wèn)端口時(shí)卻訪問(wèn)不到,下面這篇文章主要給大家介紹了關(guān)于docker啟動(dòng)容器服務(wù)后訪問(wèn)失敗的解決方案,需要的朋友可以參考下2023-05-05