Technology Exchange Group: 534368042
Cause: After the service of the project, opened a new private cloud room A, in the original physical Room B system does not migrate, need a system call B of the various Dubbo services, and A to B can not directly access the need to do network mapping through the switch, the existing B internal network segment is 192.168.1.X A network segment 59.10.59.X after mapping a Access B network segment is 10.59.10.X, resulting in a consumer can not directly register to B's Zookeeper cluster registry, Access B services.
Program: Through the Dubbo of the dual Registration center mode, a room access B room service by modifying a room machine of the hosts
For example, B room Service intranet address 192.168.1.120 machine name App1 This in a computer room machine consumer hosts configuration App1 192.168.1.120 Service registration is dubbo://app1:20880/xxx/xxx,b room consumers remain unchanged, The network architecture is as follows:
1.dubbo in a room Zookeeper registration center through APP1 mode, in the B room 192.168.1.X configuration as follows:
123456 |
<!--Multi-registry configuration- <dubbo:registry id= "Hangzhouregistry" address= "192.168.1.110:20880"/> <dubbo:registry id= "Qingdaoregistry" address= "app1:20880" default= "false"/> <!-- Register with multiple registries- <dubbo:service interface= "Com.alibaba.hello.api.HelloService" version= "1.0.0" ref= " HelloService "registry=" Hangzhouregistry,qingdaoregistry "/> |
2. Modify the Abstractserver class constructor of the Dubbo package
Dubbo in multi-engine room multi-registration center scheme