1.cd /opt/zookeeper-3.4.5
2. Enter the Conf subdirectory under the Zookeeper directory to create the zoo.cfg and add the content:
Zoo.cfg to copy the zoo_sample.cfg under the Conf, otherwise there will be a coding problem.
ticktime=2000
initlimit=10
Synclimit=5
Datadir=/home/files/zookeeper/zkdata
Datalogdir=/home/files/zookeeper/zkdatalog
clientport=2181
server.1=10.45.54.145:2888:3888 (Use your IP here)
parameter Description :
The base time unit, millisecond value, used in Ticktime:zookeeper.
DataDir: Data directory. can be any directory.
The Datalogdir:log directory can also be any directory. If this parameter is not set, the same settings are used and DataDir.
ClientPort: Listens for the port number of the client connection.
3. Set myID
Under the directory specified by the DataDir that we configured , create a myID file with a number that identifies the current host, the conf/zoo.cfg in the server.x configured in the file, and the number in the myID file.
Touch myID
VI myID
4.
Program Run Action
L Start
# CD /opt/zookeeper-3.4.5/bin
#./zkserver.sh start
L Stop
# CD /opt/zookeeper-3.4.5/bin
#./zkserver.sh stop
L Restart
# CD /opt/zookeeper-3.4.5/bin
#./zkserver.sh restart
2) Test Boot success
# CD /opt/zookeeper-3.4.5/bin
#./zkcli.sh-server 172.31.95.51:2181
3) View Zookeeper Status:
# CD /opt/zookeeper-3.4.5/bin
#./ZKSERVER.SH Status
See him on behalf of stand-alone mode success
Linux installation Zookeeper (standalone mode)