Zookeeper principle study of (a)

 Read the statement: The following is a combination of online material written personal understanding, if inappropriate, welcome to correct me thank you ~~~

A, Zookeeper Introduction

  zookeeper, see the name EENOW Well, zoo zoo, keeper holder, administrators, is to combine animal administrator, Why? We can look at and hold the current Big Data technologies: for example, Hadoop's logo is a yellow elephant, HBase the log like a whale, Hive's logo is more peculiar, and the body with Hadoop elephant head like bees combination, etc. and the like. Thus our view Big Data technologies like a zoo, but zookeeper is like a zoo administrator, its logo is even more demonstrated its meaning.

  Said so much gossip, let's start into the topic, see the definition of Apache official website to it:

  ZooKeeper is a distributed coordination service framework, distributed in ZooKeeper can solve common problems: cluster management, unified naming service, the configuration information management, distributed lock.

Second, the basic concept of ZooKeeper

  Learn a technique, first we have this technology is particularly clear principles door, we enter the following structure ZooKpper, as follows :

  

  1) ZooKeeper only one root node /, each node can have child nodes, each node is called zNode, while the data may be stored.

  2) a plurality of nodes forming a tree zNode, and the parent-child relationship between the storage node information

  3) zNode tree is to maintain in memory for quick queries and fast response

  4) Operation node: it is relative to the root node, for example ls / zk_1

  5) Node Type:

      ① ordinary lasting node: create / test01 123 (When you create this node client thread hang, the node is still stored)

      ② general temporary node: create -e / test01 123 (When you create this node client thread hang, the node will be deleted)

      Persistent node ③ sequence: create -s / test01 123 (referring to the sequence in the specified path on a fight incremented sequence number)

      ④ lasting temporary node: create -e -s / test01 123 (When you create this node client thread hang, the node will be deleted, the order refers to the specified path to fight on an incremental sequence number)

  Here additional clarification, the role of temporary node: The node cluster management services.

  

 

Three, ZooKeeper of common commands

   1) server commonly used commands:

     

   2) the client frequently used commands:

    

Four, Zookeeper application scenarios

  ① Cluster Management

  

  ② unified cluster configuration information management

  

  Cluster Master ③ZooKeeper applied to monitoring and standby switching

  

  ④ZooKeeper applied in a unified cluster name

  

  ⑤ZooKeeper applied to distributed lock (here my understanding is not deep enough, the next to add Redis used in a distributed lock)

 

Guess you like

Origin www.cnblogs.com/rmxd/p/11294532.html