obdiag用法

os:ubuntu 2204 x64
all-in-one :centos 8

#  obd  obdiag deploy 
Use 'obd tool install oceanbase-diagnostic-tool' instead
[WARN] Use centos 7 remote mirror repository for ubuntu 22.04
[WARN] Use centos 7 remote mirror repository for ubuntu 22.04
Found a avaiable version
name: oceanbase-diagnostic-tool
version: 1.6.2
release:12024031514.el8
arch: x86_64
md5: df49965c9af6d982b90d88544ead279d1a140352
size: 34778636
Do you want to use it? [y/n]: y
Get local repositories and plugins ok
install tool ok
+-----------------------------------------------------------------------------------------------------+
|                                            Installed Tool                                           |
+---------------------------+--------+---------+---------------------------------------+--------------+
| Name                      | Arch   | Version | Install Path                          | Install Size |
+---------------------------+--------+---------+---------------------------------------+--------------+
| oceanbase-diagnostic-tool | x86_64 | 1.6.2   | /home/admin/oceanbase-diagnostic-tool | 33.17M       |
+---------------------------+--------+---------+---------------------------------------+--------------+
Install tool oceanbase-diagnostic-tool completely.
Trace ID: 1c1deb64-1999-11ef-94fe-c62cc4bad044
If you want to view detailed obd logs, please run: obd display-trace 1c1deb64-1999-11ef-94fe-c62cc4bad044
#obd obdiag  check obdemo      
Get local repositories and plugins ok
[WARN] Use centos 7 remote mirror repository for ubuntu 22.04
[WARN] Use centos 7 remote mirror repository for ubuntu 22.04
The tool oceanbase-diagnostic-tool is already installed the latest version 1.6.2
Open ssh connection ok
Check database connectivity ok
2024-05-24 15:02:19,427 [INFO] You can update the latest file by not adding --dis_update=Ture
Traceback (most recent call last):
  File "obdiag.py", line 208, in <module>
  File "obdiag.py", line 158, in check
  File "obdiag_client.py", line 497, in handle_check_command
  File "handler/checker/check_handler.py", line 71, in __init__
handler.checker.check_exception.CheckException: case_package_file /home/admin/.obdiag/check/obproxy_check_package.yaml is not exist 
[24795] Failed to execute script 'obdiag' due to unhandled exception!

See https://www.oceanbase.com/product/ob-deployer/error-codes .
Trace ID: 8ce79104-199b-11ef-acac-c62cc4bad044
If you want to view detailed obd logs, please run: obd display-trace 8ce79104-199b-11ef-acac-c62cc4bad044
1 个赞

obd版本是?

麻烦帮忙拿下/home/admin/.obdiag/这个文件夹的里面的文件分布情况
看起来是obdiag的初始化操作没有执行

