动物园管理员工作 [英] Zookeeper Working

查看:272
本文介绍了动物园管理员工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习有关动物园管理员。我学会了当集群中含有机1000的那个饲养员是非常有用的。我有几个疑问。

I am learning about Zookeeper. I learned that zookeeper is very useful when the cluster contains 1000's of machines. I have few doubts.

我试着阅读下面的链接了解
解释的Apache ZooKeeper的结果
解释的Apache ZooKeeper的

I tried reading the following links to understand Explaining Apache ZooKeeper
Explaining Apache ZooKeeper

我有以下几个问题

1)在如何处理集群上千台机器时,动物园管理员是有帮助吗?结果
2)如何解决饲养员分布式同步问题?结果
3)究竟是如何解决的动物园管理员集中配置的问题?

1) How zookeeper is helpful when handling thousands of machines in cluster ?
2) How zookeeper solves the distributed synchronization problem ?
3) How exactly zookeeper solves centralized configuration problem ?

推荐答案

有很多可能的使用情况的ZooKeeper,最突出的是肯定。

How zookeeper is helpful when handling thousands of machines in cluster?

There are lot of possible use cases for ZooKeeper, the most prominent ones are surely


  • 服务注册表

  • 配置存储

  • 分布式锁定

  • 分布式通知服务(使用观察家)

  • 更多...

根据需要为您的特定用例可以运行尽可能多的ZooKeeper实例。每个群集中的1000台机器和/或程序连接到其中之一。

You can run as many ZooKeeper instances as required for your particular use case. Each of your 1000 machines and/or programs in your cluster connects to one of them.

当然,动物园管理员实例必须相应地配置,以正确地作为集群一起工作。这是动物园管理员网站

Of course, the ZooKeeper instances have to be configured accordingly, in order to properly work together as a cluster. This is from the ZooKeeper website

群集(多服务器)设置

有关可靠的ZooKeeper服务,您应该称为合奏群集中部署的ZooKeeper。只要大多数乐团都在涨,该服务将可用。因为动物园管理员需要过半数,最好使用奇数机器。例如,四台机器的ZooKeeper只能处理一台机器的故障;如果两台机器发生故障,剩下的两个机器不占多数。然而,五机动物园管理员可以处理两台机器的故障。

For reliable ZooKeeper service, you should deploy ZooKeeper in a cluster known as an ensemble. As long as a majority of the ensemble are up, the service will be available. Because Zookeeper requires a majority, it is best to use an odd number of machines. For example, with four machines ZooKeeper can only handle the failure of a single machine; if two machines fail, the remaining two machines do not constitute a majority. However, with five machines ZooKeeper can handle the failure of two machines.

[...]

4.Create一个配置文件。该文件可以被称为什么。使用以下设置作为起始点:

4.Create a configuration file. This file can be called anything. Use the following settings as a starting point:

tickTime=2000
dataDir=/var/zookeeper/
clientPort=2181
initLimit=5
syncLimit=2
server.1=zoo1:2888:3888
server.2=zoo2:2888:3888
server.3=zoo3:2888:3888


  
  

每一个机器,是乐团的ZooKeeper的一部分,应该知道每一个其他机器的合奏。端口:端口您同系列的形式server.id =主机的行做到这一点。参数主机和端口非常简单。您可以通过创建一个文件名为身份识别码,每个服务器,该服务器驻留在服务器的数据目录,由配置文件参数DATADIR属性指定服务器ID为每台机器。

Every machine that is part of the ZooKeeper ensemble should know about every other machine in the ensemble. You accomplish this with the series of lines of the form server.id=host:port:port. The parameters host and port are straightforward. You attribute the server id to each machine by creating a file named myid, one for each server, which resides in that server's data directory, as specified by the configuration file parameter dataDir.

5,身份识别码文件包含只包含机器的ID的文本单行。因此,服务器1的身份识别码将包含文本1,而不是其他。 ID必须是乐团中是唯一的,应该有1到255之间的值。

5.The myid file consists of a single line containing only the text of that machine's id. So myid of server 1 would contain the text "1" and nothing else. The id must be unique within the ensemble and should have a value between 1 and 255.

[...]

动物园管理员通过使用特殊的协议(ZooKeeper的原子广播,ZAB)收集共识和发布有关的内部数据结构的状态的结果,确保整个集群的一致性。虽然不完全等效,它大致可以想像为的Paxos协议的变体。该协议确保数据是在每个时间点从而方便和安全的故障转移例如一致当一个特定的ZooKeeper实例崩溃。

How zookeeper solves the distributed synchronization problem?

ZooKeeper ensures consistency throughout the cluster by using a special protocol (ZooKeeper Atomic Broadcast, ZAB) to gather consensus and publish the results about the state of the internal data structure. Although not exactly equivalent, it can roughly be imagined as a variant of the Paxos protocol. This protocol ensures the data being consistent at every point in time which allows for easy and safe failover e.g. when one particular ZooKeeper instance crashes.

从技术上讲, ZAB没有的Paxos ,但差异其实并不重要,如果你只是想使用的ZooKeeper。

Technically, ZAB is not Paxos, but the difference does not really matter if you just want to use ZooKeeper.

由于不必你(配置)数据的单一,集中的副本。虽然每个ZooKeeper的客户端程序通常连接到一个特定的ZooKeeper例如,所有数据将始终被复制。

By not having a single, centralized copy of your (configuration) data. Although each ZooKeeper client program typically connects to one particular ZooKeeper instance, all data are always replicated.

这篇关于动物园管理员工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