首页 > 其他分享 >通过docker快速部署oceanbase单机库

通过docker快速部署oceanbase单机库

时间:2023-04-18 17:33:12浏览次数:45  
标签:ok observer oceanbase obd io docker 机库

docker方式部署oceanbase单库

提示:

  系统可用内存不能低于6G。

  根目录(/)剩余磁盘空间不能小于30G。

 

1. 搜索oceanbase的镜像

[root]# docker search oceanbase
INDEX       NAME                                         DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
docker.io   docker.io/oceanbase/oceanbase-ce             OceanBase is an open-source, distributed H...   13                   
docker.io   docker.io/obpilot/oceanbase-ce               3 steps to run an OceanBase-CE docker in y...   4                    
docker.io   docker.io/oceanbase/oceanbase-xe             OceanBase Database 2.2 Express Edition          4                    
docker.io   docker.io/oceanbase/obce-mini                obce-mini is a mini standalone test image ...   3                    
docker.io   docker.io/oceanbase/miniob                   miniob database competition                     2                    
docker.io   docker.io/oceanbase/obce-operator            obce-operator                                   1                    
docker.io   docker.io/zibuyu886/oceanbase-ce-cluster     OceanBase ce cluster                            1                    
docker.io   docker.io/datatomdev/oceanbase                                                               0                    
docker.io   docker.io/hnwyllmm/oceanbase-ce                                                              0                    
docker.io   docker.io/hongxinsun/oceanbase-cn                                                            0                    
docker.io   docker.io/huweijie/oceanbase-ce-deploy                                                       0                    
docker.io   docker.io/livesa/oceanbase                                                                   0                    
docker.io   docker.io/oceanbase/centos7                                                                  0                    
docker.io   docker.io/oceanbase/ob-operator                                                              0                    
docker.io   docker.io/oceanbase/obagent                                                                  0                    
docker.io   docker.io/oceanbase/obproxy-ce                                                               0                    
docker.io   docker.io/oceanbase/oceanbase-cloud-native                                                   0                    
docker.io   docker.io/oceanbasedev/create_tenant                                                         0                    
docker.io   docker.io/oceanbasedev/ob-operator                                                           0                    
docker.io   docker.io/oceanbasedev/obagent                                                               0                    
docker.io   docker.io/oceanbasedev/obproxy                                                               0                    
docker.io   docker.io/oceanbasedev/obproxy-ce                                                            0                    
docker.io   docker.io/oceanbasedev/oceanbase-cn                                                          0                    
docker.io   docker.io/oceanbasedev/sealer-ob                                                             0                    
docker.io   docker.io/superbigfu/oceanbase                                                               0   

 

2. 拉取oceanbase的镜像

[root]# docker pull docker.io/oceanbase/oceanbase-ce

 

3. 创建oceanbase的容器

[root]# docker run -p 2881:2881 --name oceanbase_01 -d -e OB_HOME_PATH="/data/oceanbase/" -e OB_TENANT_NAME="obmysql" docker.io/oceanbase/oceanbase-ce

 

4. 查看oceanbase初始化的日志信息

[root]# docker logs oceanbase_01
find obd deploy information, skip configuring...
start ob cluster ...
Get local repositories ok
Search plugins ok
Open ssh connection ok
Load cluster param plugin ok
Check before start observer ok
[WARN] OBD-1012: (127.0.0.1) 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 |
+-----------+---------+------+-------+--------+
| 127.0.0.1 | 4.1.0.0 | 2881 | zone1 | ACTIVE |
+-----------+---------+------+-------+--------+
obclient -h127.0.0.1 -P2881 -uroot -Doceanbase -A
+---------------------------------------------------------------+
|                            obagent                            |
+------------+--------------------+--------------------+--------+
| ip         | mgragent_http_port | monagent_http_port | status |
+------------+--------------------+--------------------+--------+
| 172.17.0.2 | 8089               | 8088               | active |
+------------+--------------------+--------------------+--------+
obcluster running
Trace ID: 04d991cc-d810-11ed-9ee3-0242ac110002
If you want to view detailed obd logs, please run: obd display-trace 04d991cc-d810-11ed-9ee3-0242ac110002
boot success!

 

简单入门与使用

5. 登录oceanbase_01容器

[root]# docker exec -it oceanbase_01 bash

 

登录oceanbase_01容器后,使用obclient连接observer(默认没有密码)

[root]# obclient -h127.0.0.1 -P2881 -uroot -Doceanbase -A

或者通过mysqlclient连接observer

[root]# mysql -h127.0.0.1 -P2881 -uroot -Doceanbase -A -p

 

observer兼容MySQL 5.7,可以适用mysql常规命令操作oceanbase

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| LBACSYS            |
| mysql              |
| oceanbase          |
| ORAAUDITOR         |
| SYS                |
| test               |
+--------------------+
7 rows in set (0.05 sec)

 

查看集群信息,获取集群名称

[root@84bd979e6c7e ~]# obd cluster list
+------------------------------------------------------------+
|                        Cluster List                        |
+-----------+------------------------------+-----------------+
| Name      | Configuration Path           | Status (Cached) |
+-----------+------------------------------+-----------------+
| obcluster | /root/.obd/cluster/obcluster | running         |
+-----------+------------------------------+-----------------+
Trace ID: 2b31a7f6-ddc9-11ed-b97a-0242ac110002
If you want to view detailed obd logs, please run: obd display-trace 2b31a7f6-ddc9-11ed-b97a-0242ac110002

 

