zookeeper单机模式安装

下载zookeeper

ubuntu下直接用命令下载

1
wget http://apache.osuosl.org/zookeeper/zookeeper-3.4.10/zookeeper-3.4.10.tar.gz

解压

1
2
3
tar -zvxf zookeeper-3.4.10.tar.gz
cd zookeeper-3.4.10/

更改配置文件

进入到conf目录下复制zoo_sample.cfg文件改名为zoo.cfg

1
2
cd conf
cp zoo_sample.cfg zoo.cfg

启动zookeeper

1
./bin/zkServer.sh start

然后用jps查看会多出一个QuorumPeerMain

连接到zookeeper

1
./bin/zkCli.sh -server localhost:2181

1
help

关闭zookeeper

1
./bin/zkServer.sh stop