# FAQ

## Q: How can I specify the version of a component?

A: You can add the version declaration to the deployment configuration file. For example, you can specify the version of OceanBase-CE V3.1.0 in the deployment configuration file in the following format:

```yaml
oceanbase-ce:
  version: 3.1.3
```

## Q: How can I use a component of a specific version?

A: You can add the package_hash or tag declaration to the deployment configuration file.
For example, if you have tagged your compiled OceanBase-CE, you can specify it by tag. For example:

```yaml
oceanbase-ce:
  tag: my-oceanbase
```

You can also use package_hash to specify a specific version. When you run an `obd mirror` command, OBD will return an MD5 value of the component. The MD5 value is the value of package_hash.

```yaml
oceanbase-ce:
  package_hash: 589c4f8ed2662835148a95d5c1b46a07e36c2d346804791364a757aef4f7b60d
```

## Q: How can I modify the startup process after I modify the code of OceanBase-CE?

A: You can modify the startup plug-ins in the `~/.obd/plugins/oceanbase-ce/` directory. For example, after you add a new startup configuration item for OceanBase-CE V3.1.0, you can modify the `start.py` file in the `~/.obd/plugins/oceanbase-ce/3.1.0` directory.

## Q: How to update OBD local mirror in offline mode?

A: When your machine with OBD installed cannot connect to the public network, but you need to update OBD or other components, you can download the RPM package you need on another machine that can connect to the public network, copy the RPM package to the machine where OBD installed, and then add the new RPM package to the local mirror through `obd mirror clone` command.

The following shows how to update the OBD mirror in the local repository:

```shell
# First, download the latest RPM package of OBD on a machine that can connect to the public network.
# Links to the latest RPM packages are available in the release notes of the corresponding component's git repository or on the OceanBase open source website (https://open.oceanbase.com/softwareCenter/community).
wget https://github.com/oceanbase/obdeploy/releases/download/vx.x.x/ob-deploy-x.x.x-xxx.rpm
# Copy the downloaded RPM package to the machine where OBD is installed, i.e. obd_server.
sh ob-deploy-x.x.x-xxx.rpm obd_server:~
# Add the downloaded mirror to local.
obd mirror clone ob-deploy-x.x.x-xxx.rpm
# Close the remote mirror source.
obd mirror disable remote
```

## Q: How to update OBD?

A: There are two ways to update your OBD, which you can choose from depending on your situation:

+ If your machine can connect to the public network or have the RPM package for the updated OBD in the mirror you configured, you can directly use the `obd update` command to update the OBD. When you finish with the update, use the `obd --version` command to check the version of OBD and confirm whether the update is successful.
+ If your machine cannot connect to the public network and there is no RPM package for the updated OBD in the mirror you configured. Please add the RPM package that used to update OBD to the local mirror via `obd mirror clone` command first, and then use the `obd update` command to update the OBD.

The following shows how to update OBD to the latest version in centos7 system:

```shell
# First, download the latest RPM package of OBD on a machine that can connect to the public network.
#  Links to the latest RPM packages are available in the release notes of the corresponding component's git repository or on the OceanBase open source website (https://open.oceanbase.com/softwareCenter/community).
wget https://github.com/oceanbase/obdeploy/releases/download/vx.x.x/ob-deploy-x.x.x-xxx.rpm
# Copy the downloaded RPM package to the machine where OBD is installed, i.e. obd_server.
sh ob-deploy-x.x.x-xxx.rpm obd_server:~
# Execute the following command on the OBD machine to complete the upgrade.
# 1.Add the downloaded mirror to local.
obd mirror clone ob-deploy-x.x.x-xxx.rpm
# 2.Close the remote mirror source.
obd mirror disable remote
# 3.Update.
obd update
```

## Q: How to upgrade OceanBase with OBD?

A: There are two ways to upgrade OceanBase with OBD, which you can choose from depending on your situation:

+ If your machine can connect to the public network or have the RPM package for the updated OceanBase in the mirror you configured, you can directly use the `obd cluster upgrade` command to upgrade the OceanBase.
+ If your machine cannot connect to the public network and there is no RPM package for the updated OceanBase in the mirror you configured. Please add the RPM package that used to update OceanBase to the local mirror via `obd mirror clone` command first, and then use the `obd cluster upgrade` command to upgrade the OceanBase.

The following shows how to upgrade OceanBase-CE from V3.1.1 to V3.1.2 with OBD on CentOS7 offline mode:

```shell
# First, you should check your OBD version, and if the version is lower than V1.2.1, please update the OBD version.
# Download the OceanBase-CE RPM package on a machine that can connect to the public network.
# Links to the latest RPM packages are available in the release notes of the corresponding component's git repository or on the OceanBase open source website (https://open.oceanbase.com/softwareCenter/community).
wget https://github.com/oceanbase/oceanbase/releases/download/v3.1.2_CE/oceanbase-ce-3.1.2-10000392021123010.el7.x86_64.rpm
# Copy the downloaded RPM package to the machine where OBD is installed, i.e. obd_server.
sh oceanbase-ce-3.1.2-10000392021123010.el7.x86_64.rpm obd_server:~
# Execute the following command on the OBD machine to complete the upgrade.
# 1.Add the downloaded mirror to local.
obd mirror clone oceanbase-ce-3.1.2-10000392021123010.el7.x86_64.rpm
# 2.Close the remote mirror source.
obd mirror disable remote
# 3.Upgrade.
obd cluster upgrade <deploy name> -c oceanbase-ce -V 3.1.2
```

### error processing

You may encounter a `Too many match` error, just select a `hash` on `Candidates`. For example:

```shell
obd cluster upgrade <deploy name> -c oceanbase-ce -V 3.1.2 --usable 7fafba0fac1e90cbd1b5b7ae5fa129b64dc63aed
```

## How do I upgrade an OBProxy to obproxy-ce 3.2.3?

The open source OBProxy component is formally renamed as obproxy-ce after v3.2.3. Therefore, you need to modify the metadata as the execution user of OBD. For more information, see [Execute the script] (2.how-to-upgrade-obproxy-to-obproxy-ce-3.2.3.md). Then, run the following command for upgrade:

```shell
obd cluster upgrade <deploy name> -c obproxy-ce -V 3.2.3
```

## What should I do if an exception occurs when I use OBD to upgrade an OBProxy?

The following problem may occur during the upgrade of OBProxy:

```bash
Stop obproxy ok
Start obproxy ok
obproxy program health check ok
Connect to obproxy x
```

The problem indicates that OBD cannot connect to the OBProxy, the reason may be either of the following:

1. The access from other IP addresses except 127.0.0.1 is disabled by proxysys. As a result, the OBD server cannot establish a connection. In this case, run the following command to connect to proxysys:

   ```bash
   obclient -h<obproxy_ip> -uroot@proxysys -P<obproxy_post> -p<obproxy_pwd>
   ```

   > **Note**
   >
   > If the connection fails with a password set by yourself, change the password to empty or to `proxysys`.

   Then, run the `alter proxyconfig set skip_proxy_sys_private_check = true` command.

2. The password of proxysys is inconsistent with the one stored in OBD. In this case, run the corresponding command to connect to proxysys, and then run the `alter proxyconfig set obproxy_sys_password = <obproxy_pwd>` command to change the password of proxysys.

   You can change the password to empty (`obproxy_sys_password = ''`) or to the password stored in the configuration file of OBD.

If the problem persists, submit an issue on GitHub (<https://github.com/oceanbase/obdeploy/issues>), and designated professionals will help you fix the issue.

## What should I do if the OBProxy service cannot be started after OBD is upgraded?

An OBD upgrade will initialize the OBProxy password. If `obproxy_sys_password` is specified, run the following command to connect to proxysys:

```bash
obclient -h<obproxy_ip> -uroot@proxysys -P<obproxy_post> -p<obproxy_pwd>
```

> **Note**
>
> If the connection fails with a password set by yourself, change the password to empty or to `proxysys`.

Then, run the `alter proxyconfig set obproxy_sys_password = ''` command to set the password of proxysys to empty, or set the password to the one specified by `obproxy_sys_password` in the configuration file.
