开发者社区 > 云原生 > 正文

Nacos上述集群模式下告警,是因为连接mysql异常导致整个集群异常了吗?

Nacos上述集群模式下告警,是因为连接mysql异常导致整个集群异常了吗?
2023-12-19 23:29:25,810 WARN HikariPool-1 - Failed to validate connection com.mysql.cj.jdbc.ConnectionImpl@150eee61 (Communications link failure

The last packet successfully received from the server was 20,009 milliseconds ago. The last packet sent successfully to the server was 20,010 milliseconds ago.). Possibly consider using a shorter maxLifetime value.

2023-12-19 23:29:27,179 INFO [Cluster-nacos1:8848] Server healthy check fail, currentConnection = 1702958250987_10.11.1.11_58150

2023-12-19 23:29:27,180 INFO [Cluster-nacos1:8848] Try to reconnect to a new server, server is not appointed, will choose a random server.

2023-12-19 23:29:28,039 INFO [Cluster-nacos3:8848] Server healthy check fail, currentConnection = 1702958241223_10.11.1.11_39560

2023-12-19 23:29:28,039 INFO [Cluster-nacos3:8848] Try to reconnect to a new server, server is not appointed, will choose a random server.

2023-12-19 23:29:28,273 WARN HikariPool-1 - Failed to validate connection com.mysql.cj.jdbc.ConnectionImpl@2eb23bbc (Communications link failure

The last packet successfully received from the server was 152,630 milliseconds ago. The last packet sent successfully to the server was 152,631 milliseconds ago.). Possibly consider using a shorter maxLifetime value.

2023-12-19 23:29:30,181 ERROR Server check fail, please check server nacos1 ,port 9849 is available , error ={}

java.util.concurrent.TimeoutException: Waited 3000 milliseconds (plus 86087 nanoseconds delay) for io.grpc.stub.ClientCalls$GrpcFuture@37bda231[status=PENDING, info=[GrpcFuture{clientCall=ClientCallImpl{method=MethodDescriptor{fullMethodName=Request/request, type=UNARY, idempotent=false, safe=false, sampledToLocalTracing=true, requestMarshaller=io.grpc.protobuf.lite.ProtoLiteUtils$MessageMarshaller@794b08c8, responseMarshaller=io.grpc.protobuf.lite.ProtoLiteUtils$MessageMarshaller@82645e5, schemaDescriptor=com.alibaba.nacos.api.grpc.auto.RequestGrpc$RequestMethodDescriptorSupplier@61a8356c}}}]]
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:508)
at com.alibaba.nacos.common.remote.client.grpc.GrpcClient.serverCheck(GrpcClient.java:196)
at com.alibaba.nacos.common.remote.client.grpc.GrpcClient.connectToServer(GrpcClient.java:307)
at com.alibaba.nacos.common.remote.client.RpcClient.reconnect(RpcClient.java:498)
at com.alibaba.nacos.common.remote.client.RpcClient.lambda$start$2(RpcClient.java:339)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
2023-12-19 23:29:31,041 ERROR Server check fail, please check server nacos3 ,port 9849 is available , error ={}

展开
收起
嘟嘟嘟嘟嘟嘟 2023-12-25 12:40:19 160 0
2 条回答
写回答
取消 提交回答
  • 根据提供的日志,Nacos集群模式下的告警可能是由于与MySQL的连接异常导致的。当Nacos客户端无法验证或使用现有的数据库连接时,会尝试重新连接到一个新的服务器。在你的日志中,可以看到多次尝试重新连接的记录以及maxLifeTime值过大的警告。这可能意味着Nacos客户端与MySQL服务器之间的连接超时或者被服务器关闭,导致Nacos集群出现异常。建议检查MySQL服务器的wait_timeout设置,以及网络连接和防火墙规则,确保Nacos客户端能够正常地与MySQL服务器通信。考虑适当调整Nacos的maxLifeTime值,以避免因连接超时而导致的问题。

    2023-12-25 14:38:26
    赞同 展开评论 打赏
  • 最后一句说的很明白,检查下nacos3的9849端口。
    2023-12-19 23:29:31,041 ERROR Server check fail, please check server nacos3 ,port 9849 is available , error ={}
    此回答整理自钉群“Nacos社区群3”

    2023-12-25 12:43:05
    赞同 展开评论 打赏

阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。

相关电子书

更多
搭建电商项目架构连接MySQL 立即下载
搭建4层电商项目架构,实战连接MySQL 立即下载
PolarDB MySQL引擎重磅功能及产品能力盛大发布 立即下载

相关镜像