oceanbase 4.x 3种安装工具、诊断工具obdiag及场景介绍

  • OCP(企业版首选):OceanBase 企业版生产环境的推荐部署方式。OCP 是图形化管理平台,适合对集群进行全生命周期管理。
  • OBD(社区版线上 / 体验):官方推荐用于社区版线上环境的标准部署,同时也适合在 Linux 环境下快速体验 OceanBase。

补充:Antman / oat-cli 与 OBD 的区分

  • t-oceanbase-antman:OceanBase 企业版自动化部署工具(通常称为 Antman 或 oat-cli)的安装包及工作目录;OBD 部署不会产生这个目录。
  • 配置文件 ob.conf 中的包名:现场 ob.conf 里的 ob_antman=t-oceanbase-antman-1.4.4-... 明确指定了使用 Antman 工具。
  • 部署工具的分工:OceanBase 的部署工具存在明确区分。OBD 主要面向社区版场景,而 Antman / oat-cli 则是企业版方案中的工具,通常用于先安装 OCP 等管控平台,再由 OCP 去部署数据库。obd 命令来自于 ob-deploy 这个 RPM 包,或者通过 all-in-one 安装包中的脚本安装。

判断集群是否由 OBD 部署:在可能安装了 OBD 的机器上执行 obd cluster list;若集群由 OBD 部署并管理,其名字会出现在列表中。

obd cluster list

obdiag的安装及使用

[root@hs202 ~]# yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo
Loaded plugins: fastestmirror
adding repo from: https://mirrors.aliyun.com/oceanbase/OceanBase.repo
grabbing file https://mirrors.aliyun.com/oceanbase/OceanBase.repo to /etc/yum.repos.d/OceanBase.repo
repo saved to /etc/yum.repos.d/OceanBase.repo
[root@hs202 ~]# yum install -y oceanbase-diagnostic-tool
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
oceanbase.community.stable.el | 3.0 kB 00:00:00
oceanbase.development-kit.el | 3.0 kB 00:00:00
(1/2): oceanbase.development-kit.el/7/x86_64/primary_db | 163 kB 00:00:00
(2/2): oceanbase.community.stable.el/7/x86_64/primary_db | 418 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package oceanbase-diagnostic-tool.x86_64 0:5.0.2-12026102116.el7 will be installed
--> Finished Dependency Resolution


Dependencies Resolved


==================================================================================================================================================================================
Package Arch Version Repository Size
==================================================================================================================================================================================
Installing:
oceanbase-diagnostic-tool x86_64 5.0.2-12026102116.el7 oceanbase.community.stable.el 91 M


Transaction Summary
==================================================================================================================================================================================
Install 1 Package


Total download size: 91 M
Installed size: 113 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/oceanbase.community.stable.el/packages/oceanbase-diagnostic-tool-5.0.2-12026102116.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID e9b4a7aa: NOKEY
Public key for oceanbase-diagnostic-tool-5.0.2-12026102116.el7.x86_64.rpm is not installed
oceanbase-diagnostic-tool-5.0.2-12026102116.el7.x86_64.rpm | 91 MB 00:00:13
Retrieving key from https://mirrors.oceanbase.com/RPM-GPG-KEY-OceanBase
Importing GPG key 0x09E1CEBF:
Userid : "OceanBase-new (RPM Signing Key for OceanBase (SHA256)) <rpm-signing@oceanbase.com>"
Fingerprint: a109 e086 b8f1 d712 a255 5cd4 3712 65da 09e1 cebf
From : https://mirrors.oceanbase.com/RPM-GPG-KEY-OceanBase
Retrieving key from https://mirrors.oceanbase.com/RPM-GPG-KEY-OceanBase-old
Importing GPG key 0xE9B4A7AA:
Userid : "OceanBase"
Fingerprint: ef7d e8e3 6987 b60c acf9 9a53 2ff8 45a6 e9b4 a7aa
From : https://mirrors.oceanbase.com/RPM-GPG-KEY-OceanBase-old
Retrieving key from https://mirrors.oceanbase.com/RPM-GPG-KEY-OceanBase-el7
Importing GPG key 0x63476B06:
Userid : "OceanBase-EL7 (RPM Signing Key for EL7 (Master Key Only)) <rpm-signing-el7@oceanbase.com>"
Fingerprint: a74f e069 a852 a639 a241 2347 283b ca09 6347 6b06
From : https://mirrors.oceanbase.com/RPM-GPG-KEY-OceanBase-el7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : oceanbase-diagnostic-tool-5.0.2-12026102116.el7.x86_64 1/1
None of the specified directories contain files. Skipping backup.
CURRENT_USER_NAME = root
USER_HOME = /root
/
obdiag version information has been successfully written to /root/.obdiag/version.yaml
Init obdiag finished
Please execute the following command to init obdiag:


