ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Docker 部署OceanBase社区版

2022-09-08 17:30:26  阅读:184  来源: 互联网

标签:社区 oceanbase OceanBase obd cluster tenant Docker root obcluster


#download images
docker pull oceanbase/oceanbase-ce

#start containerd
docker run -p 2881:2881 --name oceanbase-ce -d -e OB_HOME_PATH="/root/obce" -e OB_TENANT_NAME="obmysql" oceanbase/oceanbase-ce


#into containerd
docker exec -it oceanbase-ce bash

#list OBD deployment config
obd cluster list

####start use oceanbase cluster
ob-mysql mysql

ob-mysql root

ob-mysql test

 

[root@be5b79ccd2d9 ~]# obd cluster list
+------------------------------------------------------------+
| Cluster List |
+-----------+------------------------------+-----------------+
| Name | Configuration Path | Status (Cached) |
+-----------+------------------------------+-----------------+
| obcluster | /root/.obd/cluster/obcluster | running |
+-----------+------------------------------+-----------------+
[root@be5b79ccd2d9 ~]# 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 | 3.1.3 | 2881 | zone1 | active |
+-----------+---------+------+-------+--------+

 


MySQL [oceanbase]> select tenant_id,tenant_name,primary_zone from __all_tenant;
+-----------+-------------+--------------+
| tenant_id | tenant_name | primary_zone |
+-----------+-------------+--------------+
| 1 | sys | zone1 |
| 1001 | obmysql | RANDOM |
+-----------+-------------+--------------+
2 rows in set (0.003 sec)


[root@be5b79ccd2d9 ~]# obd cluster obcluster status
Usage: obd cluster <command> [options]

Available commands:

autodeploy Deploy a cluster automatically by using a simple configuration file.

change-repo Change repository for a deployed component

check4ocp Check Whether OCP Can Take Over Configurations in Use

chst Change Deployment Configuration Style

deploy Deploy a cluster by using the current deploy configuration or a deploy yaml file.

destroy Destroy a deployed cluster.

display Display the information for a cluster.

edit-config Edit the configuration file for a specific deployment.

list List all the deployments.

redeploy Redeploy a started cluster.

reload Reload a started cluster.

restart Restart a started cluster.

start Start a deployed cluster.

stop Stop a started cluster.

tenant Create or drop a tenant.

upgrade Upgrade a cluster.


Options:
-h, --help Show help and exit.
-v, --verbose Activate verbose output.

 

[root@be5b79ccd2d9 ~]# obd cluster list
+------------------------------------------------------------+
| Cluster List |
+-----------+------------------------------+-----------------+
| Name | Configuration Path | Status (Cached) |
+-----------+------------------------------+-----------------+
| obcluster | /root/.obd/cluster/obcluster | running |
+-----------+------------------------------+-----------------+
[root@be5b79ccd2d9 ~]# obd cluster start obcluster
Get local repositories and plugins ok
Open ssh connection ok
Load cluster param plugin ok
Cluster status check ok
Deploy "obcluster" is running

 

###集群配置文件
#[admin@49356c1421d1 ~]$ cat /home/admin/.obd/cluster/obdemo/config.yaml
root@dbabackup:~# mysql -h10.20.70.216 -uroot -P2883 -pXXX -c -A oceanbase
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 5.6.25 OceanBase 3.1.1 (r4-8c615943cbd25a6f7b8bdfd8677a13a21709a05e) (Built Oct 21 2021 10:52:05)

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

标签:社区,oceanbase,OceanBase,obd,cluster,tenant,Docker,root,obcluster
来源: https://www.cnblogs.com/chinaops/p/16670225.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有