In the usual development process, when it comes to call each other between the two centers, such as: service A and B, the service invoke service B, in order not to affect everyone’s velocity, the service B development, after the completion of service should be deployed on the development environment, service configuration direct call service B, rather than A service developers to pull the two projects to local boot for alignment.
How does Dubbo call online services locally
Dubbo is developed to call online services locally, with the following steps:
(1) The IP address registered in the registry by the service provider must be an external IP, otherwise local development cannot be called.
(2) Change the ZooKeeper address of the local application.properties configuration file
Dubo.registry. Address = zookeeper://${public IP address}:2181
Restart the service.
Here’s the big question
Did the service provider not register the correct IP to ZooKeeper?
Generally speaking, the service is deployed by Docker. According to dubbo’s strategy of obtaining IP, it is likely to obtain LAN IP. Therefore, there is no problem to call in the same LAN in the development environment, but the operation of calling remote service cannot be carried out locally.
Refer to dubbo’s official documentation:
Dubbo obtain service IP source:
The official solution:
Solution in Docker environment
Add DUBBO_IP_TO_REGISTRY={external IP address of the server where the service is located} to the docker environment configuration to solve the problem.
Make your local development silky smooth!!