obd demo执行命令的时候提示prometheus端口占用了

【 使用环境 】测试环境
【 OB or 其他组件 】
【 使用版本 】oceanbase 社区版 oceanbase-all-in-one 4.2.1
【问题描述】执行obd demo提示端口(9090)被占用,但是这个服务通过parameter.yaml文件修改以后,再次执行obd demo还是报错,是不是什么东西还要加载一下?

【复现路径】最小化执行obd demo报错
【附件及日志】
[root@localhost bin]# obd demo
Get local repositories ok
Open ssh connection ok
Check for standby tenant ok
Search plugins ok
Cluster status check ok
prometheus work dir cleaning ok
observer work dir cleaning ok
obproxy work dir cleaning ok
obagent work dir cleaning ok
grafana work dir cleaning ok
demo destroyed
Cluster param config check ok
Open ssh connection ok
Generate observer configuration ok
Generate obproxy configuration ok
Generate prometheus configuration ok
Generate obagent configuration ok
Generate grafana configuration ok
±-------------------------------------------------------------------------------------------+
| Packages |
±-------------±--------±-----------------------±-----------------------------------------+
| Repository | Version | Release | Md5 |
±-------------±--------±-----------------------±-----------------------------------------+
| grafana | 7.5.17 | 1 | 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 |
| obagent | 4.2.2 | 100000042024011120.el7 | 19739a07a12eab736aff86ecf357b1ae660b554e |
| prometheus | 2.37.1 | 10000102022110211.el7 | 58913c7606f05feb01bc1c6410346e5fc31cf263 |
| obproxy-ce | 4.2.3.0 | 3.el7 | 0490ebc04220def8d25cb9cac9ac61a4efa6d639 |
| oceanbase-ce | 4.2.1.8 | 108000022024072217.el7 | 499b676f2ede5a16e0c07b2b15991d1160d972e8 |
±-------------±--------±-----------------------±-----------------------------------------+
Repository integrity check ok
Load param plugin ok
Open ssh connection ok
Parameter check ok
Cluster status check ok
Initializes grafana work home ok
Initializes obagent work home ok
Initializes prometheus work home ok
Initializes obproxy work home ok
Initializes observer work home ok
Remote grafana-7.5.17-1-1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 repository install ok
Remote grafana-7.5.17-1-1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 repository lib check 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 prometheus-2.37.1-10000102022110211.el7-58913c7606f05feb01bc1c6410346e5fc31cf263 repository install ok
Remote prometheus-2.37.1-10000102022110211.el7-58913c7606f05feb01bc1c6410346e5fc31cf263 repository lib check ok
Remote obproxy-ce-4.2.3.0-3.el7-0490ebc04220def8d25cb9cac9ac61a4efa6d639 repository install ok
Remote obproxy-ce-4.2.3.0-3.el7-0490ebc04220def8d25cb9cac9ac61a4efa6d639 repository lib check ok
Remote oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8 repository install ok
Remote oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8 repository lib check ok
demo deployed
Get local repositories ok
Search plugins ok
Load cluster param plugin ok
Open ssh connection ok
Check before start observer ok
[WARN] OBD-1011: (127.0.0.1) The recommended value of fs.aio-max-nr is 1048576 (Current value: 65536)
[WARN] OBD-1007: (127.0.0.1) The recommended number of open files is 655350 (Current value: 20000)
[WARN] OBD-1007: (127.0.0.1) The recommended number of max user processes is 655350 (Current value: 120000)
[WARN] OBD-1007: (127.0.0.1) The recommended number of stack size is unlimited (Current value: 8192)
[WARN] OBD-1017: (127.0.0.1) The value of the “vm.max_map_count” must be within [327600, 1310720] (Current value: 65530, Recommended value: 655360)
[WARN] OBD-1012: (127.0.0.1) clog and data use the same disk (/)

Check before start obagent ok
Check before start prometheus x
[ERROR] OBD-1001: 127.0.0.1:9090 port is already used

