obd安装obagent,如何修改默认端口

【 使用环境 】 测试环境
【 OB or 其他组件 】obagent
【 使用版本 】V4.2.1.7
【问题描述】
使用obd部署,因为我的机器上部署过oms,8088、8089已经被使用了。
安装obagent和ocp组件的时候报端口冲突。

[2024-08-07 08:24:10.866] [ERROR] OBD-1001: 127.0.0.1:8088 port is already used
[2024-08-07 08:24:10.961] [INFO] [ERROR] OBD-1001: 127.0.0.1:8089 port is already used
[2024-08-07 08:24:10.961] [INFO] [ERROR] OBD-1001: 127.0.0.1:8088 port is already used

示例参数文件中没有看到端口相关的参数。

obagent:
  depends:
    - oceanbase-ce
  servers:
    - name: server1
      # Please don't use hostname, only IP can be supported
      ip: 172.19.33.2
    - name: server2
      ip: 172.19.33.3
    - name: server3
      ip: 172.19.33.4
  global:
    home_path: /root/obagent

有人修改过吗?如何修改obagent的2个端口,使用哪两个参数?

【复现路径】
OCP实验指导手册,实验二


参考目录~/.oceanbase-all-in-one/obd/usr/obd/example/obagent/下的参数文件说明
你试试手动填上这俩参数修改端口号

我暂时把原来的oms停了,这步是过去了。
但是第一次安装的时候已经创建了ocp_meta库,第二次obagent安装成功了,但是连ocp_meta一直连不上,用日志里面的密码连报密码错误。

第一次安装的时候日志:

[2024-08-07 08:23:32.723] [INFO] Create tenant ocp_meta
[2024-08-07 08:23:32.724] [DEBUG] -- execute sql: select zone, count(*) num from oceanbase.__all_server where status = 'active' group by zone. args: None
[2024-08-07 08:23:32.726] [DEBUG] -- execute sql: select count(*) num from oceanbase.__all_server where status = 'active' and start_service_time > 0. args: None
[2024-08-07 08:23:32.727] [DEBUG] -- execute sql: SELECT * FROM oceanbase.GV$OB_SERVERS where zone in ('zone1'). args: None
[2024-08-07 08:23:32.745] [DEBUG] -- execute sql: create resource unit ocp_meta_unit max_cpu 1.0, memory_size 2147483648, min_cpu 1.0. args: None
[2024-08-07 08:23:32.752] [DEBUG] -- execute sql: create resource pool ocp_meta_pool unit='ocp_meta_unit', unit_num=1, zone_list=('zone1'). args: None
[2024-08-07 08:23:32.760] [DEBUG] -- execute sql: create tenant ocp_meta replica_num=1,zone_list=('zone1'),primary_zone='RANDOM',resource_pool_list=('ocp_meta_pool')set ob_tcp_invited_nodes
='%', ob_compatibility_mode = 'mysql'. args: None
[2024-08-07 08:23:59.043] [DEBUG] -- alter user root IDENTIFIED BY %s
[2024-08-07 08:23:59.043] [DEBUG] -- execute sql: select a.SVR_IP,c.SQL_PORT from oceanbase.DBA_OB_UNITS as a, oceanbase.DBA_OB_TENANTS as b, oceanbase.DBA_OB_SERVERS as c  where a.TENANT_I
D=b.TENANT_ID and a.SVR_IP=c.SVR_IP and a.svr_port=c.SVR_PORT and TENANT_NAME=%s. args: ('ocp_meta',)
[2024-08-07 08:23:59.062] [DEBUG] -- connect 127.0.0.1 -P2881 -uroot@ocp_meta -p

第二次:
[ERROR] 127.0.0.1: failed to connect meta db
[ERROR] ocp-express start failed

Get local repositories and plugins ok
Cluster status check ok
Get added repositories and plugins ok
Open ssh connection ok
Generate observer configuration ok
Connect to observer 127.0.0.1:2881 ok
+-------------------------------------------------------------------------------------------+
|                                          Packages                                         |
+-------------+---------+------------------------+------------------------------------------+
| Repository  | Version | Release                | Md5                                      |
+-------------+---------+------------------------+------------------------------------------+
| obagent     | 4.2.2   | 100000042024011120.el7 | 19739a07a12eab736aff86ecf357b1ae660b554e |
| ocp-express | 4.2.2   | 100000022024011120.el7 | 09ffcf156d1df9318a78af52656f499d2315e3f7 |
+-------------+---------+------------------------+------------------------------------------+
Repository integrity check ok
Load param plugin ok
Parameter check ok
Initializes obagent work home ok
Initializes ocp-express work home ok
Remote obagent-4.2.2-100000042024011120.el7-19739a07a12eab736aff86ecf357b1ae660b554e repository install ok
Remote obagent-4.2.2-100000042024011120.el7-19739a07a12eab736aff86ecf357b1ae660b554e repository lib check ok
Remote ocp-express-4.2.2-100000022024011120.el7-09ffcf156d1df9318a78af52656f499d2315e3f7 repository install ok
Remote ocp-express-4.2.2-100000022024011120.el7-09ffcf156d1df9318a78af52656f499d2315e3f7 repository lib check !!
Try to get lib-repository
Remote openjdk-jre-1.8.0_322-b09.el7-051aa69c5abb8697d15c2f0dcb1392b3f815f7ed repository install ok
Remote ocp-express-4.2.2-100000022024011120.el7-09ffcf156d1df9318a78af52656f499d2315e3f7 repository lib check ok
Search plugins ok
Load cluster param plugin ok
Check before start obagent ok
Check before start ocp-express ok
Start obagent ok
obagent program health check ok
Connect to Obagent ok
Start ocp-express x
[ERROR] 127.0.0.1: failed to connect meta db

[ERROR] ocp-express start failed
+-------------------------------------------------------------------+
|                              obagent                              |
+----------------+--------------------+--------------------+--------+
| ip             | mgragent_http_port | monagent_http_port | status |
+----------------+--------------------+--------------------+--------+
| xxxxxx | 8089               | 8088               | active |
+----------------+--------------------+--------------------+--------+
See https://www.oceanbase.com/product/ob-deployer/error-codes .
Trace ID: c40c909a-545a-11ef-bb3a-6c92bfce2490
If you want to view detailed obd logs, please run: obd display-trace c40c909a-545a-11ef-bb3a-6c92bfce2490

哪里能获取到ocp_meta的密码吗?修改下是不是就可以启动了。
还是只能删了重新部署

原本就存在oms的机器,是又准备安装个ocp么

这台服务器之前安装过oms,前面说的端口冲突的问题,我把oms停了,现在agent安装成功了。

但是第一次安装的时候ocp_meta租户建成功了,agent因为端口冲突失败了。
第二次,把原来的oms停掉,再次安装,agent安装成功了,但是启动ocp失败,看日志是连不上ocp_meta库,手动连接测试密码不对。这个租户是第一次安装的时候就创建了的,这个密码哪里能看到吗?怎么修改下?

ocp_meta租户root密码设置的随机么,正常情况下这个密码会在安装完成后罗列出来,你可以看看yaml文件里现在有没有,如果没有就需要重新安装了

ocp_monitor的密码都能看到,元数据库的密码没找到

可能需要你重装了 :joy: