nacos服务注册流程

一、客户端自动注册实例流程

1.首先客户端需要引入服务发现包

  <groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId><version>2.2.6.RELEASE</version>

2. NacosServiceRegistryAutoConfiguration 配置类

此类在spring-cloud-starter-alibaba-nacos-discovery客户包里面会自动在当前SPRINGBOOT容器注册

3.此配置类最核心的实体注册类为NacosAutoServiceRegistration,

查看此类的继承属性

发现此类继承于spring cloud common的AbstractAutoServiceRegistration抽象继承类,此类包含了与SPRING对接的一系列自动注册功能。并且实现了ApplicationListener接口,所以会监听SPRING WEB事件。

4.监听ServletWebServerInitializedEvent事件

5.AbstractAutoServiceRegistration自动更新服务端口

6.NacosAutoServiceRegistration更新端口,以及配置里面的分组,集群等信息。

7.跳到父类的注册方法

8.最终调用了NacosServiceRegistry.registry

9.接着触发了NacosNamingService.registerInstance

注意这里,如果是临时节点,还会触发客户端定时发送心跳。

这里已经跳到了nacos-client-1.4.2的包,相当于是具体注册中心客户端的实现。

10.接着跳到了NamingProxy.registerService,

11.最终发起HTTP调用请求,NamingProxy

public String reqApi(String api, Map<String, String> params, Map<String, String> body, List<String> servers,String method) throws NacosException {params.put(CommonParams.NAMESPACE_ID, getNamespaceId());if (CollectionUtils.isEmpty(servers) && StringUtils.isBlank(nacosDomain)) {throw new NacosException(NacosException.INVALID_PARAM, "no server available");}NacosException exception = new NacosException();if (StringUtils.isNotBlank(nacosDomain)) {for (int i = 0; i < maxRetry; i++) {try {return callServer(api, params, body, nacosDomain, method);} catch (NacosException e) {exception = e;if (NAMING_LOGGER.isDebugEnabled()) {NAMING_LOGGER.debug("request {} failed.", nacosDomain, e);}}}} else {Random random = new Random(System.currentTimeMillis());int index = random.nextInt(servers.size());for (int i = 0; i < servers.size(); i++) {String server = servers.get(index);try {return callServer(api, params, body, server, method);} catch (NacosException e) {exception = e;if (NAMING_LOGGER.isDebugEnabled()) {NAMING_LOGGER.debug("request {} failed.", server, e);}}index = (index + 1) % servers.size();}}NAMING_LOGGER.error("request: {} failed, servers: {}, code: {}, msg: {}", api, servers, exception.getErrCode(),exception.getErrMsg());throw new NacosException(exception.getErrCode(),"failed to req API:" + api + " after all servers(" + servers + ") tried: " + exception.getMessage());}

如果是带域名,或者单机运行,则直接发起HTTP调用,如果是集群NACOS服务列表,则随机找到一台NACOS服务器发起请求。

12.客户端注册完成

二、服务端注册流程

1.下载1.4.2源码,本地启动

-Dnacos.standalone=true -Dnacos.home=e:
acos

启动类为com.alibaba.nacos.Nacos

2.服务端是SPRINGBOOT项目,找到控制器接口

3.首先进入InstanceController.register

4.进入ServiceManager.register,此类就是客户端服务实例的管理类,保存客户端实例的注册表。

