oceanbase一键安装

安装文档:https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000642554

软件下载

https://www.oceanbase.com/softwarecenter

image-20240410210115034

安装obd

yum install -y yum-utils
yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo
yum install -y ob-deploy
source /etc/profile.d/obd.sh

进入web

[root@obnode04 profile.d]# obd web
start OBD WEB in 0.0.0.0:8680
please open http://192.168.0.114:8680

image-20240411153301947

image-20240411153324781

image-20240411153431650

image-20240411153808775

image-20240411153932823

image-20240411153941508

image-20240411153958479

image-20240411154053046

image-20240411154122191

image-20240411154144197

image-20240411154241619

15:42

image-20240411154301589

15:54

image-20240411155441022

image-20240411160634755

obd web

OB日志

obd tool command myoceanbase log -c oceanbase-ce -s 192.168.0.114

OBproxy日志

obd tool command myoceanbase log -c obproxy-ce -s 192.168.0.114

OBAgent日志

obd tool command myoceanbase log -c obagent -s 192.168.0.114

OCP Express日志

obd tool command myoceanbase log -c ocp-express -s 192.168.0.114

连接信息

一键复制

吐槽,原来的老丑了,是不是可以格式化一下;不过可以用json格式复制出来,倒是不错

[
	{
		"component": "oceanbase-ce",
		"access_url": "192.168.0.114:2881",
		"user": "root",
		"password": "_*09SJ{yDOBA%|@~cK(vMX",
		"connect_url": "obclient -h192.168.0.114 -P2881 -uroot -p'_*09SJ{yDOBA%|@~cK(vMX' -Doceanbase -A"
	},
	{
		"component": "obproxy-ce",
		"access_url": "192.168.0.114:2883",
		"user": "root@proxysys",
		"password": "TV0uUkbJo4",
		"connect_url": "obclient -h192.168.0.114 -P2883 -uroot@proxysys -p'TV0uUkbJo4' -Doceanbase -A \n"
	},
	{
		"component": "ocp-express",
		"access_url": "192.168.0.114:8180",
		"user": "admin",
		"password": "+5zA2_Gy",
		"connect_url": "http://192.168.0.114:8180"
	}
]

连接串

obclient -h192.168.0.114 -P2881 -uroot -p'_*09SJ{yDOBA%|@~cK(vMX' -Doceanbase -A
obclient -h192.168.0.114 -P2883 -uroot@proxysys -p'TV0uUkbJo4' -Doceanbase -A 
http://192.168.0.114:8180

管理部署后的集群

查看集群列表

obd cluster list
[root@obnode04 profile.d]# obd cluster list
+----------------------------------------------------------------+
|                          Cluster List                          |
+-------------+--------------------------------+-----------------+
| Name        | Configuration Path             | Status (Cached) |
+-------------+--------------------------------+-----------------+
| myoceanbase | /root/.obd/cluster/myoceanbase | running         |
+-------------+--------------------------------+-----------------+
Trace ID: d1a68fee-f7da-11ee-8b3f-000c29b3851b
If you want to view detailed obd logs, please run: obd display-trace d1a68fee-f7da-11ee-8b3f-000c29b3851b

查看集群状态,以部署名为 myoceanbase 为例

obd cluster display myoceanbase
[root@obnode04 profile.d]# obd cluster display myoceanbase
Get local repositories and plugins ok
Open ssh connection ok
Cluster status check ok
Connect to observer 192.168.0.114:2881 ok
Wait for observer init ok
+-------------------------------------------------+
|                     observer                    |
+---------------+---------+------+-------+--------+
| ip            | version | port | zone  | status |
+---------------+---------+------+-------+--------+
| 192.168.0.114 | 4.2.2.0 | 2881 | zone1 | ACTIVE |
+---------------+---------+------+-------+--------+
obclient -h192.168.0.114 -P2881 -uroot -p'_*09SJ{yDOBA%|@~cK(vMX' -Doceanbase -A

Connect to obproxy ok
+-------------------------------------------------+
|                     obproxy                     |
+---------------+------+-----------------+--------+
| ip            | port | prometheus_port | status |
+---------------+------+-----------------+--------+
| 192.168.0.114 | 2883 | 2884            | active |
+---------------+------+-----------------+--------+
obclient -h192.168.0.114 -P2883 -uroot@proxysys -p'TV0uUkbJo4' -Doceanbase -A 

