Registry notes relocation

 
zookeeper
The pursuit of strong uniform
Distributed coordination, A system notifies the B-system processing result;
Load balancing;
Distributed Lock;
Metadata / management configuration information;
HA high availability.
Provide consistent service for distributed applications, including: configuration maintenance, domain name service, distributed synchronization, group services.
zookeeper machine can detect the heartbeat mechanism hang and hang the machine ip and services corresponding relationship removed from the list.
 
Features: High performance scalable, read and write speed, the client update order consistent with the order they are sent, atomic, high availability & recoverability.
Zookeeper test environment can be a single server, but can not guarantee high availability & recoverability.
High availability: You can copy, ZooKeeper it does is ensure that a copy of every tree of changes will Znode on aggregate to more than half of the machines. More than half - the number of servers and generally all odd.
 
zookeeper exist leader, follower, observer three roles, three roles in the actual service is a service node in the cluster.
leader: processing all requests for customer service to provide read and write
follower: read-only service, we have the opportunity to become a leader by election
observer: read-only service
 
Paxos algorithm is through voting, the global numbering scheme.
 
principle
The core is an atomic broadcast mechanism that ensures synchronization between each server. Protocol Implementation of this mechanism is called Zab agreement. Zab protocol has two modes, they are in recovery mode and broadcast mode.
(1) Recovery Mode
When the service starts or after leader crashes, Zab entered recovery mode, when the leader is elected, and most of the server after the completion of the synchronization and leader of the state, recovery mode is over. State synchronization server and ensure that the leader of the system have the same status.
(2) broadcast mode (somewhat similar to the two-phase commit transactions)
Once most of the Leader and Follower already been synchronized state, he can begin to broadcast the news that broadcast into the state. This is a time when added ZooKeeper Server service, which will start in recovery mode, discover Leader, and Leader and synchronizes state. Until the end of synchronization, it is also involved in news broadcasts. ZooKeeper service has been maintained at Broadcast state until the collapse of the Leader or Leader lost most of Followers support.
 
 
 
Distributed Lock
(1) Create a directory mylock;
(2) A thread acquires the lock just want to create a temporary order of nodes in the mylock directory;
(3) Get all child nodes mylock directory, and then get smaller than their siblings, and if not, then the current thread is the smallest sequence number, get a lock;
(4) Thread B acquires all nodes, they are not the lowest node is determined, listens disposed times smaller than the own node;
(5) A thread is processed, delete its own node, thread B listen to the change events, determine whether it is the smallest node, if it is then get the lock.
 
 
nacos
Dedicated to helping you discover, configure, and micro-management services. Nacos provides a set of simple-to-use set of features to help you achieve dynamic service discovery, service configuration management, service and traffic management.
sh startup.sh -m standalone
http: // localhost: 8848 / nacos / index.html page, enter the account password: default account: nacos silence Password: nacos

Guess you like

Origin www.cnblogs.com/novalist/p/11621351.html