nacos用了挺久了,今天记录一下控制台打印的1.4.1心跳报文,随机抽出一条格式化看看
{
"type": "dom",
"data": {
"name ": "DEFAULT_GROUP @ @order-service",
"clusters ": "",
"cacheMillis ": 10000,
"hosts ": [{
"instanceId": "192.168.120.123 #7001# DEFAULT# DEFAULT_GROUP @ @order-service ",
"ip ": "192.168.120.123 ",
"port ": 7001,
"weight ": 1.0,
"healthy ": true,
"enabled ": true,
"ephemeral ": true,
"clusterName ": "DEFAULT ",
"serviceName ": "DEFAULT_GROUP @ @order-service",
"metadata ": {
"preserved.register.source ": "SPRING_CLOUD "
},
"instanceHeartBeatInterval ": 5000,
"instanceHeartBeatTimeOut ": 15000,
"ipDeleteTimeout ": 30000
}],
"lastRefTime ": 1639028669607,
"checksum ": "",
"allIPs ": false,
"reachProtectionThreshold ": false,
"valid ": true
},
"lastRefTime ": 2692317098726123
}
见文知意,下面是一些比较重要的参数:
"instanceHeartBeatInterval ":5000, 实例健康心跳间隔5秒
"instanceHeartBeatTimeOut ":15000, 实例健康心跳超时时间15秒
"ipDeleteTimeout ":30000 实例中ip超时删除时间30秒
当然也少不了实例的一些基本信息,比如服务名(实例名)、ip、端口、分组名称、集群名称、权重、健康状态、可用状态等等。