admin@ubuntu:~/oceanbase-all-in-one/rpms$ obd --version
OceanBase Deploy: 2.7.0
REVISION: ed74f49b8568586166b8126f1d270cbe2a0e7be1
BUILD_BRANCH: HEAD
BUILD_TIME: Mar 27 2024 19:46:54OURCE
Copyright (C) 2021 OceanBase
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
admin@ubuntu:~/oceanbase-all-in-one/rpms$ obd mirror list
[WARN] Use centos 7 remote mirror repository for ubuntu 22.04
+-----------------------------------------------------------------------------+
|                            Mirror Repository List                           |
+----------------------------+--------+---------+----------+------------------+
| SectionName                | Type   | Enabled | Avaiable | Update Time      |
+----------------------------+--------+---------+----------+------------------+
| local                      | local  | -       | True     | 2024-05-24 15:33 |
| oceanbase.community.stable | remote | False   | False    | 2024-05-23 14:45 |
| oceanbase.development-kit  | remote | False   | False    | 2024-05-23 14:45 |
+----------------------------+--------+---------+----------+------------------+
Use `obd mirror list <section name>` for more details
Trace ID: f3b13828-199f-11ef-8a11-c62cc4bad044
If you want to view detailed obd logs, please run: obd display-trace f3b13828-199f-11ef-8a11-c62cc4bad044
admin@ubuntu:~/oceanbase-all-in-one/rpms$ 
admin@ubuntu:~/oceanbase-all-in-one/rpms$ 
admin@ubuntu:~/oceanbase-all-in-one/rpms$ obd mirror list local
+--------------------------------------------------------------------------------------------------------------------+
|                                                 local Package List                                                 |
+---------------------------+-----------+------------------------+--------+------------------------------------------+
| name                      | version   | release                | arch   | md5                                      |
+---------------------------+-----------+------------------------+--------+------------------------------------------+
| grafana                   | 7.5.17    | 1                      | x86_64 | 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 |
| obagent                   | 4.2.2     | 100000042024011120.el8 | x86_64 | bf152b880953c2043ddaf80d6180cf22bb8c8ac2 |
| ob-configserver           | 1.0.0     | 2.el8                  | x86_64 | 664f93205c913d5dc84e0779d565768fd60f1d5e |
| ob-deploy                 | 2.7.0     | 5.el8                  | x86_64 | bcbbe9844e277da1414d1455d2bd66d1d78088a1 |
| obproxy-ce                | 4.2.3.0   | 3.el8                  | x86_64 | 2526073e3c652177b15093be611af94a469e0e21 |
| oceanbase-ce              | 4.3.0.1   | 100000242024032211.el8 | x86_64 | d475e3bfe98d2a741a7bbb50f5f76345d778c9b8 |
| oceanbase-ce-libs         | 4.3.0.1   | 100000242024032211.el8 | x86_64 | ebb224dbfdc2c0585f3f722ef052269959f54dc4 |
| oceanbase-diagnostic-tool | 1.6.2     | 12024031514.el8        | x86_64 | df49965c9af6d982b90d88544ead279d1a140352 |
| ocp-express               | 4.2.2     | 100000022024011120.el8 | x86_64 | e5c152ebdd65839ed5f5521ff6c73e6a29cb9e75 |
| openjdk-jre               | 1.8.0_322 | b09.el8                | x86_64 | 45e4b8c216b090a63583b70743c54e87b7b69aad |
| prometheus                | 2.37.1    | 10000102022110211.el8  | x86_64 | e4f8a3e784512fca75bf1b3464247d1f31542cb9 |
+---------------------------+-----------+------------------------+--------+------------------------------------------+
Trace ID: f7246cc8-199f-11ef-b999-c62cc4bad044
If you want to view detailed obd logs, please run: obd display-trace f7246cc8-199f-11ef-b999-c62cc4bad044
1 个赞
admin@ubuntu:~/oceanbase-all-in-one/rpms$ tree  /home/admin/.obdiag/
/home/admin/.obdiag/
├── check
├── config.yml
└── log
    └── obdiag.log

2 directories, 2 files
1 个赞
$ cat   /home/admin/.obdiag/config.yml 
obcluster:
  db_host: 10.18.18.64
  db_port: 2881
  ob_cluster_name: obdemo
  tenant_sys:
    password: obdemo
    user: root@sys
  servers:
    nodes:
    - ip: 10.18.18.64
      ssh_port: 32200
      ssh_username: admin
      ssh_password: ''
      private_key: ''
      home_path: /home/admin/observer
      data_dir: /data/obdata/data
      redo_dir: /data/obdata/redo
    - ip: 10.18.18.65
      ssh_port: 32200
      ssh_username: admin
      ssh_password: ''
      private_key: ''
      home_path: /home/admin/observer
      data_dir: /data/obdata/data
      redo_dir: /data/obdata/redo
    - ip: 10.18.18.66
      ssh_port: 32200
      ssh_username: admin
      ssh_password: ''
      private_key: ''
      home_path: /home/admin/observer
      data_dir: /data/obdata/data
      redo_dir: /data/obdata/redo
    global: {}
obproxy:
  servers:
    nodes:
    - ip: 10.18.18.126
      ssh_port: 32200
      ssh_username: admin
      ssh_password: ''
      private_key: ''
      home_path: /data/admin/obproxy
    global: {}
