zookeeper安装

一、下载安装:

1、环境准备:

ZooKeeper服务器是用Java创建的,它运行在JVM之上。需要安装JDK 7或更高版本。

2、下载:

官网:Apache ZooKeeper

 

 3、安装:

 

创建安装目录

mkdir /opt/zookeeper

将文件上传到服务器

进入安装目录

cd /opt/zookeeper

解压压缩包

tar -zxvf apache-zookeeper-3.5.6-bin.tar.gz

复制并重命名解压文件

cp -r apache-zookeeper-3.5.6-bin zookeeper2181

 

4、配置启动

 

进入到conf目录拷贝一个zoo_sample.cfg并完成配置

 cd conf

#拷贝
cp  zoo_sample.cfg  zoo.cfg
 
修改zoo.cfg
vim zoo.cfg
源文件:
复制代码
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
复制代码

进入编辑模式

a/i 

修改数据存放目录:

dataDir=/opt/zookeeper/zookeeper2181/zkdata

退出编辑模式:

esc键

保存退出:

:wq 回车

5.启动ZooKeeper

进入bin目录:

cd /opt/zookeeper/zookeeper2181/bin

 

 

启动:

./zkServer.sh start

 

 

查看状态:

./zkServer.sh status

 

 

posted @   hehehenhen  阅读(14)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· 上周热点回顾(2.17-2.23)
· 如何使用 Uni-app 实现视频聊天(源码,支持安卓、iOS)
· spring官宣接入deepseek,真的太香了~
点击右上角即可分享
微信分享提示