1. 入门

1.1 介绍

Zookeeper_java-zookeeper

Zookeeper_java-zookeeper_02

 

Zookeeper_java-zookeeper_03

1.2 应用场景

Zookeeper_java_04

Zookeeper_zookeeper_05

Zookeeper_java_06

Zookeeper_监听器_07

Zookeeper_回调函数_08

 

Zookeeper_java_09

2.  Zookeeper内部原理

Zookeeper_监听器_10

2.1 选举机制:先选自己,不够的话投票给id最大的

Zookeeper_java-zookeeper_11

Zookeeper_监听器_12

2.2 节点类型

Zookeeper_java-zookeeper_13

2.3 stat结构体(了解)

Zookeeper_监听器_14

Zookeeper_java-zookeeper_15

 2.4 监听器原理 

Zookeeper_java-zookeeper_16

2.5 写数据流程

Zookeeper_java_17

3. 面试

Zookeeper_回调函数_18

Zookeeper_java-zookeeper_19

Zookeeper_java-zookeeper_20

Zookeeper_zookeeper_21

Zookeeper_监听器_22

A服务查询B服务的状态:1.轮询2.主动通知

B把关注的事件注册到Zookeeper,通过Watch作为钩子,事件发生后出发回调函数callback,通知B

Zookeeper_java-zookeeper_23

Zookeeper_java-zookeeper_24

 ZK的作用(分布式协调者):

Zookeeper_回调函数_25

Zookeeper_java-zookeeper_26

Zookeeper_java-zookeeper_27

Zookeeper_监听器_28

Zookeeper_java-zookeeper_29