$ cat   /home/admin/.obdiag/log/obdiag.log 
[2024-05-24 14:53:28,320] [INFO] [f3f06ae9-2636-3a91-bf0b-472b6746620e] [gather_sysstat.py->line:63] Use /home/admin/oceanbase-all-in-one/rpms/gather_pack_20240524145327 as pack dir.
[2024-05-24 14:53:28,320] [INFO] [f3f06ae9-2636-3a91-bf0b-472b6746620e] [gather_sysstat.py->line:108] Sending Collect Shell Command to node 10.18.18.64 ...
[2024-05-24 14:53:28,323] [ERROR] [f3f06ae9-2636-3a91-bf0b-472b6746620e] [gather_sysstat.py->line:118] ssh admin@10.18.18.64: failed, Please check the /home/admin/.obdiag/config.yml
[2024-05-24 14:53:28,323] [INFO] [f3f06ae9-2636-3a91-bf0b-472b6746620e] [gather_sysstat.py->line:108] Sending Collect Shell Command to node 10.18.18.65 ...
[2024-05-24 14:53:28,325] [ERROR] [f3f06ae9-2636-3a91-bf0b-472b6746620e] [gather_sysstat.py->line:118] ssh admin@10.18.18.65: failed, Please check the /home/admin/.obdiag/config.yml
[2024-05-24 14:53:28,325] [INFO] [f3f06ae9-2636-3a91-bf0b-472b6746620e] [gather_sysstat.py->line:108] Sending Collect Shell Command to node 10.18.18.66 ...
[2024-05-24 14:53:28,327] [ERROR] [f3f06ae9-2636-3a91-bf0b-472b6746620e] [gather_sysstat.py->line:118] ssh admin@10.18.18.66: failed, Please check the /home/admin/.obdiag/config.yml
[2024-05-24 14:54:43,310] [INFO] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_log.py->line:75] Use /home/admin/oceanbase-all-in-one/rpms/gather_pack_20240524145442 as pack dir.
[2024-05-24 14:54:43,310] [INFO] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_log.py->line:127] Sending Collect Shell Command to node 10.18.18.64 ...
[2024-05-24 14:54:43,312] [ERROR] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_log.py->line:135] ssh admin@10.18.18.64: failed, Please check the /home/admin/.obdiag/config.yml
[2024-05-24 14:54:43,312] [INFO] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_log.py->line:127] Sending Collect Shell Command to node 10.18.18.65 ...
[2024-05-24 14:54:43,314] [ERROR] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_log.py->line:135] ssh admin@10.18.18.65: failed, Please check the /home/admin/.obdiag/config.yml
[2024-05-24 14:54:43,315] [INFO] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_log.py->line:127] Sending Collect Shell Command to node 10.18.18.66 ...
[2024-05-24 14:54:43,317] [ERROR] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_log.py->line:135] ssh admin@10.18.18.66: failed, Please check the /home/admin/.obdiag/config.yml
[2024-05-24 14:54:43,320] [INFO] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_sysstat.py->line:63] Use /home/admin/oceanbase-all-in-one/rpms/gather_pack_20240524145442 as pack dir.
[2024-05-24 14:54:43,320] [INFO] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_sysstat.py->line:108] Sending Collect Shell Command to node 10.18.18.64 ...
[2024-05-24 14:54:43,322] [ERROR] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_sysstat.py->line:118] ssh admin@10.18.18.64: failed, Please check the /home/admin/.obdiag/config.yml
[2024-05-24 14:54:43,322] [INFO] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_sysstat.py->line:108] Sending Collect Shell Command to node 10.18.18.65 ...
[2024-05-24 14:54:43,324] [ERROR] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_sysstat.py->line:118] ssh admin@10.18.18.65: failed, Please check the /home/admin/.obdiag/config.yml
[2024-05-24 14:54:43,324] [INFO] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_sysstat.py->line:108] Sending Collect Shell Command to node 10.18.18.66 ...
[2024-05-24 14:54:43,326] [ERROR] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_sysstat.py->line:118] ssh admin@10.18.18.66: failed, Please check the /home/admin/.obdiag/config.yml
[2024-05-24 14:54:43,328] [INFO] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_perf.py->line:60] Use /home/admin/oceanbase-all-in-one/rpms/gather_pack_20240524145442 as pack dir.
[2024-05-24 14:54:43,328] [INFO] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_perf.py->line:104] Sending Collect Shell Command to node 10.18.18.64 ...
[2024-05-24 14:54:43,330] [ERROR] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_perf.py->line:115] ssh admin@10.18.18.64: failed, Please check the /home/admin/.obdiag/config.yml
[2024-05-24 14:54:43,330] [INFO] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_perf.py->line:104] Sending Collect Shell Command to node 10.18.18.65 ...
[2024-05-24 14:54:43,333] [ERROR] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_perf.py->line:115] ssh admin@10.18.18.65: failed, Please check the /home/admin/.obdiag/config.yml
[2024-05-24 14:54:43,333] [INFO] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_perf.py->line:104] Sending Collect Shell Command to node 10.18.18.66 ...
[2024-05-24 14:54:43,335] [ERROR] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_perf.py->line:115] ssh admin@10.18.18.66: failed, Please check the /home/admin/.obdiag/config.yml
[2024-05-24 14:54:43,337] [INFO] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_obstack2.py->line:63] Use /home/admin/oceanbase-all-in-one/rpms/gather_pack_20240524145442 as pack dir.
[2024-05-24 14:54:43,337] [INFO] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_obstack2.py->line:106] Sending Collect Shell Command to node 10.18.18.64 ...
[2024-05-24 14:54:43,339] [ERROR] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_obstack2.py->line:116] ssh admin@10.18.18.64: failed, Please check the /home/admin/.obdiag/config.yml
[2024-05-24 14:54:43,339] [INFO] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_obstack2.py->line:106] Sending Collect Shell Command to node 10.18.18.65 ...
[2024-05-24 14:54:43,341] [ERROR] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_obstack2.py->line:116] ssh admin@10.18.18.65: failed, Please check the /home/admin/.obdiag/config.yml
[2024-05-24 14:54:43,341] [INFO] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_obstack2.py->line:106] Sending Collect Shell Command to node 10.18.18.66 ...
[2024-05-24 14:54:43,343] [ERROR] [7fe09af2-8ea3-335a-b551-5dc85a72b1d7] [gather_obstack2.py->line:116] ssh admin@10.18.18.66: failed, Please check the /home/admin/.obdiag/config.yml
[2024-05-24 14:58:39,595] [INFO] [aae0fc23-45b1-349b-b68d-be02527c895b] [gather_obadmin.py->line:67] Use /home/admin/oceanbase-all-in-one/rpms/gather_pack_20240524145839 as pack dir.
[2024-05-24 14:58:39,595] [INFO] [aae0fc23-45b1-349b-b68d-be02527c895b] [gather_obadmin.py->line:116] Sending Collect Shell Command to node 10.18.18.64 ...
[2024-05-24 14:58:39,598] [ERROR] [aae0fc23-45b1-349b-b68d-be02527c895b] [gather_obadmin.py->line:129] ssh admin@10.18.18.64: failed, Please check the /home/admin/.obdiag/config.yml
[2024-05-24 15:00:05,930] [INFO] [0b8b1783-e9f7-3b34-b8a1-7196a6add2eb] [gather_obadmin.py->line:67] Use /home/admin/oceanbase-all-in-one/rpms/gather_pack_20240524150005 as pack dir.
[2024-05-24 15:00:05,930] [INFO] [0b8b1783-e9f7-3b34-b8a1-7196a6add2eb] [gather_obadmin.py->line:116] Sending Collect Shell Command to node 10.18.18.64 ...
[2024-05-24 15:00:05,932] [ERROR] [0b8b1783-e9f7-3b34-b8a1-7196a6add2eb] [gather_obadmin.py->line:129] ssh admin@10.18.18.64: failed, Please check the /home/admin/.obdiag/config.yml
[2024-05-24 15:00:56,234] [INFO] [ce0017b5-00c3-34be-902e-e0126882db90] [gather_obadmin.py->line:67] Use /home/admin/oceanbase-all-in-one/rpms/gather_pack_20240524150055 as pack dir.
[2024-05-24 15:00:56,234] [INFO] [ce0017b5-00c3-34be-902e-e0126882db90] [gather_obadmin.py->line:116] Sending Collect Shell Command to node 10.18.18.64 ...
[2024-05-24 15:00:56,236] [ERROR] [ce0017b5-00c3-34be-902e-e0126882db90] [gather_obadmin.py->line:129] ssh admin@10.18.18.64: failed, Please check the /home/admin/.obdiag/config.yml
[2024-05-24 15:02:19,427] [INFO] [702e18f0-8ac8-3f98-8de8-e91dac7576ff] [obdiag_client.py->line:489] You can update the latest file by not adding --dis_update=Ture