source /opt/oceanbase-diagnostic-tool/init.sh

Verify the installation after initialization: obdiag --version
Verifying : oceanbase-diagnostic-tool-5.0.2-12026102116.el7.x86_64 1/1


Installed:
oceanbase-diagnostic-tool.x86_64 0:5.0.2-12026102116.el7


Complete!
[root@hs202 ~]# sh /opt/oceanbase-diagnostic-tool/init.sh
CURRENT_USER_NAME = root
USER_HOME = /root
/root
obdiag version information has been successfully written to /root/.obdiag/version.yaml
Init obdiag finished


obdiag配置

[admin@hs202 ~]$ obdiag config -h10.20.190.55 -uroot@sys -pAKQ_exb33% -P2881
obdiag version: 5.0.2
[ERROR] connect OB: 10.20.190.55:2881 with user root@sys failed, error:(1045, "Access denied for user 'root'@'xxx.xxx.xxx.xxx' (using password: YES)")
[ERROR] connect OB: 10.20.190.55:2881 with user root@sys failed, error:(1045, "Access denied for user 'root'@'xxx.xxx.xxx.xxx' (using password: YES)")
[ERROR] get observer version fail. Please check conf about observer's node or obconnector's info.
[ERROR] command failed. Please contact OceanBase community. e: get observer version fail. Please check conf about observer's node or obconnector's info.
Trace ID: 7fdecd76-e011-11f1-b052-005056a7be56
If you want to view detailed obdiag logs, please run: obdiag display-trace 7fdecd76-e011-11f1-b052-005056a7be56


[admin@hs202 ~]$ obdiag config -h10.20.152.202 -uroot@sys -paaAA11__ -P2881
obdiag version: 5.0.2
Please enter the following configuration !!!
Enter your oceanbase host ssh username (default:''): admin
Enter your use password or key file (0:use password; 1:use key file) default: 0: 0
Enter your oceanbase host ssh password (default:''): *********
Enter your oceanbase host ssh_port (default:'22'):
Enter your oceanbase install home_path (default:'/root/observer'): /data/oceanbase
Enter your need config obproxy [y/N] (default:'N'):
Node information has been rewritten to the configuration file /home/admin/.obdiag/config.yml, and you can enjoy the journey !
Trace ID: 18450594-e012-11f1-9e68-005056a7be56
If you want to view detailed obdiag logs, please run: obdiag display-trace 18450594-e012-11f1-9e68-005056a7be56
[admin@hs202 ~]$ obdiag gather ash
obdiag version: 5.0.2
gather_ash_report start ...
gather from_time: 2026-11-14 17:32:59, to_time: 2026-11-14 18:02:59
from_time: 2026-11-14 17:32:59, to_time: 2026-11-14 18:02:59, sql_id: None, trace_id: None, report_type: text, wait_class: None, store_dir: ./, svr_ip: None, svr_port: None, tenant_id: None
save ash report file name: ./obdiag_gather_pack_20261114180259/ash_report_20261114180259.txt

Gather ash_report results stored in this directory: ./obdiag_gather_pack_20261114180259

Trace ID: 909da87a-e012-11f1-b8ac-005056a7be56
If you want to view detailed obdiag logs, please run: obdiag display-trace 909da87a-e012-11f1-b8ac-005056a7be56

总体来说,obdiag生成的ash不如直接调用dbms_workload_repository.ash_report的丰富和直观,况且dbms_workload_repository.ash_report可以直接连接到oracle租户、而obdiag本身仅支持mysql租户(而如果系统使用oracle模式的话,需要拿到sys租户的权限,这在生产有时候是不可能的)。

obclient(SYS@XXX)[SYS]> call dbms_workload_repository.ash_report(
-> to_date('2026-11-11 19:26:47', 'yyyy-MM-dd HH24:mi:ss'),
-> to_date('2026-11-13 19:27:07', 'yyyy-MM-dd HH24:mi:ss')
-> );
Query OK, 0 rows affected (10.155 sec)

ob的awr报告

可以通过ocp或obdiag生成ob的awr报告(但是我生成的时候,总是提示fetch快照失败),所以最好是通过ocp生成,但ob的awr报告的深度和丰富性完全不如oracle、甚至不如oracle 9i的statspack。

posted @ 2026-11-14 17:29  zhjh256  阅读(17)  评论(0)    收藏  举报