Connect to Obagent ok
+------------------------------------------------------------------+
|                             obagent                              |
+---------------+--------------------+--------------------+--------+
| ip            | mgragent_http_port | monagent_http_port | status |
+---------------+--------------------+--------------------+--------+
| 192.168.0.114 | 8089               | 8088               | active |
+---------------+--------------------+--------------------+--------+
Connect to ocp-express ok
+------------------------------------------------------------------+
|                           ocp-express                            |
+---------------------------+----------+------------------+--------+
| url                       | username | initial password | status |
+---------------------------+----------+------------------+--------+
| http://192.168.0.114:8180 | admin    | +5zA2_Gy         | active |
+---------------------------+----------+------------------+--------+
Trace ID: 516653a2-f7dd-11ee-8e1d-000c29b3851b
If you want to view detailed obd logs, please run: obd display-trace 516653a2-f7dd-11ee-8e1d-000c29b3851b

停止运行中的集群,以部署名为 myoceanbase 为例

obd cluster stop myoceanbase

销毁已部署的集群,以部署名为 myoceanbase 为例

obd cluster destroy myoceanbase

登陆

为何会找不到obclient?需要手动安装yum install obclient

[root@obnode04 ~]# find / -name obclient
find: ‘/proc/27437/task/27714/fdinfo/130’: 没有那个文件或目录
find: ‘/proc/36203’: 没有那个文件或目录
find: ‘/run/user/1000/gvfs’: 权限不够
/root/.obd/plugins/obclient
/usr/obd/plugins/obclient
/data/oceanbase-all-in-one/obd/usr/obd/plugins/obclient
/data/oceanbase-all-in-one/obclient
/data/oceanbase-all-in-one/obclient/u01/obclient
/data/oceanbase-all-in-one/obclient/u01/obclient/bin/obclient

要吐个槽,为啥不把客户端一起装上,难道是想让客户自己用mysql客户端?

[root@obnode04 profile.d]# obclient -h192.168.0.114 -P2881 -uroot -p'_*09SJ{yDOBA%|@~cK(vMX' -Doceanbase -A
bash: obclient: 未找到命令...
[root@obnode04 profile.d]# obclient -h192.168.0.114 -P2881 -uroot -p'_*09SJ{yDOBA%|@~cK(vMX' -Doceanbase -A
Welcome to the OceanBase.  Commands end with ; or \g.
Your OceanBase connection id is 3221605803
Server version: OceanBase_CE 4.2.2.0 (r100010012024022719-c984fe7cb7a4cef85a40323a0d073f0c9b7b8235) (Built Feb 27 2024 19:20:54)

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 [oceanbase]> select now();
+---------------------+
| now()               |
+---------------------+
| 2024-04-11 16:24:57 |
+---------------------+
1 row in set (0.001 sec)

image-20240411163128644

  • 4
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
很高兴能帮助您!以下是OceanBase 3.2.3的安装教程: 1. 准备工作: - 确保您的服务器满足OceanBase的最低系统要求,如操作系统、内存和磁盘空间。 - 确保您已经安装了必要的依赖项,如gcc、cmake、libaio等。 2. 下载和解压OceanBase软件包: - 访问OceanBase官方网站或从Github上下载最新的OceanBase 3.2.3软件包。 - 将下载的软件包解压到您选择的目录中。 3. 配置环境变量: - 打开终端并编辑您的bashrc文件:`vi ~/.bashrc` - 在文件末尾添加以下内容,并保存退出: ``` export OB_HOME=/path/to/oceanbase export PATH=$OB_HOME/bin:$PATH ``` - 运行以下命令使配置生效:`source ~/.bashrc` 4. 配置和启动OceanBase集群: - 进入您解压的OceanBase目录:`cd /path/to/oceanbase` - 使用配置向导生成初始配置文件:`./scripts/ob_config_wizard.py` - 按照提示进行配置,包括集群节点数量、IP地址、端口等。 - 完成配置后,执行以下命令启动集群:`./scripts/ob_start_cluster.py` - 您可以通过运行`./scripts/ob_show_cluster.py`查看集群状态。 5. 验证安装: - 在终端中运行以下命令:`./scripts/ob_client.py` - 确认能够成功连接到OceanBase集群,并执行一些简单的SQL查询。 这些是基本的安装步骤。请注意,安装和配置过程中可能会有其他详细的步骤和参数设置,具体取决于您的环境和需求。建议参考OceanBase官方文档或社区论坛获取更多详细信息和帮助。祝您安装顺利!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Jenvid.yang

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值