【 使用环境 】生产环境 or 测试环境
【 OB or 其他组件 】
【 使用版本 】obproxy版本:4.3.2.0 oceanbaser 4.3.5.0版本
【问题描述】oat和ocp部署主机下电重启后,oat可以正常访问,但是ocp网页端无法访问。
netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2033/sshd
tcp        0      0 0.0.0.0:7000            0.0.0.0:*               LISTEN      11671/uwsgi
tcp        0      0 0.0.0.0:2881            0.0.0.0:*               LISTEN      9706/observer
tcp        0      0 127.0.0.1:7010          0.0.0.0:*               LISTEN      11672/oat_exporter
tcp        0      0 0.0.0.0:2882            0.0.0.0:*               LISTEN      9706/observer
tcp        0      0 127.0.0.1:7011          0.0.0.0:*               LISTEN      11673/prometheus
tcp        0      0 0.0.0.0:2883            0.0.0.0:*               LISTEN      9717/./bin/metaprox
tcp        0      0 127.0.0.1:7012          0.0.0.0:*               LISTEN      11670/alertmanager
tcp        0      0 0.0.0.0:2884            0.0.0.0:*               LISTEN      9717/./bin/metaprox
tcp        0      0 0.0.0.0:2022            0.0.0.0:*               LISTEN      9102/sshd
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      11646/mariadbd
tcp        0      0 127.0.0.1:18127         0.0.0.0:*               LISTEN      11671/uwsgi
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1107/rpcbind
tcp6       0      0 :::22                   :::*                    LISTEN      2033/sshd
tcp6       0      0 127.0.0.1:9111          :::*                    LISTEN      517176/java
tcp6       0      0 :::9090                 :::*                    LISTEN      1/systemd
tcp6       0      0 :::2022                 :::*                    LISTEN      9102/sshd
tcp6       0      0 :::62888                :::*                    LISTEN      9560/ocp_mgragent
tcp6       0      0 :::62889                :::*                    LISTEN      9573/ocp_monagent
tcp6       0      0 :::3306                 :::*                    LISTEN      11646/mariadbd
tcp6       0      0 :::111                  :::*                    LISTEN      1107/rpcbind
tcp6       0      0 :::8080                 :::*                    LISTEN      517176/java
运行mysql -h******.24 -P2881 -uroot@sys -p**** -A -c --prompt “OceanBase(\u@\d)>” 可以进入。
日志ocp.log:
2025-05-06 21:33:45.222 ERROR 9 — [obsdk-init-thread-5,39ea41c47016a0a4,fb1eb2b61a8d2d03] c.o.o.o.c.impl.AbstractConnector         : [obsdk] init druid datasource failed. connectProperties=ConnectProperties(connectionMode=direct, address=172.16.104.24, port=2881, obsAddrList=[ObServerAddr(address=172.16.104.24, port=2881), ObServerAddr(address=172.16.104.25, port=2881), ObServerAddr(address=172.16.104.26, port=2881)], username=root, tenantName=sys, clusterName=cluster1, obClusterId=1745818328, proxy=null, odpSocketConfig=null, vpcId=1, compatibilityMode=MYSQL, database=oceanbase), error message:Could not connect to HostAddress{host=‘172.16.104.24’, port=2881}. Connection refused (Connection refused)
2025-05-06 21:33:45.227 ERROR 9 — [ocp-async-9,39ea41c47016a0a4,2508821280c8036e] c.o.ocp.obsdk.connector.ObConnectors     : [obsdk] init ob connector failed, connectProperties=ConnectProperties(connectionMode=direct, address=172.16.104.24, port=2881, obsAddrList=[ObServerAddr(address=172.16.104.24, port=2881), ObServerAddr(address=172.16.104.25, port=2881), ObServerAddr(address=172.16.104.26, port=2881)], username=root, tenantName=sys, clusterName=cluster1, obClusterId=1745818328, proxy=null, odpSocketConfig=null, vpcId=1, compatibilityMode=MYSQL, database=oceanbase), cause:java.sql.SQLNonTransientConnectionException: Could not connect to HostAddress{host=‘172.16.104.24’, port=2881}. Connection refused (Connection refused)
2025-05-06 21:33:45.227  WARN 9 — [ocp-async-9,39ea41c47016a0a4,2508821280c8036e] c.o.ocp.obsdk.connector.ObConnectors     : [obsdk] try to create ob connector of ‘direct’ mode failed, observer addr:ObServerAddr(address=172.16.104.24, port=2881), message:[obsdk] init ob connector failed, connectProperties=ConnectProperties(connectionMode=direct, address=172.16.104.24, port=2881, obsAddrList=[ObServerAddr(address=172.16.104.24, port=2881), ObServerAddr(address=172.16.104.25, port=2881), ObServerAddr(address=172.16.104.26, port=2881)], username=root, tenantName=sys, clusterName=cluster1, obClusterId=1745818328, proxy=null, odpSocketConfig=null, vpcId=1, compatibilityMode=MYSQL, database=oceanbase), cause:java.sql.SQLNonTransientConnectionException: Could not connect to HostAddress{host=‘172.16.104.24’, port=2881}. Connection refused (Connection refused)
2025-05-06 21:33:45.228 ERROR 9 — [Druid-ConnectionPool-Create-183334019,] com.alibaba.druid.pool.DruidDataSource   : create connection SQLException, url: jdbc:oceanbase://172.16.104.24:2881/oceanbase?useUnicode=true&characterEncoding=UTF8&encloseParamInParentheses=false, errorCode -1, state 08000
java.sql.SQLNonTransientConnectionException: Could not connect to HostAddress{host=‘172.16.104.24’, port=2881}. Connection refused (Connection refused)
at com.oceanbase.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:122)
at com.oceanbase.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:225)
at com.oceanbase.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1752)
at com.oceanbase.jdbc.internal.util.Utils.retrieveProxy(Utils.java:1434)
at com.oceanbase.jdbc.OceanBaseConnection.newConnection(OceanBaseConnection.java:409)
at com.oceanbase.jdbc.Driver.connect(Driver.java:93)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1657)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1723)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2838)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
运行curl -L “http://localhost:8080”,有返回
