Remember, this kind of error occurs in the future because @ loadbalanced is not added to the getresttemplate () method in the configuration file of the consumer side to enable the load balancing function, so Nacos reports the error of “no host found”!
The front-end request error page is as follows:
Cause analysis:
1. First of all, Nacos has its own load balancing function. Why?Please see the figure below:
2. Because Nacos integrates ribbon, you can use resttemplate to remotely call the service for load balancing, and then successfully find the service under the Nacos registration service center. You just don’t know what algorithm to use to select the service provider, so an error is reported – no host exception is found.
Solution:
Add “@ loadbalanced” above the method to get resttemplate in the configuration file to enable the load balancing function.
Done!
Similar Posts:
- Nacos: How to Solve failed to req API:/nacos/v1/ns/instance after all servers([127.0.0.1:8848])
- [Solved] Using jdk11 to deploy Nacos under Linux, the startup error is: could not find or load main class
- [Solved] Seata Startup Error: ErrMsg:failed to req API:/nacos/v1/ns/instance after all servers….
- Error in uploading configuration file using Nacos
- Seata Starup Error: nettyServer init error:ErrCode:500, ErrMsg:failed to req API:/nacos/v1/ns/instance after all servers([127.0.0.1:30099]) tried: ErrCode:503, ErrMsg:server is DOWN now, please try again later!
- Springboot2 oauth2 Error: Possible CSRF detected – state parameter was required but no state could
- [Solved] Nacos Startup Error: nacos can not start web server;
- Nacos-client Call Error: failed to create cache dir [How to Solve]
- vshost.exe What is the purpose of the document?
- How to Solve Seata Nacos connection error: unknown user!