GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Java-Interview-Advanced/docs/03/124.md at master · leelovejava/Java-Interview-Advanced

Expand file tree

/

124.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
25 lines (8 loc) · 935 Bytes
/

124.md

Copy path

File metadata and controls

25 lines (8 loc) · 935 Bytes
Raw
Copy raw file
Download raw file
Edit and raw actions

124、ZooKeeper最核心的一个机制:Watcher监听回调

Watcher监听回调

ZooKeeper最核心的机制,就是你一个客户端可以对znode进行Watcher监听,然后znode改变的时候回调通知你的这个客户端,这个是非常有用的一个功能,在分布式系统的协调中是很有必要的

支持写和查:只能实现元数据存储,Master选举,部分功能

分布式系统的协调需求:分布式架构中的系统A监听一个数据的变化,如果分布式架构中的系统B更新了那个数据/节点,zk反过来通知系统A这个数据的变化

/usr/local/uid

使用zk很简单,内存数据模型(不同节点类型);写数据,主动读取数据;监听数据变化,更新数据,反向通知数据变化

实现分布式集群的集中式的元数据存储、分布式锁、Master选举、分布式协调监听

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.