zoukankan      html  css  js  c++  java
  • 什么是Zookeeper

    官方文档

    ZooKeeper: A Distributed Coordination Service for Distributed Applications

    ZooKeeper:一个开源的分布式的,为分布式应用提供协调服务的应用

    ZooKeeper is a distributed, open-source coordination service for distributed applications. It exposes a simple set of primitives that distributed applications can build upon to implement higher level services for synchronization同步, configuration配置 maintenance维护, and groups分组 and naming命名. It is designed to be easy to program to, and uses a data model styled after the familiar directory tree structure of file systems. It runs in Java and has bindings for both Java and C.

    Design Goals

    设计目标

    ZooKeeper is simple.简单 ZooKeeper allows distributed processes to coordinate整合 with each other through a shared hierarchal分级的 namespace which is organized similarly to a standard file system. The name space consists构成 of data registers寄存器 - called znodes, in ZooKeeper parlance - and these are similar to files and directories. Unlike a typical file system, which is designed for storage, ZooKeeper data is kept in-memory, which means ZooKeeper can acheive high throughput and low latency numbers.

    ZooKeeper is replicated.可重复 Like the distributed processes it coordinates, ZooKeeper itself is intended to be replicated over a sets of hosts called an ensemble.

    The servers that make up the ZooKeeper service must all know about each other. They maintain an in-memory image of state, along with a transaction logs and snapshots in a persistent store. As long as a majority of the servers are available, the ZooKeeper service will be available.

    Clients connect to a single ZooKeeper server. The client maintains a TCP connection through which it sends requests, gets responses, gets watch events, and sends heart beats. If the TCP connection to the server breaks, the client will connect to a different server.

    ZooKeeper is ordered.有序的 ZooKeeper stamps each update with a number that reflects the order of all ZooKeeper transactions. Subsequent operations can use the order to implement higher-level abstractions, such as synchronization primitives.

    ZooKeeper is fast.快速It is especially fast in "read-dominant" workloads. ZooKeeper applications run on thousands of machines, and it performs best where reads are more common than writes, at ratios of around 10:1.

    Data model and the hierarchical namespace

    数据结构和分等级的命名空间

    The name space provided by ZooKeeper is much like that of a standard file system. A name is a sequence of path elements separated by a slash (/). Every node in ZooKeeper's name space is identified by a path.

    Zookeper的应用场景

    终于可以说人话了,好轻松!!
    Zookeeper从设计模式角度来看,是一个基于观察者模式设计的分布式服务管理框架,它负责存储和管理大家都关心的数据,然后接收观察者的注册,一旦这些数据发生变化,Zookeeper就负责通知已经注册的那些观察者做出相应的反应。从而实现类似Master/Slave管理模式

    应用场景(第一句话中就提到了)

    *统一命名空间
    *配置管理
    *集群管理
    *共享锁(Locks)/同步锁

  • 相关阅读:
    flask ajax
    python 符合条件跳过下一次循环
    python使用openpyxl excel 合并拆分单元格
    等价类划分法
    python 同级目录包导入问题,使用"."错误
    django:查询,反向查询
    Python实现程序执行次数的计数
    python 2x SSH通道连接服务器读取数据库和中文编码问题
    Python for 循环中使用append()添加可变元素,前面的值被覆盖,循环中内存应用地址不变
    以概率列表选择对应元素,轮盘概率选择Python实现
  • 原文地址:https://www.cnblogs.com/cenzhongman/p/7141722.html
Copyright © 2011-2022 走看看