
本文共 8281 字,大约阅读时间需要 27 分钟。
zk������������
zk������
zk������������������
������������ Leader ������
������������zk������������������������������������Leader(���������Observer)������zk������������������������myid���zxid������������������zk���������������myid���������������������zxid������epoch(������������������������������leader������������������������������������������������������������ID���)+xid���������id������������������������������������������ID���������������zk������������������zk������������������������������������������������zxid���������������������zxid������������leader������zxid���������������myid������������leader���
CAP������
������������
���������������������������������Leader���������������������Proposal������������Follower���Follower���������������������ACK������Leader���������ACK������������������������������Follower������commit������������������������������observer������proposal���observer���������������Follower���observer������������Leader������ACK���Leader������ACK���������follower���observer������������������������queues���������������Queues������������Follower���observer���������������������������������������������ZK���������������������������������������������������������������������������������������������������������ZK���������������������������������������������������������������������������������������������������������������������ZK������������������
zk������������
1 ���������������������VMware������������������������������������������������������zk���������������������
2 ��� http://zookeeper.apache.org ������������������������������������������������zk������jdk���������������������������������������jdk������������������������������������������������������������������ source /etc/profile ���������������������
3 ���������������������������������������������������������������myid������������leader���������������myid������������������������������������������������������������������������������������
4 ���������������zoo_sample.cfg���������������������������zoo.cfg
���������������������������������������������������������������������������������������������
# The number of milliseconds of each tick#���������������������������tickTime=2000# The number of ticks that the initial # synchronization phase can take#���������������������10���������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.# do not use /tmp for storage, /tmp here is just # example sakes.#��������������������� dataDir=/home/zk/zookeeper-3.4.14/data# the port at which the clients will connect#������clientPort=2181#������ip ���������������������������������������������������������������server.1=192.168.31.51:2888:3888server.2=192.168.31.39:2888:3888server.3=192.168.31.148:2888:3888server.4=192.168.31.27:2888:3888:observer# the maximum number of client connections.# increase this if you need to handle more clients#maxClientCnxns=60## Be sure to read the maintenance section of the # administrator guide before turning on autopurge.## http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance## The number of snapshots to retain in dataDir#autopurge.snapRetainCount=3# Purge task interval in hours# Set to "0" to disable auto purge feature#autopurge.purgeInterval=1
���������observer���������������������������������������������������������
# The number of milliseconds of each tick#���������������������������tickTime=2000# The number of ticks that the initial # synchronization phase can take#���������������������10���������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.# do not use /tmp for storage, /tmp here is just # example sakes.#��������������������� dataDir=/home/zk/zookeeper-3.4.14/data# the port at which the clients will connect#������clientPort=2181#������ip ���������������������������������������������������������������server.1=192.168.31.51:2888:3888server.2=192.168.31.39:2888:3888server.3=192.168.31.148:2888:3888server.4=192.168.31.27:2888:3888:observer#���������������observerpeerType=observer# the maximum number of client connections.# increase this if you need to handle more clients#maxClientCnxns=60## Be sure to read the maintenance section of the # administrator guide before turning on autopurge.## http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance## The number of snapshots to retain in dataDir#autopurge.snapRetainCount=3# Purge task interval in hours# Set to "0" to disable auto purge feature#autopurge.purgeInterval=1
5 ������������
6 ������������
zk������������
���������������
zkCli.sh������������������������������������������������������zk������������������������������������������
������������
ls /path/path
zk������������������������������������������������������������������������������zookeeper���������zk������������
������������
������������
create /path value
���������������������������������������������
������������
create -e /path value
���������������������������������������������
������������������������������������
���������������������������������������������������������������������������������������������������������������������������
������������
create -s /path value
���������������������������������������������������������������������������zk���������������������������������������������������������������������
������������������
create -e -s /path value
������������������
get /path/path/...
������������������������������������������������
������������������
������������
delete /path/path...
������������������������������������������������������������������������������������������������������������������
������������������
set /path/path... value
���������������������������������������������
发表评论
最新留言
关于作者