执行一下这条命令初始化一下配置,sh ~/.obd/repository/oceanbase-diagnostic-tool/1.6.2/df49965c9af6d982b90d88544ead279d1a140352/init.sh

ubuntu 2204 x64的环境我们找个环境复现一下看

admin@ubuntu:~$ ls -ltr ~/.obd/repository/oceanbase-diagnostic-tool/1.6.2/df49965c9af6d982b90d88544ead279d1a140352/init.sh
-rwxr-xr-x 1 admin admin 1218 May 24 14:44 /home/admin/.obd/repository/oceanbase-diagnostic-tool/1.6.2/df49965c9af6d982b90d88544ead279d1a140352/init.sh
admin@ubuntu:~$ 
admin@ubuntu:~$ 
admin@ubuntu:~$ 
admin@ubuntu:~$ bash  ~/.obd/repository/oceanbase-diagnostic-tool/1.6.2/df49965c9af6d982b90d88544ead279d1a140352/init.sh  
grep: /home/admin/.bashrc: No such file or directory
Init obdiag finished
admin@ubuntu:~$ 
admin@ubuntu:~$ obd obdiag  gather clog obdemo
Get local repositories and plugins ok
[WARN] Use centos 7 remote mirror repository for ubuntu 22.04
[WARN] Use centos 7 remote mirror repository for ubuntu 22.04
The tool oceanbase-diagnostic-tool is already installed the latest version 1.6.2
Open ssh connection ok
2024-05-24 19:16:54,338 [INFO] Use /home/admin/gather_pack_20240524191653 as pack dir.
2024-05-24 19:16:54,338 [INFO] Sending Collect Shell Command to node 10.18.18.64 ...
2024-05-24 19:16:54,341 [ERROR] ssh admin@10.18.18.64: failed, Please check the /home/admin/.obdiag/config.yml
Traceback (most recent call last):
  File "obdiag.py", line 201, in <module>
  File "obdiag.py", line 87, in gather_clog
  File "obdiag_client.py", line 429, in handle_gather_clog_command
  File "handler/gather/gather_obadmin.py", line 84, in handle
  File "handler/gather/gather_obadmin.py", line 78, in handle_from_node
KeyError: 'zip_password'
[31563] Failed to execute script 'obdiag' due to unhandled exception!

See https://www.oceanbase.com/product/ob-deployer/error-codes .
Trace ID: 1d89259c-19bf-11ef-ba91-c62cc4bad044
If you want to view detailed obd logs, please run: obd display-trace 1d89259c-19bf-11ef-ba91-c62cc4bad044

ssh是可以成功的,但是有个warning:
/etc/ssh/ssh_config line 5: Unsupported option “rsaauthentication”

obdiag 1.6.2 在ssh上有个兼容性的问题,在obdiag 2.1.0上修复了。可以直接用obdiag 2.1.0试试。OceanBase分布式数据库-海量数据 笔笔算数