@Component
public class ServiceManager implements RecordListener<Service> {/*** Map(namespace, Map(group::serviceName, Service)). 真正的注册表*/private final Map<String, Map<String, Service>> serviceMap = new ConcurrentHashMap<>();private final LinkedBlockingDeque<ServiceKey> toBeUpdatedServicesQueue = new LinkedBlockingDeque<>(1024 * 1024);private final Synchronizer synchronizer = new ServiceStatusSynchronizer();private final Lock lock = new ReentrantLock();@Resource(name = "consistencyDelegate")//一致性协调协议 private ConsistencyService consistencyService;private final SwitchDomain switchDomain;private final DistroMapper distroMapper;private final ServerMemberManager memberManager;private final PushService pushService;private final RaftPeerSet raftPeerSet;

5.如果服务不存在,则会创建一个空的Service对象。

注意,此时的servicename已经带了分组了。

6.调试日志输出等级

因为服务端源码有多个线程协作,调试比较麻烦,建议看代码,然后加日志打印输出。

可以把naming的LOGBACK日志输出等级调成DEBUG

<?xml version="1.0" encoding="UTF-8"?>
<!--~ Copyright 1999-2018 Alibaba Group Holding Ltd.~~ Licensed under the Apache License, Version 2.0 (the "License");~ you may not use this file except in compliance with the License.~ You may obtain a copy of the License at~~      http://www.apache.org/licenses/LICENSE-2.0~~ Unless required by applicable law or agreed to in writing, software~ distributed under the License is distributed on an "AS IS" BASIS,~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.~ See the License for the specific language governing permissions and~ limitations under the License.--><included><springProperty scope="context" name="logPath" source="nacos.logs.path" defaultValue="${user.home}/nacos/logs"/><property name="LOG_HOME" value="${logPath}"/><appender name="naming-server"class="ch.qos.logback.core.rolling.RollingFileAppender"><file>${LOG_HOME}/naming-server.log</file><append>true</append><rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"><fileNamePattern>${LOG_HOME}/naming-server.log.%d{yyyy-MM-dd}.%i</fileNamePattern><maxFileSize>2GB</maxFileSize><maxHistory>15</maxHistory><totalSizeCap>7GB</totalSizeCap><cleanHistoryOnStart>true</cleanHistoryOnStart></rollingPolicy><encoder><Pattern>%date %level  [%C:%M:%L] %msg%n%n</Pattern><charset>UTF-8</charset></encoder></appender><appender name="naming-raft"class="ch.qos.logback.core.rolling.RollingFileAppender"><file>${LOG_HOME}/naming-raft.log</file><append>true</append><rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"><fileNamePattern>${LOG_HOME}/naming-raft.log.%d{yyyy-MM-dd}.%i</fileNamePattern><maxFileSize>20MB</maxFileSize><maxHistory>15</maxHistory><totalSizeCap>128MB</totalSizeCap><cleanHistoryOnStart>true</cleanHistoryOnStart></rollingPolicy><encoder><Pattern>%date %level  [%C:%M:%L] %msg%n%n</Pattern><charset>UTF-8</charset></encoder></appender><appender name="naming-event"class="ch.qos.logback.core.rolling.RollingFileAppender"><file>${LOG_HOME}/naming-event.log</file><append>true</append><rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"><fileNamePattern>${LOG_HOME}/naming-event.log.%d{yyyy-MM-dd}.%i</fileNamePattern><maxFileSize>20MB</maxFileSize><maxHistory>15</maxHistory><totalSizeCap>128MB</totalSizeCap><cleanHistoryOnStart>true</cleanHistoryOnStart></rollingPolicy><encoder><Pattern>%date %level [%C:%M:%L] %msg%n%n</Pattern><charset>UTF-8</charset></encoder></appender><appender name="naming-push"class="ch.qos.logback.core.rolling.RollingFileAppender"><file>${LOG_HOME}/naming-push.log</file><append>true</append><rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"><fileNamePattern>${LOG_HOME}/naming-push.log.%d{yyyy-MM-dd}.%i</fileNamePattern><maxFileSize>20MB</maxFileSize><maxHistory>15</maxHistory><totalSizeCap>128MB</totalSizeCap><cleanHistoryOnStart>true</cleanHistoryOnStart></rollingPolicy><encoder><Pattern>%date %level  [%C:%M:%L] %msg%n%n</Pattern><charset>UTF-8</charset></encoder></appender><appender name="naming-rt"class="ch.qos.logback.core.rolling.RollingFileAppender"><file>${LOG_HOME}/naming-rt.log</file><append>true</append><rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"><fileNamePattern>${LOG_HOME}/naming-rt.log.%d{yyyy-MM-dd}.%i</fileNamePattern><maxFileSize>1GB</maxFileSize><maxHistory>15</maxHistory><totalSizeCap>3GB</totalSizeCap><cleanHistoryOnStart>true</cleanHistoryOnStart></rollingPolicy><encoder><Pattern>%date %level  [%C:%M:%L] %msg%n%n</Pattern><charset>UTF-8</charset></encoder></appender><appender name="naming-performance"class="ch.qos.logback.core.rolling.RollingFileAppender"><file>${LOG_HOME}/naming-performance.log</file><append>true</append><rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"><fileNamePattern>${LOG_HOME}/naming-performance.log.%d{yyyy-MM-dd}.%i</fileNamePattern><maxFileSize>50MB</maxFileSize><maxHistory>15</maxHistory><totalSizeCap>512MB</totalSizeCap><cleanHistoryOnStart>true</cleanHistoryOnStart></rollingPolicy><encoder><Pattern>%date %level  [%C:%M:%L] %msg%n%n</Pattern><charset>UTF-8</charset></encoder></appender><appender name="naming-router"class="ch.qos.logback.core.rolling.RollingFileAppender"><file>${LOG_HOME}/naming-router.log</file><append>true</append><rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"><fileNamePattern>${LOG_HOME}/naming-router.log.%d{yyyy-MM-dd}.%i</fileNamePattern><maxFileSize>2GB</maxFileSize><maxHistory>15</maxHistory><totalSizeCap>7GB</totalSizeCap><cleanHistoryOnStart>true</cleanHistoryOnStart></rollingPolicy><encoder><Pattern>%date|%msg%n</Pattern><charset>UTF-8</charset></encoder></appender><appender name="naming-cache"class="ch.qos.logback.core.rolling.RollingFileAppender"><file>${LOG_HOME}/naming-cache.log</file><append>true</append><rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"><fileNamePattern>${LOG_HOME}/naming-cache.log.%d{yyyy-MM-dd}.%i</fileNamePattern><maxFileSize>1GB</maxFileSize><maxHistory>15</maxHistory><totalSizeCap>3GB</totalSizeCap><cleanHistoryOnStart>true</cleanHistoryOnStart></rollingPolicy><encoder><Pattern>%date|%msg%n</Pattern><charset>UTF-8</charset></encoder></appender><appender name="naming-device"class="ch.qos.logback.core.rolling.RollingFileAppender"><file>${LOG_HOME}/naming-device.log</file><append>true</append><rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"><fileNamePattern>${LOG_HOME}/naming-device.log.%d{yyyy-MM-dd}.%i</fileNamePattern><maxFileSize>2GB</maxFileSize><maxHistory>15</maxHistory><totalSizeCap>7GB</totalSizeCap><cleanHistoryOnStart>true</cleanHistoryOnStart></rollingPolicy><encoder><Pattern>%date|%msg%n</Pattern><charset>UTF-8</charset></encoder></appender><appender name="naming-tag"class="ch.qos.logback.core.rolling.RollingFileAppender"><file>${LOG_HOME}/naming-tag.log</file><append>true</append><rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"><fileNamePattern>${LOG_HOME}/naming-tag.log.%d{yyyy-MM-dd}.%i</fileNamePattern><maxFileSize>1GB</maxFileSize><maxHistory>15</maxHistory><totalSizeCap>3GB</totalSizeCap><cleanHistoryOnStart>true</cleanHistoryOnStart></rollingPolicy><encoder><Pattern>%date %level %msg%n%n</Pattern><charset>UTF-8</charset></encoder></appender><appender name="naming-debug"class="ch.qos.logback.core.rolling.RollingFileAppender"><file>${LOG_HOME}/naming-debug.log</file><append>true</append><rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"><fileNamePattern>${LOG_HOME}/naming-debug.log.%d{yyyy-MM-dd}.%i</fileNamePattern><maxFileSize>20MB</maxFileSize><maxHistory>15</maxHistory><totalSizeCap>128MB</totalSizeCap><cleanHistoryOnStart>true</cleanHistoryOnStart></rollingPolicy><encoder><Pattern>%date %level %msg%n%n</Pattern><charset>UTF-8</charset></encoder></appender><appender name="naming-distro"class="ch.qos.logback.core.rolling.RollingFileAppender"><file>${LOG_HOME}/naming-distro.log</file><append>true</append><rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"><fileNamePattern>${LOG_HOME}/naming-distro.log.%d{yyyy-MM-dd}.%i</fileNamePattern><maxFileSize>1GB</maxFileSize><maxHistory>7</maxHistory><totalSizeCap>3GB</totalSizeCap><cleanHistoryOnStart>true</cleanHistoryOnStart></rollingPolicy><encoder><Pattern>%date %level  [%C:%M:%L] %msg%n%n</Pattern><charset>UTF-8</charset></encoder></appender><appender name="CONSOLE2" class="ch.qos.logback.core.ConsoleAppender"><encoder><Pattern>%date %level [%thread] [%C:%M:%L] %msg%n%n</Pattern><charset>UTF-8</charset></encoder></appender><logger name="com.alibaba.nacos.naming.main" additivity="false"><level value="DEBUG"/><appender-ref ref="naming-server"/><appender-ref ref="CONSOLE2"/></logger><logger name="com.alibaba.nacos.naming.raft" additivity="false"><level value="DEBUG"/><appender-ref ref="naming-raft"/><appender-ref ref="CONSOLE2"/></logger><logger name="com.alibaba.nacos.naming.distro" additivity="false"><level value="DEBUG"/><appender-ref ref="naming-distro"/><appender-ref ref="CONSOLE2"/></logger><logger name="com.alibaba.nacos.naming.event" additivity="false"><level value="DEBUG"/><appender-ref ref="naming-event"/><appender-ref ref="CONSOLE2"/></logger><logger name="com.alibaba.nacos.naming.push" additivity="false"><level value="DEBUG"/><appender-ref ref="naming-push"/><appender-ref ref="CONSOLE2"/></logger><logger name="com.alibaba.nacos.naming.rt" additivity="false"><level value="DEBUG"/><appender-ref ref="naming-rt"/><appender-ref ref="CONSOLE2"/></logger><logger name="com.alibaba.nacos.naming.performance" additivity="false"><level value="DEBUG"/><appender-ref ref="naming-performance"/></logger><logger name="com.alibaba.nacos.naming.router" additivity="false"><level value="DEBUG"/><appender-ref ref="naming-router"/></logger><logger name="com.alibaba.nacos.naming.cache" additivity="false"><level value="DEBUG"/><appender-ref ref="naming-cache"/></logger><logger name="com.alibaba.nacos.naming.debug" additivity="false"><level value="DEBUG"/><appender-ref ref="naming-debug"/><appender-ref ref="CONSOLE2"/></logger></included>

7.业务日志APPENDER类分析

有一个统一的日志输出类,将各种业务分别用不同的APPENDER对象输出

public class Loggers {//客户端推送public static final Logger PUSH = LoggerFactory.getLogger("com.alibaba.nacos.naming.push");//心跳检测public static final Logger CHECK_RT = LoggerFactory.getLogger("com.alibaba.nacos.naming.rt");//服务相关业务public static final Logger SRV_LOG = LoggerFactory.getLogger("com.alibaba.nacos.naming.main");//通知事件,如新服务注册,变更,下线等。public static final Logger EVT_LOG = LoggerFactory.getLogger("com.alibaba.nacos.naming.event");//一致性RAFT系统 CPpublic static final Logger RAFT = LoggerFactory.getLogger("com.alibaba.nacos.naming.raft");//一致性协议 ,APpublic static final Logger DISTRO = LoggerFactory.getLogger("com.alibaba.nacos.naming.distro");//性能分析public static final Logger PERFORMANCE_LOG = LoggerFactory.getLogger("com.alibaba.nacos.naming.performance");

8.注册后的serviceMap结构如下:

单个Service的示例结构如下:

{"name":"mall@@joyday","protectThreshold":0,"groupName":"mall","metadata":{},"finalizeCount":2,"owners":[],"resetWeight":false,"enabled":true,"selector":{"type":"none"},"namespaceId":"public","ipDeleteTimeout":30000,"lastModifiedMillis":1722671874301,"checksum":"f936119262bea62fbfbb16c10f955e96","clusterMap":{"beijing":{"serviceName":"mall@@joyday","name":"beijing","healthChecker":{"type":"TCP"},"defaultPort":80,"defaultCheckPort":80,"useIPPort4Check":true,"metadata":{},"sitegroup":"","defCkport":80,"empty":false,"defIPPort":80}},"empty":false
}

9.进入ServiceMananger.addInstance,查看保存到一致性服务的dataStore中的KEY,为命名空间+分组+服务名,值为Instances,这个对象里面又包含了一个instance的LIST.

10.进入ServiceMananger.updateIpAddresses,可以更详细看到dataMap,这个就是把dataMap当作旧的注册表,把二级缓存Service中的ClusterMap作为新对象进行比较,从而把新的实例加进到datamap中。

11.进入到DistroConsistencyServiceImpl.onPut,查看单个dataTum

12.Service为其中一个listener,异步收到消息。

13.再将变化的Instances中的实例保存重新刷新到Service的clusterMap中,Service.

updateIPs

注意在这里,会给pushService发出通知,通知相关客户端此服务的实例发生变化。

14.我们再启动一个新的实例,查看clusterMap,dataStore的变化。看到端口变成了8066

15.第一次8064服务启动日志

2024-08-03 16:40:36,500 DEBUG [http-nio-8848-exec-5] [com.alibaba.nacos.naming.controllers.InstanceController:doSrvIpxt:691] no instance to serve for service: mall@@joyday2024-08-03 16:40:37,151 INFO [http-nio-8848-exec-7] [com.alibaba.nacos.naming.core.ServiceManager:createServiceIfAbsent:471] creating empty service public:mall@@joyday2024-08-03 16:40:37,158 DEBUG [http-nio-8848-exec-7] [com.alibaba.nacos.naming.core.Service:recalculateChecksum:549] service to json: {"invalidIPCount":0,"name":"mall@@joyday","ipCount":0,"owners":[],"protectThreshold":0.0,"clusters":[]}2024-08-03 16:40:37,162 INFO [http-nio-8848-exec-7] [com.alibaba.nacos.naming.consistency.persistent.raft.RaftCore:listen:962] add listener: com.alibaba.nacos.naming.iplist.public##mall@@joyday2024-08-03 16:40:37,251 INFO [http-nio-8848-exec-7] [com.alibaba.nacos.naming.core.ServiceManager:putServiceAndInit:902] [NEW-SERVICE] {"name":"mall@@joyday","protectThreshold":0.0,"groupName":"mall","metadata":{},"finalizeCount":0,"owners":[],"resetWeight":false,"enabled":true,"selector":{"type":"none"},"namespaceId":"public","ipDeleteTimeout":30000,"lastModifiedMillis":1722674437153,"checksum":"45e19250c6a2ded80ed14b5aca7a6ee4","clusterMap":{},"empty":true}2024-08-03 16:40:37,251 INFO [http-nio-8848-exec-7] [com.alibaba.nacos.naming.core.ServiceManager:createServiceIfAbsent:491] createServiceIfAbsent end getClusterMap {}2024-08-03 16:40:37,251 INFO [http-nio-8848-exec-7] [com.alibaba.nacos.naming.core.ServiceManager:addInstance:652]  addInstance key:com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday2024-08-03 16:40:37,252 INFO [http-nio-8848-exec-7] [com.alibaba.nacos.naming.core.ServiceManager:updateIpAddresses:806]  updateIpAddresses before  currentIPs:[],instanceMap:{}2024-08-03 16:40:37,257 WARN [http-nio-8848-exec-7] [com.alibaba.nacos.naming.core.ServiceManager:updateIpAddresses:815] cluster: beijing not found, ip: {"instanceId":"10.6.33.23#8064#beijing#mall@@joyday","ip":"10.6.33.23","port":8064,"weight":1.0,"healthy":true,"enabled":true,"ephemeral":true,"clusterName":"beijing","serviceName":"mall@@joyday","metadata":{"preserved.register.source":"SPRING_CLOUD"},"lastBeat":1722674437147,"marked":false,"app":"unknown","instanceHeartBeatInterval":5000,"instanceHeartBeatTimeOut":15000,"ipDeleteTimeout":30000}, will create new cluster with default configuration.2024-08-03 16:40:37,259 INFO [http-nio-8848-exec-7] [com.alibaba.nacos.naming.core.ServiceManager:updateIpAddresses:839]  updateIpAddresses after  currentIPs:[],instanceMap:{10.6.33.23:8064:unknown:beijing=10.6.33.23:8064:unknown:beijing_1.0_true_false_beijing}2024-08-03 16:40:37,259 INFO [http-nio-8848-exec-7] [com.alibaba.nacos.naming.core.ServiceManager:addInstance:661]  addInstance after addIpAddresses new instanceList:[10.6.33.23:8064:unknown:beijing_1.0_true_false_beijing]2024-08-03 16:40:37,259 INFO [http-nio-8848-exec-7] [com.alibaba.nacos.naming.consistency.ephemeral.distro.DistroConsistencyServiceImpl:put:108]  distro put key:com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday,value:{"instanceList":[{"instanceId":"10.6.33.23#8064#beijing#mall@@joyday","ip":"10.6.33.23","port":8064,"weight":1.0,"healthy":true,"enabled":true,"ephemeral":true,"clusterName":"beijing","serviceName":"mall@@joyday","metadata":{"preserved.register.source":"SPRING_CLOUD"},"lastBeat":1722674437147,"marked":false,"app":"unknown","instanceHeartBeatInterval":5000,"instanceHeartBeatTimeOut":15000,"ipDeleteTimeout":30000}]}2024-08-03 16:40:37,260 INFO [http-nio-8848-exec-7] [com.alibaba.nacos.naming.consistency.ephemeral.distro.DistroConsistencyServiceImpl:onPut:132] createServiceIfAbsent start dataStore {}2024-08-03 16:40:37,260 INFO [http-nio-8848-exec-7] [com.alibaba.nacos.naming.consistency.ephemeral.distro.DistroConsistencyServiceImpl:onPut:141] createServiceIfAbsent end dataStore {com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday=com.alibaba.nacos.naming.consistency.Datum@72f532aa}2024-08-03 16:40:37,263 INFO [com.alibaba.nacos.naming.distro.notifier.0] [com.alibaba.nacos.naming.core.Service:onChange:178] [NACOS-RAFT] datum service is changed, key: com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday, value: {"instanceList":[{"instanceId":"10.6.33.23#8064#beijing#mall@@joyday","ip":"10.6.33.23","port":8064,"weight":1.0,"healthy":true,"enabled":true,"ephemeral":true,"clusterName":"beijing","serviceName":"mall@@joyday","metadata":{"preserved.register.source":"SPRING_CLOUD"},"lastBeat":1722674437147,"marked":false,"app":"unknown","instanceHeartBeatInterval":5000,"instanceHeartBeatTimeOut":15000,"ipDeleteTimeout":30000}]}2024-08-03 16:40:37,263 INFO [com.alibaba.nacos.naming.distro.notifier.0] [com.alibaba.nacos.naming.core.Service:updateIPs:237] updateIPs before, instances: [10.6.33.23:8064:unknown:beijing_1.0_true_false_beijing], ephemeral: true2024-08-03 16:40:37,264 INFO [com.alibaba.nacos.naming.distro.notifier.0] [com.alibaba.nacos.naming.core.Cluster:updateIps:277] mall@@joyday {SYNC} {IP-NEW} cluster: beijing, new ips size: 1, content: [10.6.33.23:8064:unknown:beijing_1.0_true_false_beijing]2024-08-03 16:40:37,266 INFO [com.alibaba.nacos.naming.distro.notifier.0] [com.alibaba.nacos.naming.core.Service:updateIPs:290] [IP-UPDATED] namespace: public, service: mall@@joyday, ips: 10.6.33.23:8064_true,2024-08-03 16:40:37,269 DEBUG [com.alibaba.nacos.naming.distro.notifier.0] [com.alibaba.nacos.naming.core.Service:recalculateChecksum:549] service to json: {"invalidIPCount":0,"name":"mall@@joyday","ipCount":1,"owners":[],"protectThreshold":0.0,"clusters":[{"healthChecker":{},"defIPPort":80,"defCkport":80,"name":"beijing","useIPPort4Check":true,"sitegroup":""}]}2024-08-03 16:40:37,269 DEBUG [com.alibaba.nacos.naming.distro.notifier.0] [com.alibaba.nacos.naming.consistency.ephemeral.distro.DistroConsistencyServiceImpl$Notifier:handle:447] [NACOS-DISTRO] datum change notified, key: com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday, listener count: 1, action: CHANGE2024-08-03 16:40:38,267 INFO [com.alibaba.nacos.naming.push.udpSender.0] [com.alibaba.nacos.naming.push.PushService:lambda$onApplicationEvent$1:127] mall@@joyday is changed, add it to push queue.2024-08-03 16:40:38,272 INFO [com.alibaba.nacos.naming.push.udpSender.0] [com.alibaba.nacos.naming.push.PushService:lambda$onApplicationEvent$1:166] serviceName: mall@@joyday changed, schedule push for: 10.6.33.23:62522, agent: Nacos-Java-Client:v1.4.2, key: 10.6.33.23,62522,3735031098179002024-08-03 16:40:38,272 INFO [com.alibaba.nacos.naming.push.udpSender.0] [com.alibaba.nacos.naming.push.PushService:udpPush:614] send udp packet: 10.6.33.23,62522,3735031098179002024-08-03 16:40:38,278 INFO [com.alibaba.nacos.naming.push.receiver] [com.alibaba.nacos.naming.push.PushService$Receiver:run:687] received ack: {"type": "push-ack", "lastRefTime":"373503109817900", "data":""} from: 10.6.33.23:62522, cost: 6 ms, unacked: 0, total push: 1

dataStore-dataTum

key:com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday

{com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday

com.alibaba.nacos.naming.consistency.Datum@72f532aa}

{"instanceList":[{"instanceId":"10.6.33.23#8064#beijing#mall@@joyday","ip":"10.6.33.23","port":8064,"weight":1,"healthy":true,"enabled":true,"ephemeral":true,"clusterName":"beijing","serviceName":"mall@@joyday","metadata":{"preserved.register.source":"SPRING_CLOUD"},"lastBeat":1722674437147,"marked":false,"app":"unknown","instanceHeartBeatInterval":5000,"instanceHeartBeatTimeOut":15000,"ipDeleteTimeout":30000}]
}

servicemap结构

{public={mall@@joyday=Service{name=‘mall@@joyday’, protectThreshold=0.0, appName=‘null’, groupName=‘mall’, metadata={}}}}

16.第二次8066服务启动日志

2024-08-03 16:53:45,870 INFO [http-nio-8848-exec-6] [com.alibaba.nacos.naming.core.ServiceManager:createServiceIfAbsent:492] createServiceIfAbsent end getClusterMap {beijing=com.alibaba.nacos.naming.core.Cluster@f27590dd}2024-08-03 16:53:45,870 INFO [http-nio-8848-exec-6] [com.alibaba.nacos.naming.core.ServiceManager:addInstance:653]  addInstance key:com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday2024-08-03 16:53:45,870 INFO [http-nio-8848-exec-6] [com.alibaba.nacos.naming.core.ServiceManager:addInstance:656]  addInstance ,serviceMap:{public={mall@@joyday=Service{name='mall@@joyday', protectThreshold=0.0, appName='null', groupName='mall', metadata={}}}}2024-08-03 16:53:45,871 INFO [http-nio-8848-exec-6] [com.alibaba.nacos.naming.core.ServiceManager:updateIpAddresses:809]  updateIpAddresses before  currentIPs:[10.6.33.23:8064:unknown:beijing_1.0_true_false_beijing],instanceMap:{10.6.33.23:8064:unknown:beijing=10.6.33.23:8064:unknown:beijing_1.0_true_false_beijing}2024-08-03 16:53:45,871 INFO [http-nio-8848-exec-6] [com.alibaba.nacos.naming.core.ServiceManager:updateIpAddresses:842]  updateIpAddresses after  currentIPs:[10.6.33.23:8064:unknown:beijing_1.0_true_false_beijing],instanceMap:{10.6.33.23:8064:unknown:beijing=10.6.33.23:8064:unknown:beijing_1.0_true_false_beijing, 10.6.33.23:8066:unknown:beijing=10.6.33.23:8066:unknown:beijing_1.0_true_false_beijing}2024-08-03 16:53:45,872 INFO [http-nio-8848-exec-6] [com.alibaba.nacos.naming.core.ServiceManager:addInstance:664]  addInstance after addIpAddresses new instanceList:[10.6.33.23:8064:unknown:beijing_1.0_true_false_beijing, 10.6.33.23:8066:unknown:beijing_1.0_true_false_beijing]2024-08-03 16:53:45,872 INFO [http-nio-8848-exec-6] [com.alibaba.nacos.naming.consistency.ephemeral.distro.DistroConsistencyServiceImpl:put:108]  distro put key:com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday,value:{"instanceList":[{"instanceId":"10.6.33.23#8064#beijing#mall@@joyday","ip":"10.6.33.23","port":8064,"weight":1.0,"healthy":true,"enabled":true,"ephemeral":true,"clusterName":"beijing","serviceName":"mall@@joyday","metadata":{"dubbo.metadata-service.urls":"[ "dubbo://10.6.33.23:20880/com.alibaba.cloud.dubbo.service.DubboMetadataService?anyhost=true&application=joyday&bind.ip=10.6.33.23&bind.port=20880&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&group=joyday&interface=com.alibaba.cloud.dubbo.service.DubboMetadataService&methods=getAllServiceKeys,getServiceRestMetadata,getExportedURLs,getAllExportedURLs&pid=38352&qos.enable=false&release=2.7.8&revision=2.2.6.RELEASE&side=provider&timestamp=1722675134397&version=1.0.0" ]","dubbo.metadata.revision":"0","preserved.register.source":"SPRING_CLOUD"},"lastBeat":1722675221548,"marked":false,"app":"unknown","instanceHeartBeatInterval":5000,"instanceHeartBeatTimeOut":15000,"ipDeleteTimeout":30000},{"instanceId":"10.6.33.23#8066#beijing#mall@@joyday","ip":"10.6.33.23","port":8066,"weight":1.0,"healthy":true,"enabled":true,"ephemeral":true,"clusterName":"beijing","serviceName":"mall@@joyday","metadata":{"preserved.register.source":"SPRING_CLOUD"},"lastBeat":1722675225870,"marked":false,"app":"unknown","instanceHeartBeatInterval":5000,"instanceHeartBeatTimeOut":15000,"ipDeleteTimeout":30000}]}2024-08-03 16:53:45,872 INFO [http-nio-8848-exec-6] [com.alibaba.nacos.naming.consistency.ephemeral.distro.DistroConsistencyServiceImpl:onPut:132] createServiceIfAbsent start dataStore {com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday=com.alibaba.nacos.naming.consistency.Datum@41cab4c3}2024-08-03 16:53:45,872 INFO [http-nio-8848-exec-6] [com.alibaba.nacos.naming.consistency.ephemeral.distro.DistroConsistencyServiceImpl:onPut:141] createServiceIfAbsent end dataStore {com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday=com.alibaba.nacos.naming.consistency.Datum@36aea586}2024-08-03 16:53:45,872 INFO [com.alibaba.nacos.naming.distro.notifier.0] [com.alibaba.nacos.naming.core.Service:onChange:178] [NACOS-RAFT] datum service is changed, key: com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday, value: {"instanceList":[{"instanceId":"10.6.33.23#8064#beijing#mall@@joyday","ip":"10.6.33.23","port":8064,"weight":1.0,"healthy":true,"enabled":true,"ephemeral":true,"clusterName":"beijing","serviceName":"mall@@joyday","metadata":{"dubbo.metadata-service.urls":"[ "dubbo://10.6.33.23:20880/com.alibaba.cloud.dubbo.service.DubboMetadataService?anyhost=true&application=joyday&bind.ip=10.6.33.23&bind.port=20880&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&group=joyday&interface=com.alibaba.cloud.dubbo.service.DubboMetadataService&methods=getAllServiceKeys,getServiceRestMetadata,getExportedURLs,getAllExportedURLs&pid=38352&qos.enable=false&release=2.7.8&revision=2.2.6.RELEASE&side=provider&timestamp=1722675134397&version=1.0.0" ]","dubbo.metadata.revision":"0","preserved.register.source":"SPRING_CLOUD"},"lastBeat":1722675221548,"marked":false,"app":"unknown","instanceHeartBeatInterval":5000,"instanceHeartBeatTimeOut":15000,"ipDeleteTimeout":30000},{"instanceId":"10.6.33.23#8066#beijing#mall@@joyday","ip":"10.6.33.23","port":8066,"weight":1.0,"healthy":true,"enabled":true,"ephemeral":true,"clusterName":"beijing","serviceName":"mall@@joyday","metadata":{"preserved.register.source":"SPRING_CLOUD"},"lastBeat":1722675225870,"marked":false,"app":"unknown","instanceHeartBeatInterval":5000,"instanceHeartBeatTimeOut":15000,"ipDeleteTimeout":30000}]}2024-08-03 16:53:45,873 INFO [com.alibaba.nacos.naming.distro.notifier.0] [com.alibaba.nacos.naming.core.Service:updateIPs:237] updateIPs before, instances: [10.6.33.23:8064:unknown:beijing_1.0_true_false_beijing, 10.6.33.23:8066:unknown:beijing_1.0_true_false_beijing], ephemeral: true2024-08-03 16:53:45,873 INFO [com.alibaba.nacos.naming.distro.notifier.0] [com.alibaba.nacos.naming.core.Cluster:updateIps:277] mall@@joyday {SYNC} {IP-NEW} cluster: beijing, new ips size: 1, content: [10.6.33.23:8066:unknown:beijing_1.0_true_false_beijing]2024-08-03 16:53:45,873 INFO [com.alibaba.nacos.naming.distro.notifier.0] [com.alibaba.nacos.naming.core.Service:updateIPs:290] [IP-UPDATED] namespace: public, service: mall@@joyday, ips: 10.6.33.23:8064_true,10.6.33.23:8066_true,2024-08-03 16:53:45,873 DEBUG [com.alibaba.nacos.naming.distro.notifier.0] [com.alibaba.nacos.naming.core.Service:recalculateChecksum:549] service to json: {"invalidIPCount":0,"name":"mall@@joyday","ipCount":2,"owners":[],"protectThreshold":0.0,"clusters":[{"healthChecker":{},"defIPPort":80,"defCkport":80,"name":"beijing","useIPPort4Check":true,"sitegroup":""}]}2024-08-03 16:53:45,873 DEBUG [com.alibaba.nacos.naming.distro.notifier.0] [com.alibaba.nacos.naming.consistency.ephemeral.distro.DistroConsistencyServiceImpl$Notifier:handle:447] [NACOS-DISTRO] datum change notified, key: com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday, listener count: 1, action: CHANGE2024-08-03 16:53:46,566 DEBUG [http-nio-8848-exec-8] [com.alibaba.nacos.naming.controllers.InstanceController:beat:494] [CLIENT-BEAT] full arguments: beat: null, serviceName: mall@@joyday2024-08-03 16:53:46,878 INFO [com.alibaba.nacos.naming.push.udpSender.0] [com.alibaba.nacos.naming.push.PushService:lambda$onApplicationEvent$1:127] mall@@joyday is changed, add it to push queue.2024-08-03 16:53:46,879 INFO [com.alibaba.nacos.naming.push.udpSender.0] [com.alibaba.nacos.naming.push.PushService:lambda$onApplicationEvent$1:166] serviceName: mall@@joyday changed, schedule push for: 10.6.33.23:53206, agent: Nacos-Java-Client:v1.4.2, key: 10.6.33.23,53206,3742917143065002024-08-03 16:53:46,879 INFO [com.alibaba.nacos.naming.push.udpSender.0] [com.alibaba.nacos.naming.push.PushService:udpPush:614] send udp packet: 10.6.33.23,53206,3742917143065002024-08-03 16:53:46,880 INFO [com.alibaba.nacos.naming.push.udpSender.0] [com.alibaba.nacos.naming.push.PushService:lambda$onApplicationEvent$1:166] serviceName: mall@@joyday changed, schedule push for: 10.6.33.23:62806, agent: Nacos-Java-Client:v1.4.2, key: 10.6.33.23,62806,3742917143065002024-08-03 16:53:46,881 INFO [com.alibaba.nacos.naming.push.udpSender.0] [com.alibaba.nacos.naming.push.PushService:udpPush:614] send udp packet: 10.6.33.23,62806,3742917143065002024-08-03 16:53:46,885 INFO [com.alibaba.nacos.naming.push.receiver] [com.alibaba.nacos.naming.push.PushService$Receiver:run:687] received ack: {"type": "push-ack", "lastRefTime":"374291714306500", "data":""} from: 10.6.33.23:62806, cost: 4 ms, unacked: 1, total push: 42024-08-03 16:53:46,885 INFO [com.alibaba.nacos.naming.push.receiver] [com.alibaba.nacos.naming.push.PushService$Receiver:run:687] received ack: {"type": "push-ack", "lastRefTime":"374291714306500", "data":""} from: 10.6.33.23:53206, cost: 6 ms, unacked: 0, total push: 42024-08-03 16:53:47,494 INFO [http-nio-8848-exec-9] [com.alibaba.nacos.naming.core.ServiceManager:createServiceIfAbsent:492] createServiceIfAbsent end getClusterMap {beijing=com.alibaba.nacos.naming.core.Cluster@f27590dd}2024-08-03 16:53:47,494 INFO [http-nio-8848-exec-9] [com.alibaba.nacos.naming.core.ServiceManager:addInstance:653]  addInstance key:com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday2024-08-03 16:53:47,495 INFO [http-nio-8848-exec-9] [com.alibaba.nacos.naming.core.ServiceManager:addInstance:656]  addInstance ,serviceMap:{public={mall@@joyday=Service{name='mall@@joyday', protectThreshold=0.0, appName='null', groupName='mall', metadata={}}}}2024-08-03 16:53:47,495 INFO [http-nio-8848-exec-9] [com.alibaba.nacos.naming.core.ServiceManager:updateIpAddresses:809]  updateIpAddresses before  currentIPs:[10.6.33.23:8064:unknown:beijing_1.0_true_false_beijing, 10.6.33.23:8066:unknown:beijing_1.0_true_false_beijing],instanceMap:{10.6.33.23:8064:unknown:beijing=10.6.33.23:8064:unknown:beijing_1.0_true_false_beijing, 10.6.33.23:8066:unknown:beijing=10.6.33.23:8066:unknown:beijing_1.0_true_false_beijing}2024-08-03 16:53:47,496 INFO [http-nio-8848-exec-9] [com.alibaba.nacos.naming.core.ServiceManager:updateIpAddresses:842]  updateIpAddresses after  currentIPs:[10.6.33.23:8064:unknown:beijing_1.0_true_false_beijing, 10.6.33.23:8066:unknown:beijing_1.0_true_false_beijing],instanceMap:{10.6.33.23:8064:unknown:beijing=10.6.33.23:8064:unknown:beijing_1.0_true_false_beijing, 10.6.33.23:8066:unknown:beijing=10.6.33.23:8066:unknown:beijing_1.0_true_false_beijing}2024-08-03 16:53:47,496 INFO [http-nio-8848-exec-9] [com.alibaba.nacos.naming.core.ServiceManager:addInstance:664]  addInstance after addIpAddresses new instanceList:[10.6.33.23:8064:unknown:beijing_1.0_true_false_beijing, 10.6.33.23:8066:unknown:beijing_1.0_true_false_beijing]2024-08-03 16:53:47,496 INFO [http-nio-8848-exec-9] [com.alibaba.nacos.naming.consistency.ephemeral.distro.DistroConsistencyServiceImpl:put:108]  distro put key:com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday,value:{"instanceList":[{"instanceId":"10.6.33.23#8064#beijing#mall@@joyday","ip":"10.6.33.23","port":8064,"weight":1.0,"healthy":true,"enabled":true,"ephemeral":true,"clusterName":"beijing","serviceName":"mall@@joyday","metadata":{"dubbo.metadata-service.urls":"[ "dubbo://10.6.33.23:20880/com.alibaba.cloud.dubbo.service.DubboMetadataService?anyhost=true&application=joyday&bind.ip=10.6.33.23&bind.port=20880&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&group=joyday&interface=com.alibaba.cloud.dubbo.service.DubboMetadataService&methods=getAllServiceKeys,getServiceRestMetadata,getExportedURLs,getAllExportedURLs&pid=38352&qos.enable=false&release=2.7.8&revision=2.2.6.RELEASE&side=provider&timestamp=1722675134397&version=1.0.0" ]","dubbo.metadata.revision":"0","preserved.register.source":"SPRING_CLOUD"},"lastBeat":1722675226566,"marked":false,"app":"unknown","instanceHeartBeatInterval":5000,"instanceHeartBeatTimeOut":15000,"ipDeleteTimeout":30000},{"instanceId":"10.6.33.23#8066#beijing#mall@@joyday","ip":"10.6.33.23","port":8066,"weight":1.0,"healthy":true,"enabled":true,"ephemeral":true,"clusterName":"beijing","serviceName":"mall@@joyday","metadata":{"dubbo.metadata-service.urls":"[ "dubbo://10.6.33.23:20881/com.alibaba.cloud.dubbo.service.DubboMetadataService?anyhost=true&application=joyday&bind.ip=10.6.33.23&bind.port=20881&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&group=joyday&interface=com.alibaba.cloud.dubbo.service.DubboMetadataService&methods=getAllServiceKeys,getServiceRestMetadata,getExportedURLs,getAllExportedURLs&pid=44484&qos.enable=false&release=2.7.8&revision=2.2.6.RELEASE&side=provider&timestamp=1722675226758&version=1.0.0" ]","dubbo.metadata.revision":"0","preserved.register.source":"SPRING_CLOUD"},"lastBeat":1722675227493,"marked":false,"app":"unknown","instanceHeartBeatInterval":5000,"instanceHeartBeatTimeOut":15000,"ipDeleteTimeout":30000}]}2024-08-03 16:53:47,496 INFO [http-nio-8848-exec-9] [com.alibaba.nacos.naming.consistency.ephemeral.distro.DistroConsistencyServiceImpl:onPut:132] createServiceIfAbsent start dataStore {com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday=com.alibaba.nacos.naming.consistency.Datum@36aea586}2024-08-03 16:53:47,497 INFO [http-nio-8848-exec-9] [com.alibaba.nacos.naming.consistency.ephemeral.distro.DistroConsistencyServiceImpl:onPut:141] createServiceIfAbsent end dataStore {com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday=com.alibaba.nacos.naming.consistency.Datum@6ee0d505}2024-08-03 16:53:47,497 INFO [com.alibaba.nacos.naming.distro.notifier.0] [com.alibaba.nacos.naming.core.Service:onChange:178] [NACOS-RAFT] datum service is changed, key: com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday, value: {"instanceList":[{"instanceId":"10.6.33.23#8064#beijing#mall@@joyday","ip":"10.6.33.23","port":8064,"weight":1.0,"healthy":true,"enabled":true,"ephemeral":true,"clusterName":"beijing","serviceName":"mall@@joyday","metadata":{"dubbo.metadata-service.urls":"[ "dubbo://10.6.33.23:20880/com.alibaba.cloud.dubbo.service.DubboMetadataService?anyhost=true&application=joyday&bind.ip=10.6.33.23&bind.port=20880&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&group=joyday&interface=com.alibaba.cloud.dubbo.service.DubboMetadataService&methods=getAllServiceKeys,getServiceRestMetadata,getExportedURLs,getAllExportedURLs&pid=38352&qos.enable=false&release=2.7.8&revision=2.2.6.RELEASE&side=provider&timestamp=1722675134397&version=1.0.0" ]","dubbo.metadata.revision":"0","preserved.register.source":"SPRING_CLOUD"},"lastBeat":1722675226566,"marked":false,"app":"unknown","instanceHeartBeatInterval":5000,"instanceHeartBeatTimeOut":15000,"ipDeleteTimeout":30000},{"instanceId":"10.6.33.23#8066#beijing#mall@@joyday","ip":"10.6.33.23","port":8066,"weight":1.0,"healthy":true,"enabled":true,"ephemeral":true,"clusterName":"beijing","serviceName":"mall@@joyday","metadata":{"dubbo.metadata-service.urls":"[ "dubbo://10.6.33.23:20881/com.alibaba.cloud.dubbo.service.DubboMetadataService?anyhost=true&application=joyday&bind.ip=10.6.33.23&bind.port=20881&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&group=joyday&interface=com.alibaba.cloud.dubbo.service.DubboMetadataService&methods=getAllServiceKeys,getServiceRestMetadata,getExportedURLs,getAllExportedURLs&pid=44484&qos.enable=false&release=2.7.8&revision=2.2.6.RELEASE&side=provider&timestamp=1722675226758&version=1.0.0" ]","dubbo.metadata.revision":"0","preserved.register.source":"SPRING_CLOUD"},"lastBeat":1722675227493,"marked":false,"app":"unknown","instanceHeartBeatInterval":5000,"instanceHeartBeatTimeOut":15000,"ipDeleteTimeout":30000}]}2024-08-03 16:53:47,497 INFO [com.alibaba.nacos.naming.distro.notifier.0] [com.alibaba.nacos.naming.core.Service:updateIPs:237] updateIPs before, instances: [10.6.33.23:8064:unknown:beijing_1.0_true_false_beijing, 10.6.33.23:8066:unknown:beijing_1.0_true_false_beijing], ephemeral: true2024-08-03 16:53:47,497 INFO [com.alibaba.nacos.naming.distro.notifier.0] [com.alibaba.nacos.naming.core.Service:updateIPs:290] [IP-UPDATED] namespace: public, service: mall@@joyday, ips: 10.6.33.23:8064_true,10.6.33.23:8066_true,2024-08-03 16:53:47,498 DEBUG [com.alibaba.nacos.naming.distro.notifier.0] [com.alibaba.nacos.naming.core.Service:recalculateChecksum:549] service to json: {"invalidIPCount":0,"name":"mall@@joyday","ipCount":2,"owners":[],"protectThreshold":0.0,"clusters":[{"healthChecker":{},"defIPPort":80,"defCkport":80,"name":"beijing","useIPPort4Check":true,"sitegroup":""}]}2024-08-03 16:53:47,498 DEBUG [com.alibaba.nacos.naming.distro.notifier.0] [com.alibaba.nacos.naming.consistency.ephemeral.distro.DistroConsistencyServiceImpl$Notifier:handle:447] [NACOS-DISTRO] datum change notified, key: com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday, listener count: 1, action: CHANGE2024-08-03 16:53:47,674 DEBUG [com.alibaba.nacos.naming.service.worker.0] [com.alibaba.nacos.naming.core.Service:recalculateChecksum:549] service to json: {"invalidIPCount":0,"name":"mall@@joyday","ipCount":2,"owners":[],"protectThreshold":0.0,"clusters":[{"healthChecker":{},"defIPPort":80,"defCkport":80,"name":"beijing","useIPPort4Check":true,"sitegroup":""}]}2024-08-03 16:53:48,501 INFO [com.alibaba.nacos.naming.push.udpSender.0] [com.alibaba.nacos.naming.push.PushService:lambda$onApplicationEvent$1:127] mall@@joyday is changed, add it to push queue.2024-08-03 16:53:48,501 INFO [com.alibaba.nacos.naming.push.udpSender.0] [com.alibaba.nacos.naming.push.PushService:lambda$onApplicationEvent$1:166] serviceName: mall@@joyday changed, schedule push for: 10.6.33.23:53206, agent: Nacos-Java-Client:v1.4.2, key: 10.6.33.23,53206,3742933364654002024-08-03 16:53:48,501 INFO [com.alibaba.nacos.naming.push.udpSender.0] [com.alibaba.nacos.naming.push.PushService:udpPush:614] send udp packet: 10.6.33.23,53206,3742933364654002024-08-03 16:53:48,502 INFO [com.alibaba.nacos.naming.push.udpSender.0] [com.alibaba.nacos.naming.push.PushService:lambda$onApplicationEvent$1:166] serviceName: mall@@joyday changed, schedule push for: 10.6.33.23:62806, agent: Nacos-Java-Client:v1.4.2, key: 10.6.33.23,62806,3742933364654002024-08-03 16:53:48,502 INFO [com.alibaba.nacos.naming.push.udpSender.0] [com.alibaba.nacos.naming.push.PushService:udpPush:614] send udp packet: 10.6.33.23,62806,3742933364654002024-08-03 16:53:48,504 INFO [com.alibaba.nacos.naming.push.receiver] [com.alibaba.nacos.naming.push.PushService$Receiver:run:687] received ack: {"type": "push-ack", "lastRefTime":"374293336465400", "data":""} from: 10.6.33.23:53206, cost: 3 ms, unacked: 1, total push: 62024-08-03 16:53:48,505 INFO [com.alibaba.nacos.naming.push.receiver] [com.alibaba.nacos.naming.push.PushService$Receiver:run:687] received ack: {"type": "push-ack", "lastRefTime":"374293336465400", "data":""} from: 10.6.33.23:62806, cost: 3 ms, unacked: 0, total push: 62024-08-03 16:53:51,570 DEBUG [http-nio-8848-exec-4] [com.alibaba.nacos.naming.controllers.InstanceController:beat:494] [CLIENT-BEAT] full arguments: beat: null, serviceName: mall@@joyday2024-08-03 16:53:52,685 DEBUG [com.alibaba.nacos.naming.service.worker.0] [com.alibaba.nacos.naming.core.Service:recalculateChecksum:549] service to json: {"invalidIPCount":0,"name":"mall@@joyday","ipCount":2,"owners":[],"protectThreshold":0.0,"clusters":[{"healthChecker":{},"defIPPort":80,"defCkport":80,"name":"beijing","useIPPort4Check":true,"sitegroup":""}]}

updateIpAddresses after currentIPs:[10.6.33.23:8064:unknown:beijing_1.0_true_false_beijing],instanceMap:{10.6.33.23:8064:unknown:beijing=10.6.33.23:8064:unknown:beijing_1.0_true_false_beijing, 10.6.33.23:8066:unknown:beijing=10.6.33.23:8066:unknown:beijing_1.0_true_false_beijing}

可以看到经过updateIpAddresses 多了一个实例,

最终写入distro后,也会多了一个实例

distro put key:com.alibaba.nacos.naming.iplist.ephemeral.public##mall@@joyday,value:

{"instanceList":[{"instanceId":"10.6.33.23#8064#beijing#mall@@joyday","ip":"10.6.33.23","port":8064,"weight":1,"healthy":true,"enabled":true,"ephemeral":true,"clusterName":"beijing","serviceName":"mall@@joyday","metadata":{"dubbo.metadata-service.urls":"[ "dubbo://10.6.33.23:20880/com.alibaba.cloud.dubbo.service.DubboMetadataService?anyhost=true&application=joyday&bind.ip=10.6.33.23&bind.port=20880&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&group=joyday&interface=com.alibaba.cloud.dubbo.service.DubboMetadataService&methods=getAllServiceKeys,getServiceRestMetadata,getExportedURLs,getAllExportedURLs&pid=38352&qos.enable=false&release=2.7.8&revision=2.2.6.RELEASE&side=provider×tamp=1722675134397&version=1.0.0" ]","dubbo.metadata.revision":"0","preserved.register.source":"SPRING_CLOUD"},"lastBeat":1722675221548,"marked":false,"app":"unknown","instanceHeartBeatInterval":5000,"instanceHeartBeatTimeOut":15000,"ipDeleteTimeout":30000},{"instanceId":"10.6.33.23#8066#beijing#mall@@joyday","ip":"10.6.33.23","port":8066,"weight":1,"healthy":true,"enabled":true,"ephemeral":true,"clusterName":"beijing","serviceName":"mall@@joyday","metadata":{"preserved.register.source":"SPRING_CLOUD"},"lastBeat":1722675225870,"marked":false,"app":"unknown","instanceHeartBeatInterval":5000,"instanceHeartBeatTimeOut":15000,"ipDeleteTimeout":30000}]
}

三、注册表数据结构

1.数据结构思维导图

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/487653.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

qemu安装arm64架构银河麒麟

qemu虚拟化软件&#xff0c;可以在一个平台上模拟另一个硬件平台&#xff0c;可以支持多种处理器架构。 一、安装 安装教程&#xff1a;https://blog.csdn.net/qq_36035382/article/details/125308044 下载链接&#xff1a;https://qemu.weilnetz.de/w64/2024/ 我下载的是 …

小程序维护外包流程和费用

由于某些原因很多老板想要跟换掉小程序原来合作的开发公司&#xff0c;重新把小程序系统维护外包新的公司。小程序系统外包维护是一个涉及多个方面的过程&#xff0c;需要从需求明确、选择团队到持续优化等多个环节进行细致管理。以下就是小程序系统外包维护主要包括几个关键步…

C—指针初阶(2)

如果看完阁下满意的话&#xff0c;能否一键三连呢&#xff0c;我的动力就是大家的支持与肯定&#xff0c;冲&#xff01; 二级指针 我们先看概念以及作用&#xff1a;用来存放一级指针的地址的指针 先看例子&#xff0c;我们逐一分析 我们先分析上面那个“1” 标注那里&#x…

x64dbg 安装使用教程

x64dbg的安装与配置 x64dbg官网地址&#xff1a;https://x64dbg.com/#start x64dbg界面介绍 1.反汇编窗口 这个位置显示的是需要分析的程序的反汇编代码。在第一个区域的最左侧例如“7712EAA3”这一列就是内存地址区域&#xff0c;接着“E8 07”就是汇编指令的opcode&#xff…

视频推拉流EasyDSS无人机直播技术巡查焚烧、烟火情况

焚烧作为一种常见的废弃物处理方式&#xff0c;往往会对环境造成严重污染。因此&#xff0c;减少焚烧、推广绿色能源和循环经济成为重要措施。通过加强森林防灭火队伍能力建设与长效机制建立&#xff0c;各地努力减少因焚烧引发的森林火灾&#xff0c;保护生态环境。 巡察烟火…

禾赛激光雷达AT_128_P_A02激光时间同步配置

sudo apt update sudo apt-get install linuxptp ethtool sudo ethtool -T 网卡名字(ifconfig可以查看)网卡名即连接激光雷达之后配置的ip所对应的网卡名称 一般来说看到如下提示信息才正常&#xff1a; lzslzs-Precision-3591:~$ ethtool -T enp0s31f6 Time stamping paramet…

java项目部署相关记录

部署 简单部署(Windows) redis我使用小皮面板开的 mysql也是 maven打包 先打包,打包成功,找到对应jar包 在文件夹打开,然后再次目录上开cmd java -jar jplan-0.0.1-SNAPSHOT.jar需要注意的是,windows的java环境要和idea项目里边的java是一致的 运行成功! 属性配置方式…

v-for遍历多个el-popover;el-popover通过visible控制显隐;点击其他隐藏el-popover

场景:el-popover通过visible控制显隐;同时el-popover是遍历生成的多个。 原文档的使用visible后就不能点击其他地方使其隐藏;同时解决实现点击其他区域隐藏 <template><div><template v-for="(item,index) in arr" :key="index"><…

【Ubuntu】清理、压缩VirtualBox磁盘空间大小

1、说明 本人为虚拟机创建了两个硬盘:root.vdi 和 hoom.vdi,在创建虚拟机时,分别挂载在/root目录和/home目录下。 下面演示分别清理、压缩两个磁盘的空间。 2、清理空间 1)清理 root.vid sudo dd if=/dev/zero of=/EMPTY bs=1M;sudo rm -f /EMPTY输出信息中会提示,如…

微信小程序跳转其他小程序以及跳转网站

一、跳转其他小程序 1.1 知道appid和页面路径 wx.navigateToMiniProgram({appId: appid, // 替换为目标小程序 AppIDpath: pathWithParams, // 小程序路径envVersion: release, // 开发版、体验版或正式版success(res) {console.log("跳转到其他小程序成功&#xff01;&q…

在ensp中ACL路由控制实验

一、实验目的 掌握ACL路由控制管理 二、实验要求 要求&#xff1a; 配置路由策略&#xff0c;左右两边不公开区域对方不可达&#xff0c;其他区域可以互相ping通 设备&#xff1a; 1、三台路由器 2、四台交换机 3、四台电脑 4、四台服务器 使用ensp搭建实验环境,如图所…

NIFI使用

1 从Kafka接收消息&#xff0c;存储到数据库中。 &#xff08;1&#xff09; ConsumerKafka processor &#xff08;2&#xff09;Execute Scripts Processor 我这里是使用JS脚本进行处理。 还有很多其他语言的脚本。 var flowFile session.get(); if (flowFile ! null) {v…

【leetcode】替换后的最长重复字符、将字符串翻转到单调递增

1.替换后的最长重复字符 示例如下&#xff1a; 下面我们来分析一下一个例子&#xff0c;其中K 2 暴力枚举 这里的字符串s是仅由大写字母组成&#xff0c;首先我们尝试用暴力解法的思路来想一下这道题&#xff0c;通过从第一个字符开始进行枚举&#xff0c;如果出现了条件判断…

如何制作“优美”PPT

目录 1.免费PPT模板网站&#xff1a; 2.免费有较好质量的图片网站&#xff1a; 免费图片资源 免费透明PNG图片资源&#xff1a; 免费icon图片资源&#xff1a; 3.选择好的图片&#xff1a; 图片底色 4.要与不要 千万不要&#xff1a; 一定要&#xff1a; 6.一些建议…

类和对象一

目录 1.类的引入 2.类的定义 3.访问限定符 4.类的作用域 5.类对象模型 6.类的大小 1.类的引入 C语言结构体中只能定义变量&#xff0c;在C中&#xff0c;结构体不仅可以定义变量&#xff0c;也可以定义函数。 C兼容C语言&#xff0c;结构用法可以继续使用 同时sruct也升…

【计算机网络】实验13:运输层端口

实验13 运输层端口 一、实验目的 本次实验旨在验证TCP和IP运输层端口号的作用&#xff0c;深入理解它们在网络通信中的重要性。通过实验&#xff0c;我将探讨端口号如何帮助区分不同的应用程序和服务&#xff0c;使得在同一台主机上能够同时运行多个网络服务而不发生冲突。此…

关于睡懒觉

我们经常听到一个词&#xff1a;睡懒觉。 我认为&#xff0c;睡懒觉这个词&#xff0c;是错误的。 人&#xff0c;是需要睡眠的&#xff0c;睡不够&#xff0c;就不会醒。睡够了&#xff0c;自然会醒&#xff0c;也不想继续睡。不信你试试&#xff0c;睡够了&#xff0c;你…

【推荐算法】单目标精排模型——FiBiNET

key word: 学术论文 Motivation&#xff1a; 传统的Embedding&MLP算法是通过内积和Hadamard product实现特征交互的&#xff0c;这篇文章的作者提出了采用SENET实现动态学习特征的重要性&#xff1b;作者认为简单的内积和Hadamard product无法有效对稀疏特征进行特征交互&a…

C语言:define定义常量和定义宏(详解)

本篇博客给大家带来的是#define定义常量和#define定义宏的方法 &#x1f41f;&#x1f41f;文章专栏&#xff1a;C语言 &#x1f680;&#x1f680;若有问题评论区下讨论&#xff0c;我会及时回答 ❤❤欢迎大家点赞、收藏、分享 你们的支持就是我创造的动力 今日思想&#xff1…

Spring Boot如何实现防盗链

一、什么是盗链 盗链是个什么操作&#xff0c;看一下百度给出的解释&#xff1a;盗链是指服务提供商自己不提供服务的内容&#xff0c;通过技术手段绕过其它有利益的最终用户界面&#xff08;如广告&#xff09;&#xff0c;直接在自己的网站上向最终用户提供其它服务提供商的…