This article will introduce how to install obdiag.
Environmental requirements
- obdiag supports running on Linux environment.
- Source code installation requires Python >= 3.11.
Prerequisites
obdiag needs to connect to the diagnosed host when performing information collection, cluster inspection, root cause analysis, online log analysis and full-link diagnosis. Please ensure that the machine where obdiag is located is reachable to the OceanBase cluster network.
Installation steps
obdiag can be deployed independently or used through obd, choose one of the following methods.
Method 1: RPM/DEB package installation (independent deployment)
Applicable to non-obd deployment scenarios of clusters to be diagnosed.
- Online deployment (can access external network)
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo
sudo yum install -y oceanbase-diagnostic-tool
sh /opt/oceanbase-diagnostic-tool/init.sh
```<main id="notice" type='explain'>
<h4>Description</h4>
<p>The online YUM method supports CentOS 7/8, but CentOS 9 is not currently supported. For CentOS 9, please use the offline deployment or source code installation below. </p>
</main>
- **Offline deployment (no access to external network)**
Download the latest version of OceanBase agile diagnostic tool (obdiag) from the OceanBase official website [download page] (https://en.oceanbase.com/softwarecenter).
```bash
yum localinstall -y oceanbase-diagnostic-tool*.rpm
sh /opt/oceanbase-diagnostic-tool/init.sh
```- **Debian (such as Ubuntu)**
After downloading the RPM package of obdiag from [Download Page](https://en.oceanbase.com/softwarecenter), convert to DEB and install:
```bash
apt-get update
apt-get install alien -y
alien --scripts --to-deb oceanbase-diagnostic-tool*.rpm
dpkg -i oceanbase-diagnostic-tool*.deb
sh /opt/oceanbase-diagnostic-tool/init.sh
```
### Method 2: Source code installation
Suitable for scenarios where obdiag needs to be built from source or customized, **requires Python >= 3.11**.
```bash
# Run in the obdiag source code root directory
make init
source ~/.bashrc
After the execution is completed, you can use the obdiag command directly.
Method three: obd deployment
If the cluster to be diagnosed is deployed by obd, it is recommended to upgrade obd to V2.5.0 and above, and use obdiag directly through the obd command without separately configuring ~/.obdiag/config.yml.
- Online Deployment
obd mirror enable remote
obd obdiag deploy
```- **Offline Deployment**
After downloading the RPM package of obdiag from [Download Page](https://en.oceanbase.com/softwarecenter):
```bash
obd mirror clone oceanbase-diagnostic-tool-*.rpm
obd obdiag deploy
```