查看集群组件信息

[root@84bd979e6c7e ~]# obd cluster display obcluster
Get local repositories and plugins ok
Open ssh connection ok
Cluster status check ok
Connect to observer ok
Wait for observer init ok
+---------------------------------------------+
|                   observer                  |
+-----------+---------+------+-------+--------+
| ip        | version | port | zone  | status |
+-----------+---------+------+-------+--------+
| 127.0.0.1 | 4.1.0.0 | 2881 | zone1 | ACTIVE |
+-----------+---------+------+-------+--------+
obclient -h127.0.0.1 -P2881 -uroot -Doceanbase -A

Connect to Obagent ok
+---------------------------------------------------------------+
|                            obagent                            |
+------------+--------------------+--------------------+--------+
| ip         | mgragent_http_port | monagent_http_port | status |
+------------+--------------------+--------------------+--------+
| 172.17.0.2 | 8089               | 8088               | active |
+------------+--------------------+--------------------+--------+
Trace ID: 3f86a36e-ddc9-11ed-a3f9-0242ac110002
If you want to view detailed obd logs, please run: obd display-trace 3f86a36e-ddc9-11ed-a3f9-0242ac110002

 

 关闭obcluster集群

[root]# obd cluster  stop obcluster

 

启动obcluster集群

[root]# obd cluster start obcluster

 

 参考:https://developer.aliyun.com/article/789554

标签:ok,observer,oceanbase,obd,io,docker,机库
From: https://www.cnblogs.com/haha029/p/17330326.html

相关文章

  • docker-compose 安装
    1、安装 pip:#yum-yinstallepel-release# yum-yinstallpython-pip#pipinstall --upgradepip 2、安装Docker-Compose:#pipinstalldocker-compose 3、查看版本#docker-compose-version 4、启动#docker-composeup-d  可能的报错:1.pip升级......
  • docker升级gitlab
    昨天在家部署了gitlab,版本居然是15.10,公司版本却是14.6,升级一波。官方文档:https://docs.gitlab.com/ee/update/#upgrading-without-downtime官方文档总结:文档介绍需要按升级路径拉取镜像。经我概览,只需备份etc、log、opt三个文件夹,而且都早已挂载在宿主机,无......
  • docker入门之三:docker构建私有镜像入门到实践
    1.docker构建私有镜像1.1.使用Dockerfile定制镜像1.2.构建镜像1.docker构建私有镜像1.1.使用Dockerfile定制镜像在空目录创建文件,命名为Dockerfile[hadoop@hadoop101file]$cddocker/[hadoop@hadoop101docker]$mkdirmydockerfile[hadoop@hadoop101dock......
  • docker入门之二:docker常用命令
    1.docker常用命令1.1.基本命令1.2.docker管理容器1.2.1.启动容器进入容器删除容器1.docker常用命令1.1.基本命令获取镜像[hadoop@hadoop101docker]$dockerpullubuntu:16.04运行镜像[hadoop@hadoop101docker]$dockerrun-it--rmubuntu:16.0......
  • docker入门之一:docker基础概念与安装
    1.Docker简单介绍1.1.什么是docker?1.2.Docker和传统虚拟机1.3.为什么使用docker1.4.docker架构2.Docker安装2.1.docker版本命名2.2.docker安装2.3.docker卸载2.4.docker镜像加速器1.Docker简单介绍1.1.什么是docker?googlego语言开发,基于Linux内......
  • 将用户从docker组移除
    将用户从docker组移除:gpasswd-dec2-userdocker1.使用命令gpasswd删除用户要将用户从一个组中移除,需要先确定用户的帐号,然后查看要删除的组名,使用命令gpasswd-d即可实现将用户从组中移除。例如,要将用户“alice”从组“test”中移除,可以运行以下命令:gpasswd-dalicetest2......
  • Centos7开启docker checkpoint
    检查点和还原是一项实验性功能,允许您冻结正在运行的容器,通过检查点将其状态转换为文件集合在磁盘上。稍后,容器可以从冻结点恢复。#docker开启checkpoint:"experimental":true,[root@jenkins~]#cat/etc/docker/daemon.json{"experimental":true,"data-root":......
  • docker安装
    1安装1添加yum源: yum-config-manager--add-repohttp://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo 2安装 yuminstalldocker-ce 3查看docker版本[root@szj~]#docker-vDockerversion18.09.6,build481bc771562启动运行1启动docker......
  • docker部署gitlab CI/CD (一)第一篇:部署gitlab及汉化
    网上很多类似教程,但多少有点夹带私货,竟然拉取的第三方镜像,不敢乱用,于是结合其他人的博客和官方文档,结合部分其他作者的笔误踩的坑,知其然也要知其所以然,于2023年4月17日写下这篇。官方文档:https://docs.gitlab.com/ee/install/docker.html主要参考博客:https://www.......
  • 自编译玩客云docker版OpenWrt R22.1.1(2022年2月13日更新)
    openwrt本地直接导入玩客云的步骤做了介绍,本篇适合于没有条件编译的朋友。2月13日更新内容:添加插件ttyd、netdata。拉取地址:dockerpulljyhking/onecloud:1.22月11日更新内容:增加s905系列docker版openwrt拉取地址:dockerpulljyhking/onecloud:s905_11月29日优化更新内容:1、简化......