zookeeper单机版安装
下载
代码语言:javascript复制https://zookeeper.apache.org/releases.html
选择Apache ZooKeeper 3.8.1(asc, sha512)
创建目录
代码语言:javascript复制mkdir -p /usr/local/zookeeper/apache-zookeeper-3.8.1-bin/data
上传服务器并解压
代码语言:javascript复制tar -zxvf apache-zookeeper-3.8.1-bin.tar.gz -C /usr/local/zookeeper
创建配置文件
代码语言:javascript复制cp /usr/local/zookeeper/apache-zookeeper-3.8.1-bin/conf/zoo_sample.cfg /usr/local/zookeeper/apache-zookeeper-3.8.1-bin/conf/zoo.cfg
修改配置文件
代码语言:javascript复制dataDir=/usr/local/zookeeper/apache-zookeeper-3.8.1-bin/data
启动
代码语言:javascript复制sh /usr/local/zookeeper/apache-zookeeper-3.8.1-bin/bin/zkServer.sh start
代码语言:javascript复制[root@localhost zookeeper]# sh /usr/local/zookeeper/apache-zookeeper-3.8.1-bin/bin/zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/apache-zookeeper-3.8.1-bin/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@localhost zookeeper]#
查看状态
代码语言:javascript复制sh /usr/local/zookeeper/apache-zookeeper-3.8.1-bin/bin/zkServer.sh status
代码语言:javascript复制[root@localhost zookeeper]# sh /usr/local/zookeeper/apache-zookeeper-3.8.1-bin/bin/zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/apache-zookeeper-3.8.1-bin/bin/../conf/zoo.cfg
Client port found: 2181. Client address: localhost. Client SSL: false.
Mode: standalone
[root@localhost zookeeper]#
停止
代码语言:javascript复制sh /usr/local/zookeeper/apache-zookeeper-3.8.1-bin/bin/zkServer.sh stop
代码语言:javascript复制[root@localhost zookeeper]# sh /usr/local/zookeeper/apache-zookeeper-3.8.1-bin/bin/zkServer.sh stop
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/apache-zookeeper-3.8.1-bin/bin/../conf/zoo.cfg
Stopping zookeeper ... STOPPED
[root@localhost zookeeper]#