Zookeeper安装配置
程序员文章站
2022-05-07 15:49:31
...
安装和配置
1、下载地址:https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/
注意下载的是*tar.gz文件,虽然是linux的安装包,但是没关系,在windows上面也是可用的
2、解压(随意选择)
3、修改解压之后的conf文件夹下面的zoo_sample.cfg文件
主要是修改文件以后应用中Zookeeper的数据存储地址和日志存储地址dataDir和dataLogDir
# The number of milliseconds of each tick
tickTime=2000 #这个时间是作为Zookeeper服务器之间或者客户端与服务器之间维持心跳的时间间隔,也就是每个tickTime时间就会发送和一个心跳
# 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=D:\\zookeeper\\data #Zookeeper保存数据的目录,默认情况是将日志文件也是保存在这里的
dataLogDir=D:\\zookeeper\\log #Zookeeper保存日志文件的目录
# the port at which the clients will connect
clientPort=2181 #客户端连接Zookeeper服务器的端口,Zookeeper会监听这个端口,接受客户端的访问请求
# 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
至于文件中有几个变量是非常重要的已经把注释给出来了,就不单独拉出来了
4、到目前位置已经配置好了,接下来就是启动了
进入到安装目录下面的bin文件夹下面
5、启动Zookeeper的服务(运行zkServer.cmd文件即可)
6、查看是否已经启动(运行zkCli.cmd到本地的对应端口j即可)
上面显示已经完全启动了
上一篇: mysql中的锁
下一篇: Oracle的decode函数