When ZooKeeper as a registration center in Dubbo, and how does it work?

Service provider at the time of initial start-up, will be created in the next node in the node service providers in Dubbo node node under Zookeeper one child and write URL, path similar to / dubbo / servicename / providers /, in the path all child nodes are service providers.

At this time, these temporary child nodes are the nodes, because the life cycle of temporary node associated with the client session, so once the machine where the provider fails to provide the service provider can not lead to the temporary node will be automatically deleted from the Zookeeper.

At this time, because among service providers, the registry, the consumer is long connection, the registry can sense the service provider goes down, will inform consumers. The monitoring center is an important part of Dubbo service governance system, it needs to know all the changes in service providers and consumers. It will register a watcher to monitor changes in the child node, the path is / dubbo / servicename /, so it can also be perceived downtime service provider in the service node when it starts.

Service consumer and provider node creation process is the same, but also the temporary node. Another feature is the node structure design Zookeeper, which is to serve the names and types, that is, / dubbo / servicename / type as a node path, in line with the needs of Dubbo subscription and notification to ensure that the change notification service for the size, notify range easy control. So even if the service providers and consumers frequently change, performance Zookeeper will not cause much impact.

Guess you like

Origin www.cnblogs.com/we9999/p/12400348.html