Deploy
- apt-get install openjdk-8-jre
- cd /opt< /li>
- wget http://mirror.bit.edu.cn/apache/zookeeper/stable/zookeeper-3.4.10.tar.gz
- tar -zxvf zookeeper-3.4.10. tar.gz
- mv zookeeper-3.4.10 zookeeper
- cd zookeeper/conf/
- cp zoo_sample.cfg zoo.cfg
- mkdir /var/zookeeper
- Modify zoo.cfg (stand-alone)
dataDir=/var/zookeeper
- < p>Increase environment variables
vi ~/.bashrc
export PATH=/opt/zookeeper/bin:$PATH
source ~/.bashrc -
Start
zkServer.sh start
-
Status
< blockquote>
zkServer.sh status
-
Access
zkCli.sh -server 127.0.0.1:2181 p>
[zk: 127.0.0.1:2181(CONNECTED) 1] ls[zk: 127.0.0.1:2181(CONNECTED) 2] create /k1 v1Created /k1[zk: 127.0.0.1:2181(CONNECTED) 3] get /k1v1cZxid = 0x2ctime = Sat Oct 14 19:05:40 CST 2017mZxid = 0x2mtime = Sat Oct 14 19:05:40 CST 2017pZxid = 0x2cversion = 0dataVersion = 0aclVersion = 0ephemeralOwner = 0x0dataLength = 2numChildren = 0
Other
- < li>As long as more than half of the nodes can be accessed, the cluster is normal
- var/zookeeper/zookeeper_server.out View error log
Deploy
- apt-get install openjdk-8-jre
- cd /opt
- wget http://mirror. bit.edu.cn/apache/zookeeper/stable/zookeeper-3.4.10.tar.gz
- tar -zxvf zookeeper-3.4.10.tar.gz
- mv zookeeper-3.4.10 zookeeper
- cd zookeeper/conf/
- cp zoo_sample.cfg zoo.cfg
- mkdir /var/zookeeper
- Modify zoo.cfg (stand-alone)
dataDir=/var/zookeeper
-
Add environment variables
-
Start
zkServer.sh start
-
Status
zkServer. sh status
-
Access
zkCli.sh -server 127.0.0.1:2181
< /li>
li>
p>
vi ~/.bashrc
export PATH=/opt/zookeeper/bin:$PATH
source ~/.bashrc
[zk: 127.0.0.1:2181(CONNECTED) 1] ls[zk: 127.0.0.1:2181(CONNECTED) 2] create /k1 v1Created /k1[zk : 127.0.0.1:2181(CONNECTED) 3] get /k1v1cZxid = 0x2ctime = Sat Oct 14 19:05:40 CST 2017mZxid = 0x2mtime = Sa t Oct 14 19:05:40 CST 2017pZxid = 0x2cversion = 0dataVersion = 0aclVersion = 0ephemeralOwner = 0x0dataLength = 2numChildren = 0
Other
- < li>As long as more than half of the nodes can be accessed, the cluster is normal
- var/zookeeper/zookeeper_server.out View error log