Zookeeper简介

1. 什么是Zookeeper

ZooKeeper is a high-performance coordination service for distributed applications. It exposes common services - such as naming, configuration management, synchronization, and group services - in a simple interface so you don't have to write them from scratch. You can use it off-the-shelf to implement consensus, group management, leader election, and presence protocols. And you can build on it for your own, specific needs.

ZooKeeper是分布式应用程序的高性能协调服务。它在一个简单的接口中公开了通用服务,如命名、配置管理、同步和组服务,因此您不必从头开始编写它们。您可以使用现成的工具来实现共识、组管理、领导者选举和出席协议。你可以根据自己的特定需求进行构建。

2. Zookeeper的设计目标

2.1 复制的

与它协调的分布式进程一样,ZooKeeper本身旨在集群主机之间的数据(配置)复制。

2.2 事务有序的

ZooKeeper用一个数字标记每次更新,该数字反映了所有ZooKeeper事务的顺序。后续操作可以使用该顺序来实现更高级别的抽象,例如同步原语。

2.3 高效的

它在"以读取为主"的工作负载中特别快。ZooKeeper应用程序在数千台机器上运行,在读取比写入更常见的情况下,其性能最佳,比率约为10:1。

3. Zookeeper的数据模型和分层命名空间

3.1 数据模型

Unlike standard file systems, each node in a ZooKeeper namespace can have data associated with it as well as children. It is like having a file-system that allows a file to also be a directory. (ZooKeeper was designed to store coordination data: status information, configuration, location information, etc., so the data stored at each node is usually small, in the byte to kilobyte range.) We use the term znode to make it clear that we are talking about ZooKeeper data nodes.

与标准文件系统不同,ZooKeeper命名空间中的每个节点都可以拥有与其关联的数据以及子节点。这就像有一个文件系统,允许文件也成为目录。(ZooKeeper旨在存储协调数据:状态信息、配置、位置信息等,因此存储在每个节点的数据通常很小,在字节到千字节的范围内。)我们使用术语znode来明确我们谈论的是ZooKeeper数据节点。

3.2 分层命名空间

2.1 服务发现

2.2 分布式配置

  • 配置文件的更新,借助zookeeper的znode变化,更新指定的配置文件或配置项。
  • 分布式环境中,同时更新所有集群机器上的配置文件。 参考 [[Zookeeper 官方示例2-SyncPrimitive 代码解读]] 第1章节内容。

2.3 Master的选举

2.4 消息队列(JMX)

参考[[Zookeeper 官方示例2-SyncPrimitive 代码解读]] 第2章节内容。

相关推荐
孟意昶9 小时前
Doris专题31-SQL手册-基础元素
大数据·数据库·数据仓库·分布式·sql·知识图谱·doris
2603_9547083111 小时前
交直流混合微电网架构:拓扑优化与功率交互设计
人工智能·分布式·物联网·架构·系统架构·能源
juniperhan13 小时前
Flink 系列第12篇:Flink 维表关联详解
大数据·数据仓库·分布式·flink
SilentSamsara14 小时前
存储卷体系:EmptyDir/HostPath/PV/PVC/StorageClass 的选型决策树
服务器·微服务·云原生·容器·架构·kubernetes·k8s
王的宝库15 小时前
【K8s】集群安全机制(二):授权(Authorization)详解与实战
学习·云原生·容器·kubernetes
Evand J15 小时前
【雷达跟踪代码介绍】基于matlab卡尔曼滤波器雷达多目标跟踪(双雷达 多目标 分布式融合)
分布式·matlab·目标跟踪·多目标跟踪·雷达跟踪
Jackyzhe16 小时前
从零学习Kafka:ZooKeeper vs KRaft
学习·zookeeper·kafka
东北甜妹17 小时前
Docker 容器故障排查
云原生·eureka
zz07232017 小时前
Seata ——微服务分布式事务
分布式·微服务·架构·seata
小江的记录本17 小时前
【分布式】分布式系统核心知识体系:CAP定理、BASE理论与核心挑战
java·前端·网络·分布式·后端·python·安全