nacos
nacos copied to clipboard
单机模式运行模式初次启动服务成功之后,进行服务注册后,获取服务ip端口返回为空
Describe the bug A clear and concise description of what the bug is. 首次注册服务成功后,执行服务发现命令返回结果中hosts值为空列表。 后续注册对同一个服务名注册同一IP、端口,服务发现操作返回正常。
Expected behavior 执行服务发现命令返回的结果中hosts中的值不为空。
Actually behavior A clear and concise description of what you actually to happen. 执行服务发现命令返回的结果中hosts为空。
How to Reproduce Steps to reproduce the behavior: 预置条件: 1、单机模式 2、首次启动服务
操作步骤:
1、执行命令:curl -X POST "http://127.0.0.1:8848/nacos/v1/ns/instance?serviceName=nacos.naming.serviceName&ip=20.18.7.10&port=8080"
返回:
"ok"
2、执行命令:curl -X GET "http://127.0.0.1:8848/nacos/v1/ns/instance/list?serviceName=nacos.naming.serviceName"
返回:{"name":"DEFAULT_GROUP@@nacos.naming.serviceName","groupName":"DEFAULT_GROUP","clusters":"","cacheMillis":10000,"hosts":[],"lastRefTime":1659682439119,"checksum":"","allIPs":false,"reachProtectionThreshold":false,"valid":true}
Desktop (please complete the following information):
- OS: windows10
- Version nacos-server 2.1
- Module 服务注册和发现
- SDK java1.8
Additional context Add any other context about the problem here.
注册的服务健康状态异常,实例被摘除了,再查询肯定是查询不到了
No more response from author, I think this is a usage problem.
健康状态异常是指?首次注册失败了,但是后面又执行curl -X POST "http://127.0.0.1:8848/nacos/v1/ns/instance?serviceName=nacos.naming.serviceName&ip=20.18.7.10&port=8080"
这个命令,然后查询是返回结果hosts列表是正常的