首批通过分布式安全可靠测评,为关键业务系统打造
部署单机版时如果默认的 SSH 端口不是 22 该如何解决
更新时间:2026-05-07 08:31
问题现象
在部署单机版 OBServer 时,在提供的登录密码正确的情况下,遇到了如下连接超时的报错 connect failed: time out。

问题风险
单机版 OBServer 部署失败。
问题原因
单机版 OBServer 默认使用 SSH:22 端口来连接远程 OBServer 服务器,但是有些地方出于安全考虑会将 22 端口替换别的端口,所以导致 SSH 连接不上出现上述问题。
解决方案
采取 YAML 配置文件的方式来部署(最快捷的方式是从已经部署好的单机版 OBServer 环境中拷贝一份 YAML 文件然后修改相关的配置信息)。如果没有可用的 YAML 文件的话,可以直接拷贝下面配置文件模版并修改相关参数来部署单机版 OBServer。
[root@observer ~]# vi mytest.yaml # 文件名字和 cluster_name 保持一致,实际应用中 yaml 文件里的 --注释需要去掉,文件中加粗部分需要根据实际情况更改
user:
username: root
password: xxxx
port: 29022 # 更改成实际的 SSH 端口
oceanbase-standalone: # 这些可以根据实际安装包的信息来查看 obd mirror list local
version: 4.3.5.3
release: 103000112025071821.el7
servers:
- xx.xx.xx.xx
global:
cluster_name: mytest
mysql_port: 2881
rpc_port: 2882
obshell_port: 2886
root_password: xxx
cpu_count: 16
memory_limit: 55G
home_path: /home/admin/oceanbase/mytest
data_dir: /data/1/mytest
redo_dir: /data/log1/mytest
datafile_size: 100G
datafile_maxsize: 110G
datafile_next: 11G
log_disk_size: 100G
system_memory: 0
zone: zone1
scenario: htap
appname: mytest
cluster_id: 1761554116
[root@observer ~]# obd mirror list local
+-------------------------------------------------------------------------------------------------------------------+
| local Package List |
+---------------------------+---------+------------------------+---------+------------------------------------------+
| name | version | release | arch | md5 |
+---------------------------+---------+------------------------+---------+------------------------------------------+
| grafana | 7.5.17 | 1 | aarch64 | 5129b0134e31d273c970a7e3c7370990016bee16 |
| obagent | 4.2.2 | 100000042024011120.el7 | aarch64 | 8a5c3b8c55defe409d1e72b7efd13c5e41549545 |
| ob-deploy | 3.4.0 | 2.el7 | aarch64 | a6582ef18bd41b06547c350a3ef1e1e0d4c3bb8c |
| oceanbase-diagnostic-tool | 3.5.0 | 12025062011.el7 | aarch64 | 22598fb8a6198a480b2161e85601c4c85a4b7bb0 |
| oceanbase-standalone | 4.3.5.3 | 103000112025071821.el7 | aarch64 | 29958993910cf65dcd361611d09a21671032bc7b |
| oceanbase-standalone-libs | 4.3.5.3 | 103000112025071821.el7 | aarch64 | 30d9e0ad40350dc2e95d54d229dad5ae4520e22b |
| prometheus | 2.37.1 | 10000102022110211.el7 | aarch64 | 2d856b4a90e7a35322bc3412231f714fde3fd794 |
+---------------------------+---------+------------------------+---------+------------------------------------------+
Trace ID: d3003f48-caab-11f0-abc0-525400fb40d1
If you want to view detailed obd logs, please run: obd display-trace d3003f48-caab-11f0-abc0-525400fb40d1
[root@observer ~]# obd cluster deploy mytest -c /root/mytest.yaml
+----------------------------------------------------------------------------------------------------+
| Packages |
+----------------------+---------+------------------------+------------------------------------------+
| Repository | Version | Release | Md5 |
+----------------------+---------+------------------------+------------------------------------------+
| oceanbase-standalone | 4.3.5.3 | 103000112025071821.el7 | 29958993910cf65dcd361611d09a21671032bc7b |
+----------------------+---------+------------------------+------------------------------------------+
Repository integrity check ok
Load param plugin ok
Open ssh connection ok
Initializes observer work home ok
Parameter check ok
Remote oceanbase-standalone-4.3.5.3-103000112025071821.el7-29958993910cf65dcd361611d09a21671032bc7b repository install ok
Remote oceanbase-standalone-4.3.5.3-103000112025071821.el7-29958993910cf65dcd361611d09a21671032bc7b repository lib check ok
mytest deployed
Please execute ` obd cluster start mytest ` to start
Trace ID: 2c8d7e08-caa8-11f0-bb16-525400fb40d1
If you want to view detailed obd logs, please run: obd display-trace 2c8d7e08-caa8-11f0-bb16-525400fb40d1
[root@observer ~]# obd cluster list
+------------------------------------------------------+
| Cluster List |
+--------+---------------------------+-----------------+
| Name | Configuration Path | Status (Cached) |
+--------+---------------------------+-----------------+
| myob | /root/.obd/cluster/myob | configured |
| mytest | /root/.obd/cluster/mytest | deployed |
+--------+---------------------------+-----------------+
[root@observer ~]# obd cluster start mytest
Get local repositories ok
Load cluster param plugin ok
Open ssh connection ok
[WARN] OBD-1007: (xx.xx.xx.xx) The recommended number of stack size is unlimited (Current value: 10240)
cluster scenario: htap
Start observer ok
observer program health check ok
Connect to observer xx.xx.xx.xx:2881 ok
oceanbase bootstrap ok
obshell start ok
obshell program health check ok
obshell bootstrap ok
Connect to observer xx.xx.xx.xx:2881 ok
Wait for observer init ok
+--------------------------------------------------+
| oceanbase-standalone |
+----------------+---------+------+-------+--------+
| ip | version | port | zone | status |
+----------------+---------+------+-------+--------+
| xx.xx.xx.xx | 4.3.5.3 | 2881 | zone1 | ACTIVE |
+----------------+---------+------+-------+--------+
obclient -hxx.xx.xx.xx -P2881 -uroot@sys -pxxx -Doceanbase -A
cluster unique id: 252a5cb4-5f84-5fd9-8ea7-fe394ad0a963-19abf716c51-03050304
mytest running
Trace ID: 485ad752-caa8-11f0-8e12-525400fb40d1