Check before start obproxy ok
Check before start grafana ok
See https://www.oceanbase.com/product/ob-deployer/error-codes .
Trace ID: a8c9aa16-794e-11ef-87c3-000c2937e154
If you want to view detailed obd logs, please run: obd display-trace a8c9aa16-794e-11ef-87c3-000c2937e154
[root@localhost bin]# systemctl stop firewalld
[root@localhost bin]# systemctl disable firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost bin]# setenforce 0
setenforce: SELinux is disabled
[root@localhost bin]#
[root@localhost bin]#
[root@localhost bin]# obd demo
Get local repositories ok
Open ssh connection ok
Check for standby tenant ok
Search plugins ok
Cluster status check ok
grafana work dir cleaning ok
obagent work dir cleaning ok
prometheus work dir cleaning ok
obproxy work dir cleaning ok
observer work dir cleaning ok
demo destroyed
Cluster param config check ok
Open ssh connection ok
Generate obagent configuration ok
Generate observer configuration ok
Generate grafana configuration ok
Generate obproxy configuration ok
Generate prometheus configuration ok
±-------------------------------------------------------------------------------------------+
| Packages |
±-------------±--------±-----------------------±-----------------------------------------+
| Repository | Version | Release | Md5 |
±-------------±--------±-----------------------±-----------------------------------------+
| prometheus | 2.37.1 | 10000102022110211.el7 | 58913c7606f05feb01bc1c6410346e5fc31cf263 |
| obproxy-ce | 4.2.3.0 | 3.el7 | 0490ebc04220def8d25cb9cac9ac61a4efa6d639 |
| grafana | 7.5.17 | 1 | 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 |
| oceanbase-ce | 4.2.1.8 | 108000022024072217.el7 | 499b676f2ede5a16e0c07b2b15991d1160d972e8 |
| obagent | 4.2.2 | 100000042024011120.el7 | 19739a07a12eab736aff86ecf357b1ae660b554e |
±-------------±--------±-----------------------±-----------------------------------------+
Repository integrity check ok
Load param plugin ok
Open ssh connection ok
Parameter check ok
Cluster status check ok
Initializes prometheus work home ok
Initializes obproxy work home ok
Initializes grafana work home ok
Initializes observer work home ok
Initializes obagent work home ok
Remote prometheus-2.37.1-10000102022110211.el7-58913c7606f05feb01bc1c6410346e5fc31cf263 repository install ok
Remote prometheus-2.37.1-10000102022110211.el7-58913c7606f05feb01bc1c6410346e5fc31cf263 repository lib check ok
Remote obproxy-ce-4.2.3.0-3.el7-0490ebc04220def8d25cb9cac9ac61a4efa6d639 repository install ok
Remote obproxy-ce-4.2.3.0-3.el7-0490ebc04220def8d25cb9cac9ac61a4efa6d639 repository lib check ok
Remote grafana-7.5.17-1-1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 repository install ok
Remote grafana-7.5.17-1-1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 repository lib check ok
Remote oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8 repository install ok
Remote oceanbase-ce-4.2.1.8-108000022024072217.el7-499b676f2ede5a16e0c07b2b15991d1160d972e8 repository lib check ok
Remote obagent-4.2.2-100000042024011120.el7-19739a07a12eab736aff86ecf357b1ae660b554e repository install ok
Remote obagent-4.2.2-100000042024011120.el7-19739a07a12eab736aff86ecf357b1ae660b554e repository lib check ok
demo deployed
Get local repositories ok
Search plugins ok
Load cluster param plugin ok
Open ssh connection ok
Check before start observer ok
[WARN] OBD-1011: (127.0.0.1) The recommended value of fs.aio-max-nr is 1048576 (Current value: 65536)
[WARN] OBD-1007: (127.0.0.1) The recommended number of open files is 655350 (Current value: 20000)
[WARN] OBD-1007: (127.0.0.1) The recommended number of max user processes is 655350 (Current value: 120000)
[WARN] OBD-1007: (127.0.0.1) The recommended number of stack size is unlimited (Current value: 8192)
[WARN] OBD-1017: (127.0.0.1) The value of the “vm.max_map_count” must be within [327600, 1310720] (Current value: 65530, Recommended value: 655360)
[WARN] OBD-1012: (127.0.0.1) clog and data use the same disk (/)

Check before start obagent ok
Check before start prometheus x
[ERROR] OBD-1001: 127.0.0.1:9090 port is already used

Check before start obproxy ok
Check before start grafana ok
See https://www.oceanbase.com/product/ob-deployer/error-codes .
Trace ID: 15f1346a-794f-11ef-8232-000c2937e154
If you want to view detailed obd logs, please run: obd display-trace 15f1346a-794f-11ef-8232-000c2937e154
[root@localhost bin]#

1 个赞

