08448380779 Call Girls In Civil Lines Women Seeking Men
Zookeeper In Simple Words
1. ZOOKEEPER IN MY WORDS
fujohnwang@Pluto
2011.01.11
Wednesday, January 12, 2011
2. WHAT’S ZK?
“ZooKeeper is a centralized service for maintaining configuration
information, naming, providing distributed synchronization, and providing
group services. All of these kinds of services are used in some form or another
by distributed applications. Each time they are implemented there is a lot of
work that goes into fixing the bugs and race conditions that are inevitable.
Because of the difficulty of implementing these kinds of services, applications
initially usually skimp on them ,which make them brittle in the presence of
change and difficult to manage. Even when done correctly, different
implementations of these services lead to management complexity when the
applications are deployed.”
Wednesday, January 12, 2011
3. WHAT THE FUCK
DOES THAT MEAN?
Simply Put: Coordination Service For Distributed
Systems
Wednesday, January 12, 2011
4. WHAT ZK CAN DO?
Name Service
Configuration
Group Membership
Distributed Synchronization
Wednesday, January 12, 2011
5. WHAT ZK LOOKS LIKE?
File System Model
Hierarchical Namespace
each node can have both data and children
Wednesday, January 12, 2011
8. HOW TO DEPLOY ZK?
single server quorum cluster
majority algorithm(2n + 1)
Wednesday, January 12, 2011
9. ZK DEPLOYMENT IN DETAILS
configuration
data location
transaction log location (optional but necessary)
cluster members
myid file (under data location directory)
Wednesday, January 12, 2011
10. CONFIGURATION FILE
SAMPLE
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
dataDir=/Users/fujohnwang/Downloads/zookeeper-3.3.2/data
# the port at which the clients will connect
clientPort=2181
server.1=10.16.200.14:2888:3888
server.2=10.20.135.206:2888:3888
server.3=10.20.130.233:2888:3888
Wednesday, January 12, 2011
11. HOW TO INTERACTIVE WITH
ZK?
Command Line Tool
Zookeeper API Bindings
Java Bindings
C Bindings
Wednesday, January 12, 2011
12. ZOOKEEPER CLI
bin/zkCli.sh -server 127.0.0.1:2181
[zk: 10.20.130.233:2181(CONNECTED) 0] help
ZooKeeper -server host:port cmd args
printwatches on|off
ls2 path [watch]
listquota path
close
get path [watch]
sync path
delete path [version]
quit
addauth scheme auth
getAcl path
setAcl path acl
setquota -n|-b val path
redo cmdno
create [-s] [-e] path data acl
set path data [version]
stat path [watch]
connect host:port
ls path [watch]
history
delquota [-n|-b] path
Wednesday, January 12, 2011
13. ZK API = SIMPLE API
create
delete
exists
set data
get data
get children
sync
Wednesday, January 12, 2011
14. WHAT THE FEATURES OF ZK?
Notification
Ordering
Atomicity
Versioned Write
Ephemeral Nodes
Sequential Nodes
High Availability
Wednesday, January 12, 2011
15. WATCH - NOTIFICATION
Concept
Usecase
dynamic configuration push
other (semi)real-time information notification
Wednesday, January 12, 2011
16. EPHEMERAL NODES
Concept
lifecycle-dependent
no children
Usecase
group membership
leader election
Wednesday, January 12, 2011
17. SEQUENTIAL NODES
Concept
Usecase
queue
Wednesday, January 12, 2011
18. GUARANTEES OF ZK
Sequential Consistency - Updates from a client will be applied in the order that they
were sent.
Atomicity - Updates either succeed or fail. No partial results.
Single System Image - A client will see the same view of the service regardless of the
server that it connects to.
Reliability - Once an update has been applied, it will persist from that time forward until a client
overwrites the update.
Timeliness - The clients view of the system is guaranteed to be up-to-date within a certain time
bound.
Wednesday, January 12, 2011
19. CAUTIONS TO TAKE
prefer small data size for each node(less than 1M)
one time trigger (add again and again if u need)
dataset in all must fit in memory
Wednesday, January 12, 2011
20. QUESTIONS?
nicholsong
Wednesday, January 12, 2011