1, the implementation of the command to download zookeeper3.5.0 specific directory under which to set their own
wget http://mirror.bit.edu.cn/apache//zookeeper/zookeeper-3.5.0-alpha/zookeeper-3.5.0-alpha.tar.gz
2. Unzip the file
Tar zxvf zookeeper-3.5.0-alpha.tar.gz
3. Renaming (this can be optional)
MV Zookeeper-3.5.0-alpha ZK
4, configuration file Zoo.cfg (the default is this zoo_sample.cfg, you can copy one, save to another place, and then renamed to ZOO.CFG)
Datadir=/opt/zk/zk/data
Datalogdir=/opt/zk/zk/logs
5. Configure Environment variables
Vim/etc/profile
Export Zookeeper_home=/opt/zk/zk (change this to your own directory)
Path= $ZOOKEEPER _home/bin: $PATH
Export PATH
6. Start ZK
./zkserver.sh start
7. Client Connection Test
./zkcli.sh-server localhost:2181
[Email protected] bin]$ pwd
/opt/zk/zk/bin
[Email protected] bin]$/zkcli.sh-server localhost:2181
Connecting to localhost:2181
。。。
[root:localhost:2181 (CONNECTED) 0] LS/
[Zookeeper]
[Root:localhost:2181 (CONNECTED) 1] create/test HELLOZK
Created/test
[Root:localhost:2181 (CONNECTED) 2] Get/test
Hellozk
[Root:localhost:2181 (CONNECTED) 3] set/test Hellozookeeper
[Root:localhost:2181 (CONNECTED) 4] Get/test
Hellozookeeper
[Root:localhost:2181 (CONNECTED) 5] Delete/test
[Root:localhost:2181 (CONNECTED) 6] Get/test
Node does not exist:/test
[Root:localhost:2181 (CONNECTED) 7] Quit
2014-11-19 03:53:50,180 [myID:]-INFO [main:[email protected]]-session:0x149c475d7db0000 closed
2014-11-19 03:53:50,182 [myID:]-INFO [main-eventthread:[email protected]]-Eventthread shut down
The single-machine installation configuration is complete.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Zookeeper stand-alone mode installation configuration