obd demo
–oceanbase-ce.mysql_port=2881
–oceanbase-ce.rpc_port=2882
–obproxy-ce.listen_port=2883
–obproxy-ce.prometheus_listen_port=2884
–obagent.monagent_http_port=8088
–obagent.mgragent_http_port=8089
–grafana.port=3000
–prometheus.port=9090
–oceanbase-ce.datafile_size=xxG
–oceanbase-ce.log_disk_size=xxG
–oceanbase-ce.memory_limit=xG
后面是默认端口,可以自定义修改的
obd demo --oceanbase-ce.Prometheus=9091。可指定端口部署

您给的命令执行以后还是报一样的错误

@ AntTech_RXKBOI

9090端口为操作系统自带的管理界面服务所占用,名叫"cockpit"。
通常来说,管理员并不需要此服务,并且例如我公司,默认基线标准里,是将其禁用的。

请在OS执行(记得按照顺序哦,因为服务有依赖关系)

systemctl stop cockpit.socket
systemctl stop cockpit.service
systemctl disable cockpit.socket
systemctl disable cockpit.service

而后进行OB部署,就可以畅游OB了。

关于Cockpit ,是红帽开发的网页版图像化服务管理工具,优点是无需中间层,且可以管理多种服务。

[root@ecs ~]# yum info cockpit
Installed Packages
Name        : cockpit
Arch        : x86_64
Version     : 195.12
Release     : 1.el7.centos
Size        : 51 k
Repo        : installed
From repo   : extras
Summary     : Web Console for Linux servers
URL         : https://cockpit-project.org/
License     : LGPLv2+
Description : The Cockpit Web Console enables users to administer GNU/Linux servers using a
            : web browser.
            : 
            : It offers network configuration, log inspection, diagnostic reports, SELinux
            : troubleshooting, interactive command-line sessions, and more

[root@ecs ~]# systemctl  start cockpit
[root@ecs ~]# systemctl status cockpit
● cockpit.service - Cockpit Web Service
   Loaded: loaded (/usr/lib/systemd/system/cockpit.service; static; vendor preset: disabled)
   Active: active (running) since Mon 2024-09-23 11:56:52 CST; 3s ago
     Docs: man:cockpit-ws(8)
  Process: 28050 ExecStartPre=/usr/sbin/remotectl certificate --ensure --user=root --group=cockpit-ws --selinux-type=etc_t (code=exited, status=0/SUCCESS)
 Main PID: 28065 (cockpit-ws)
    Tasks: 2
   Memory: 1.4M
   CGroup: /system.slice/cockpit.service
           └─28065 /usr/libexec/cockpit-ws

Sep 23 11:56:52 ecs systemd[1]: Starting Cockpit Web Service...
Sep 23 11:56:52 ecs remotectl[28050]: Generating temporary certificate using: sscg --quiet --lifetime 3650 --key-...
Sep 23 11:56:52 ecs remotectl[28050]: Error generating temporary dummy cert using sscg, falling back to openssl
Sep 23 11:56:52 ecs remotectl[28050]: Generating temporary certificate using: openssl req -x509 -days 36500 -newk...
Sep 23 11:56:52 ecs remotectl[28050]: /usr/bin/chcon: can't apply partial context to unlabeled file ‘/etc/co…d.cert’
Sep 23 11:56:52 ecs remotectl[28050]: remotectl: couldn't change SELinux type context 'etc_t' for certificat...ode 1
Sep 23 11:56:52 ecs systemd[1]: Started Cockpit Web Service.
Sep 23 11:56:52 ecs cockpit-ws[28065]: Using certificate: /etc/cockpit/ws-certs.d/0-self-signed.cert
Hint: Some lines were ellipsized, use -l to show in full.

[root@ecs ~]# netstat -tunlp | grep 9090
tcp6       0      0 :::9090                 :::*                    LISTEN      1/systemd           
[root@ecs ~]#

[root@ecs ~]# systemctl stop cockpit.socket
[root@ecs ~]# systemctl stop cockpit.service
[root@ecs ~]# netstat -tunlp | grep 9090
[root@ecs ~]# systemctl disable cockpit.socket
[root@ecs ~]# systemctl disable cockpit.service
[root@ecs ~]# 

@AntTech_RXKBOI 试试哦。

就是这个问题导致的,之前杀pid不能直接杀掉,感谢大佬,解决了 :grinning:

杀掉可能OS重启后就再起来了,可以考虑按照给的命令顺序,禁用即可。
欢迎采纳,共同交流。

这边刚才测试一下 命令是可用的,可能是是–为中文导致的这边刚才删除重新填写后命令是可用的