报错信息:
2021-08-10 22:42:00.371 ERROR 12560 --- [ restartedMain] c.a.c.n.registry.NacosServiceRegistry : nacos registry, cloudalibaba-sentinel-service register failed...NacosRegistration{nacosDiscoveryProperties=NacosDiscoveryProperties{serverAddr='localhost:8848', endpoint='', namespace='public', watchDelay=30000, logName='', service='cloudalibaba-sentinel-service', weight=1.0, clusterName='DEFAULT', group='DEFAULT_GROUP', namingLoadCacheAtStart='false', metadata={preserved.register.source=SPRING_CLOUD}, registerEnabled=true, ip='192.168.0.101', networkInterface='', port=8401, secure=false, accessKey='', secretKey='', heartBeatInterval=null, heartBeatTimeout=null, ipDeleteTimeout=null}},
java.lang.IllegalStateException: failed to req API:/nacos/v1/ns/instance after all servers([localhost:8848]) tried: failed to req API:localhost:8848/nacos/v1/ns/instance. code:503 msg: server is DOWN now, please try again later!
原因:nacos版本跟Spring Cloud Alibaba版本没对应上。
解决:我用的Spring Cloud Alibaba是2.1.1版本,则nacos版本要用1.1.4
另附GitHub上对应版本的说明: