当前位置:网站首页>There are two problems when Nacos calls microservices: 1 Load balancer does not contain an instance for the service 2. Connection refused

There are two problems when Nacos calls microservices: 1 Load balancer does not contain an instance for the service 2. Connection refused

2022-06-27 03:25:00 nightwind2017

Project scenario :

Spring Boot + Spring Cloud + Spring Cloud Alibaba + Nacos

1、 Problem description

local After the project starts , utilize nacos Visit the registry named test The service , stay test When the service has been registered in the registry ,loca Still can't access test, The log shows :

Load balancer does not contain an instance for the service “test”

Solution :

This is the time to check local The configuration file for the project , find nacos Configuration location of

 Insert picture description here

Put the ip Configure... For the machine where the project is started ip Address , Such as the machine ip For the local , It's configured as 127.0.0.1

2、 Problem description

After the above problems are corrected ,local visit test The following problems may occur :

Connection refused: connect executing POST http:

Solution :

test If it is deployed on a server , We have to check test Whether the port used by the project on this server is open , And external access
The test method is , open windows Systematic cmd Command line , Enter the following command :

telnet xxx.xx.xx.xx(test On the server where the project is located ip) 0000(test Port number used by the project )

If the command line does not recognize telnet command , How to query windows System on telnet service
How to be in windows System on telnet service
If the port is inaccessible , Then open the port on the server

原网站

版权声明
本文为[nightwind2017]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/178/202206270313234900.html