apache-zookeeper-3.8.1单机安装

zookeeper单机版安装

下载

复制代码
https://zookeeper.apache.org/releases.html

选择Apache ZooKeeper 3.8.1(asc, sha512)

创建目录

复制代码
mkdir -p /usr/local/zookeeper/apache-zookeeper-3.8.1-bin/data

上传服务器并解压

shell 复制代码
tar -zxvf apache-zookeeper-3.8.1-bin.tar.gz -C /usr/local/zookeeper

创建配置文件

shell 复制代码
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

修改配置文件

shell 复制代码
dataDir=/usr/local/zookeeper/apache-zookeeper-3.8.1-bin/data

启动

shell 复制代码
sh /usr/local/zookeeper/apache-zookeeper-3.8.1-bin/bin/zkServer.sh start
shell 复制代码
[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]#

查看状态

shell 复制代码
sh /usr/local/zookeeper/apache-zookeeper-3.8.1-bin/bin/zkServer.sh status
shell 复制代码
[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]#

停止

shell 复制代码
sh /usr/local/zookeeper/apache-zookeeper-3.8.1-bin/bin/zkServer.sh stop
shell 复制代码
[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]#
相关推荐
东阳马生架构1 天前
zk基础—4.zk实现分布式功能
zookeeper
东阳马生架构1 天前
zk基础—3.集群与核心参数一
zookeeper
java技术小馆1 天前
Zookeeper中的Zxid是如何设计的
java·分布式·zookeeper·云原生
东阳马生架构2 天前
zk基础—3.集群与核心参数
zookeeper
纪元A梦2 天前
分布式锁算法——基于ZooKeeper的分布式锁全面解析
java·分布式·算法·zookeeper
拾荒的小海螺2 天前
JAVA:使用 Curator 进行 ZooKeeper 操作的技术指南
java·zookeeper·java-zookeeper
东阳马生架构3 天前
zk基础—1.一致性原理和算法二
zookeeper·分布式原理
东阳马生架构3 天前
zk基础—2.架构原理和使用场景
zookeeper