Download Zookeeper zookeeper download
To migrate files to the/home/hadoop/folder after download
[Email protected]:~/downloads$ sudo mv Zookeeper-3.4.9.tar.gz/home/hadoop
TAR-ZXVF Decompression
[Email protected]:/home/hadoop$ sudo tar-zxvf zookeeper-3.4.9.tar.gz
Change Folder zookeeper-3.4.9 to Zookeeper
[Email protected]:/home/hadoop$ sudo mv zookeeper-3.4.9 zookeeper
Unzip to create a copy of the zoo_sample.cfg in the Conf folder zoo.cfg
[Email protected]:/home/hadoop$ CD zookeeper[email protected]:/home/hadoop/zookeeper$ cd Conf[email Protected]:/home/hadoop/zookeeper/conf$ MP zoo_sample.cfg ZOO_CFGMP: Command not found [email protected]:/home/ hadoop/zookeeper/conf$ CP zoo_sample.cfg ZOO.CFGCP: Unable to create normal file ' zoo.cfg ': Insufficient permissions [email protected]:/Home /hadoop/zookeeper/conf$ sudo cp zoo_sample.cfg zoo.cfg[email protected]:/home/hadoop/zookeeper/conf$ sudo Gedit zoo.cfg
The original zoo.cfg:
# of milliseconds of each tickticktime=2000# The number of ticks that the initial # synchronization phase can takeinitlimit=10# The number of ticks that can pass between # Sending a request and getting an acknowledgementsynclimit=5# The directory where the snapshot is stored.# DoNot use/tmp forStorage,/tmp Here is just # example Sakes.datadir=/tmp/zookeeper# the port at which the clients would connectclientport=2181# The maximum number of client connections.# increase This ifYou need to handle more Clients#maxclientcnxns=60# # is sure to read the maintenance sections of the # Administrator guide before turning on autopurge.## http://zookeeper.apache.org/doc/current/zookeeperadmin.html#sc_maintenance# # 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
Modified to:
# of milliseconds of each tickticktime=2000# The number of ticks that the initial # synchronization phase can takeinitlimit=10# The number of ticks that can pass between # Sending a request and getting an acknowledgementsynclimit=5# The directory where the snapshot is stored.# DoNot use/tmp forStorage,/tmp Here is just # example sakes. DataDir=/home/hadoop/zookeeper/Data # persisted path Datalogdir=/home/hadoop/zookeeper/log #日志保存路径server.1=192.168.1.203:2888:3888# The port at which the clients would connectclientport=2181# The maximum number of client connections.# increase This ifYou need to handle more Clients#maxclientcnxns=60# # is sure to read the maintenance sections of the # Administrator guide before turning on autopurge.## http://zookeeper.apache.org/doc/current/zookeeperadmin.html#sc_maintenance# # 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
Description
Synclimit=5 # Leader with the maximum response time unit between follower, response over synclimit*Ticktime,leader think Follwer dead, remove Follwer from the server list. Initlimit=10 # votes to elect the initial time of the new leader. Ticktime=2000 # Zookeeper server heartbeat time, per millisecond clientport=2181 # Connection Port DataDir=/home/hadoop/zookeeper/ Data # persisted path Datalogdir=/home/hadoop/zookeeper/log# logs save path server. 1=10.10.100.10:2888:3888
Set Environment variables:
[Email protected]:/home/hadoop/zookeeper/conf$ export zookeeper_home=/home/hadoop/zookeeper[email protected]: /home/hadoop/zookeeper/conf$ export path= $PATH: $ZOOKEEPER _home/bin
Start Zookeeper:
[Email protected]:/home/hadoop/zookeeper/conf$ CD. [Email protected]:/home/hadoop/zookeeper/conf$ CD. /[email protected]:/home/hadoop/zookeeper$ CD Bin[email protected]:/home/hadoop/zookeeper/bin$ zkserver.sh startzookeeper JMX enabled bydefaultUsing config:/home/hadoop/zookeeper/bin/. /conf/Zoo.cfgmkdir: Unable to create directory"/home/hadoop/zookeeper/data # Data Persistence path": Insufficient permissions starting zookeeper .../home/hadoop/zookeeper/bin/zkserver.sh: Line 140:./zookeeper.out: Insufficient Authority/home/hadoop/zookeeper/bin/zkserver.sh: Line 149:/home/hadoop/zookeeper/data # Data Persistence path/zookeeper_server.pid: No file or directory failed to WRITE Pid[email protected]:/home/hadoop/zookeeper/bin$ sudo zkserver.sh start[sudo] hongdada password: sudo:zkServer.sh: Command not found [email protected]:/home/hadoop/zookeeper/bin$ sudo./zkserver.sh startzookeeper JMX enabled bydefaultUsing config:/home/hadoop/zookeeper/bin/. /conf/zoo.cfgstarting Zookeeper ... STARTED
Start is./zkserver.sh Start
Http://jingyan.baidu.com/article/456c463b60bd380a5931446f.html
http://blog.csdn.net/cruise_h/article/details/19046357
Ubuntu Installation Zookeeper