cd ./zookeeper/conf/
1
将zoo_sample.cfg文件复制为zoo.cfg文件
cp zoo.cfg.sample zoo.cfg
1
编辑zoo.cfg文件,如下:
# 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.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/hadoop/zookeeper/data
dataLogDir=/hadoop/zookeeper/log
# the port at which the clients will connect
clientPort=2181
server.1=server01:2888:3888
server.2=server02:2888:3888
server.3=server03:2888:3888
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/ ... 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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
在zookeeper目录下创建data目录和log目录