當前位置:網站首頁>Nacos微服務注册問題排查

Nacos微服務注册問題排查

2022-01-27 10:04:27 程序員社區

Nacos微服務注册問題排查 , 你了解嗎? 本文就為大家帶來了一篇 Nacos微服務注册問題排查 一起看看吧!
另外小編還收集了很多不錯的編程資源,希望對你有幫助:點擊查看
祝您生活愉快~

項目組反饋微服務注册不上nacos,於是開始問題排查:

#1、查看nacos日志

2021-05-06 23:59:55,908 WARN [CLIENT-BEAT] The instance has been removed for health mechanism, perform data compensation operations, beat: {"load":0.0,"cpu":0.0,"rt":0.0,"qps":0.0,"mem":0.0,"port":8305,"ip":"172.30.125.54","serviceName":"[email protected]@dmp-analysis","cluster":"DEFAULT","weight":1.0,"ephemeral":true,"metadata":{"preserved.register.source":"SPRING_CLOUD"}}, serviceName: [email protected]@dmp-analysis

##微服務注册上來後,過了會就會被踢下線。

#2、查看具體微服務日志

2021-05-07 14:40:27.643 [INFO ] [com.alibaba.nacos.naming.beat.sender] [NamingProxy.java:196] - [REGISTER-SERVICE] public registering service [email protected]@dmp-system with instance: {"clusterName":"DEFAULT","enabled":true,"ephemeral":true,"healthy":true,"instanceHeartBeatInterval":5000,"instanceHeartBeatTimeOut":15000,"ip":"172.30.125.54","ipDeleteTimeout":30000,"metadata":{"preserved.register.source":"SPRING_CLOUD"},"port":8304,"serviceName":"[email protected]@dmp-system","weight":1.0}

##查看nacos的進程信息

##netstat -lntp | grep 8848

Nacos微服務注册問題排查插圖

發現協議是ip v6,而微服務那塊是通過ip v4來通信的。所以我們的方案是先禁用ip v6,通過ip v4來通信。

##禁用IPv6

sysctl -w net.ipv6.conf.all.disable_ipv6=1

sysctl -w net.ipv6.conf.default.disable_ipv6=1

##重啟nacos

sh shutdown.sh

sh startup.sh -m standalone

##查看nacos的進程信息 netstat -lntp | grep 8848

Nacos微服務注册問題排查插圖1

已監聽ip v4地址。至此問題解决。

版權聲明
本文為[程序員社區]所創,轉載請帶上原文鏈接,感謝
https://cht.chowdera.com/2022/01/202201271004265709.html

隨機推薦