[Solved] failed to req API:/nacos/v1/ns/instance after all servers

Scenario: CentOS virtual machine SpringCloud-Nacos Dubbo integration error reporting
failed to req API:/nacos/v1/ns/instance after all servers([192.168.56.101:8848, 192.168.56.102:8848, 192.168.56.103:8848]) tried: failed to req API:192.168.56.102:8848/nacos/v1/ns/instance. code:400 msg: <html><body><h1>Whitelabel Error Page</h1><p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p><div id=’created’>Fri May 21 01:29:11 CST 2021</div><div>There was an unexpected error (type=Bad Request, status=400).</div><div>receive invalid redirect request from peer 192.168.56.101</div></body></html>
Cause.
When the nacos service is started, the virtual machine’s enp0s3 NIC is used with an ip of 10.0.2.x
And 192.168.56.x is the address of the enp0s8 NIC
So the solution here is to open the configuration item in /nacos/conf/application.properties and specify the ip on it

Read More: