(五)zookeeper windows单机模式和伪集群模式

本文详细介绍了Zookeeper在Windows上的单机模式和伪集群模式安装步骤。内容包括下载Zookeeper稳定版,配置zoo.cfg,启动服务,以及伪集群模式下配置不同端口和启动多个实例的方法。通过这样的配置,可以在本地模拟Zookeeper集群环境。
摘要由CSDN通过智能技术生成


        首先在官网上下载zookeeper稳定版本,下载地址:http://mirrors.cnnic.cn/apache/zookeeper/zookeeper-3.4.6/ 下载zookeeper-3.4.6.tar.gz,我下载的是3.4.6,不算太新也不算太旧。

        zookeeper是一个分布式应用所设计的分布的、开源的协调服务,它主要是用来解决分布式应用中经常遇到的一些数据管理问题,简化分布式应用,协调及其管理的难度,提高性能的分布式服务。

        zookeeper本身是可以以Standalone模式安装运行,不过它在分布式Zookeeper集群中(一个Leader,多个Follower),基于选举算法来保证        zookeeper集群的稳定性和可用性,从而保证了分布式的可靠性。


一、单机模式安装


        1、解压到自己任意磁盘下,我的位置是D:\zookeeper-3.4.6


        2、复制zoo_sample.cfg 重命名为zoo.cfg。

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=D:\\data\\zookeeper
# log config
dataLogDir=D:\\log\\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
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值