[Daily 3 minutes technological Dry | face questions + answers | Zookeeper articles (a)]

1. zookeeper What is that?

zookeeper is a distributed, open-source coordination service for distributed applications, is an open source implementation google chubby, hadoop and is an important component of hbase. It is to provide a consistent service for distributed applications, provides features include: configuration maintenance, domain name service, distributed synchronization, group services.

2. zookeeper What are features?

  • Cluster management: monitoring node survival status, running requests, etc.

  • The master node election: hang after the master node can start a new round of election spare node master, the master node election that is the election process, using a zookeeper can assist with this process.

  • Distributed Lock: zookeeper provides two locks: exclusive locks, shared locks. Exclusive lock that is only one thread uses resources shared locks are locks shared reading, reading and writing are mutually exclusive, that can have multiple threads simultaneously read the same line resources, if you want to use a write lock can only use one thread. zookeeper distributed lock can be controlled.

  • Naming Service: In a distributed system, by using a naming service, the client application to be able to get the address of the specified resource or service name, informants and so on.

3. zookeeper There are several deployment models?

zookeeper has three deployment models:

  • Stand-alone deployment: running on a cluster;

  • Cluster deployment: Multiple clusters running;

  • Pseudo cluster deployment: a cluster launch multiple instances running zookeeper.

4. zookeeper how to ensure the synchronization from the master node status?

Zookeeper core of atomic broadcast, this mechanism ensures synchronization between each server. Protocol Implementation of this mechanism is called zab agreement. zab protocol has two modes, namely recovery mode (selected from the master) and broadcast mode (synchronous). When the service starts or after leader crashes, zab entered recovery mode, when the leader is elected, and most server completed and leader of the state synchronization after recovery mode is over. State synchronization server and ensure that the leader of the system have the same status.

5. Why should the master node in the cluster?

In a distributed environment, some business logic needs only one of the machines in the cluster for execution, other machines can share the results, which can greatly reduce double counting, improve performance, so we need to master.

6. There are three servers in the cluster, one node goes down, this time zookeeper can also use it?

Can continue to use the singular server as long as no more than half of server downtime can continue to use.

7. talk about the notification mechanism zookeeper?

Znode a client side will set up a watcher event, when the znode changes, these clients will be notified of the zookeeper, and then the client can make changes on the services according to znode change.

Epilogue

Take these words to encourage each other, encourage each other now. The more work, the more luck if you are not the official second-generation, rich second-generation, second generation red, remember: hard work is the only shortcut to change your destiny.

Feel free to leave your opinions in the comments section to discuss improving together. If today's article gives you new inspiration, new understanding to enhance the learning ability, welcome to forward share to more people.

Welcome to our readers to join programmer ** knowledge dock ** technology group , replies "No background in public plus group " can be.

[Daily 3 minutes technological Dry | face questions + answers | Zookeeper articles (a)]

Guess you want to see

1. always ask interview jvm tuning in the end is going to do?

2. Programmers should have what kind of career planning? Worth thinking about!

3. Daily 3 minutes technological Dry | face questions + answers | jvm articles (a)

4. Daily 3 minutes technological Dry | face questions + answers | jvm articles (b)

5. Daily 3 minutes technological Dry | face questions + answers | Redis articles (a)

6. Daily 3 minutes technological Dry | face questions + answers | Mysql articles (a)

7. Daily 3 minutes technological Dry | face questions + answers | RabbitMQ articles (a)

[Daily 3 minutes technological Dry | face questions + answers | Zookeeper articles (a)]

Guess you like

Origin blog.51cto.com/14626895/2464299