为什么我们需要在 Hadoop 堆栈中使用 ZooKeeper? [英] Why do we need ZooKeeper in the Hadoop stack?

查看:35
本文介绍了为什么我们需要在 Hadoop 堆栈中使用 ZooKeeper?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Hadoop/ZooKeeper 的新手.我无法理解将 ZooKeeper 与 Hadoop 一起使用的目的,ZooKeeper 是否在 Hadoop 中写入数据?如果不是,那我们为什么要在 Hadoop 中使用 ZooKeeper?

I am new to Hadoop/ZooKeeper. I cannot understand the purpose of using ZooKeeper with Hadoop, is ZooKeeper writing data in Hadoop? If not, then why we do we use ZooKeeper with Hadoop?

推荐答案

Hadoop 1.x 不使用 Zookeeper.即使在 Hadoop 1.x 安装中,HBase 也使用 zookeeper.

Hadoop 1.x does not use Zookeeper. HBase does use zookeeper even in Hadoop 1.x installations.

Hadoop 从 2.0 版开始也采用了 Zookeeper.

Hadoop adopted Zookeeper as well starting with version 2.0.

Zookeeper 的目的是集群管理.这符合 *nix 使用较小的专用组件的一般理念 - 因此需要集群功能的 Hadoop 组件依赖于 Zookeeper,而不是开发自己的组件.

The purpose of Zookeeper is cluster management. This fits with the general philosophy of *nix of using smaller specialized components - so components of Hadoop that want clustering capabilities rely on Zookeeper for that rather than develop their own.

Zookeeper 是一个分布式存储,提供以下保证(复制自 Zookeeper 概览页面):

Zookeeper is a distributed storage that provides the following guarantees (copied from Zookeeper overview page):

  • 顺序一致性 - 来自客户端的更新将应用于订单发送.
  • 原子性 - 更新要么成功要么失败.没有部分结果.
  • 单一系统映像 - 客户端将看到无论它连接的服务器如何,服务的相同视图到.
  • 可靠性 - 应用更新后,它将持续存在从那时起直到客户端覆盖更新.
  • 及时性 - 保证客户对系统的看法在特定时间范围内保持最新状态.

您可以使用这些来实现不同的食谱"集群管理,如锁、leader选举等

You can use these to implement different "recipes" that are required for cluster management like locks, leader election etc.

如果您打算自己使用 ZooKeeper,我建议您查看 来自 Netflix 的 Curator 这使得它更容易使用(例如,他们实现了一些开箱即用的食谱)

If you're going to use ZooKeeper yourself, I recommend you take a look at Curator from Netflix which makes it easier to use (e.g. they implement a few recipes out of the box)

这篇关于为什么我们需要在 Hadoop 堆栈中使用 ZooKeeper?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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