【Zookeeper】Win平台伪集群搭建
下载稳定版Zookeeper
https://downloads.apache.org/zookeeper/stable/
GZ包:
apache-zookeeper-3.6.3-bin.tar.gz
解压一份到本地磁盘中
1、将conf目录下的zoo_sample.cfg复制一份改名为zoo.cfg
2、更改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:\\develop\\ZookeeperCluster\\apache-zookeeper-3.5.9-2\\data
# the port at which the clients will connect
clientPort=2182
# 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
server.1 = 127.0.0.1:2184:3887
server.2 = 127.0.0.1:2185:3888
server.3 = 127.0.0.1:2186:3889
由于是在一台机器上部署三个Zookeeper实例,必然占用系统很多端口资源
每个实例的客户端口不能一致,服务端口和选举端口也不能一致
1个实例占用 3个端口 (客户端口 + 服务端口 + 选举端口)
然后把Zookeeper的目录复制2份出来,分别重命名以区分
apache-zookeeper-3.5.9-1
apache-zookeeper-3.5.9-2
apache-zookeeper-3.5.9-3
写入服务ID标识
ECHO 1 > %CD%\ZookeeperCluster\apache-zookeeper-3.5.9-1\data\myid
ECHO 2 > %CD%\ZookeeperCluster\apache-zookeeper-3.5.9-2\data\myid
ECHO 3 > %CD%\ZookeeperCluster\apache-zookeeper-3.5.9-3\data\myid
更改 apache-zookeeper-3.5.9-2 的zoo.cfg 客户端端口为 2182
更改 apache-zookeeper-3.5.9-3 的zoo.cfg 客户端端口为 2183
clientPort=2181
clientPort=2182
clientPort=2183
为了方便启动,可以编写集群启动脚本:
@ECHO OFF
start %CD%\apache-zookeeper-3.5.9-1\bin\zkServer.cmd
start %CD%\apache-zookeeper-3.5.9-2\bin\zkServer.cmd
start %CD%\apache-zookeeper-3.5.9-3\bin\zkServer.cmd
【Zookeeper】Win平台伪集群搭建的更多相关文章
- 【ZooKeeper】单机伪集群搭建(适用于mac)
1.配置 .zookeeper下载地址:http://apache.mirrors.lucidnetworks.net/zookeeper/ 可以选择需要的版本,我下载的是zookeeper-3.4. ...
- 分享知识-快乐自己:zookeeper 伪集群搭建
1):单一 zookeeper 搭建步骤 2):zookeeper 伪集群搭建 1):新建一个集群目录 [root@zoodubbo opt]# mkdir zookeeper_cluster 2) ...
- 【ZooKeeper系列】1.ZooKeeper单机版、伪集群和集群环境搭建
ZooKeeper安装模式主要有3种: 单机版(Standalone模式)模式:仅有一个ZooKeeper服务 伪集群模式:单机多个ZooKeeper服务 集群模式:多机多ZooKeeper服务 1 ...
- zookeeper伪集群搭建
zookeeper伪集群搭建 1. 下载zookeeper: https://zookeeper.apache.org/ 2. 解压: tar -zxvf zookeeper-3.4.14.tar.g ...
- linux环境下redis安装(redis伪集群搭建)
redis在linux环境下搭建 1.创建目录 [root@192 local]# mkdir /usr/local/redis 2.下载redis,并解压 [root@192 local]# wge ...
- [dubbo实战] dubbo+zookeeper伪集群搭建
zookeeper作为注册中心,服务器和客户端都要访问,如果有大量的并发,肯定会有等待.所以可以通过zookeeper集群解决. 一.为什么需要zookeeper呢? 大部分分布式应用需要一个主控.协 ...
- zookeeper windows伪集群搭建
1.下载zookeeper http://mirror.bit.edu.cn/apache/zookeeper/ 解压后,目录重命名为zookeeper1,进入 conf目录,把zoo_sample. ...
- [dubbo实战] dubbo+zookeeper伪集群搭建 (转)
zookeeper作为注册中心,服务器和客户端都要访问,如果有大量的并发,肯定会有等待.所以可以通过zookeeper集群解决. 一.为什么需要zookeeper呢? 大部分分布式应用需要一 个主控. ...
- 四、Zookeeper伪集群搭建
伪集群模式 Zookeeper不但可以在单机上运行单机模式 Zookeeper,而且可以在单机模拟集群模式 Zookeeper的运 行,也就是将不同实例运行在同一台机器,用端口进行区分,伪集群模式为我 ...
- windows下zookeeper伪集群搭建
下载 http://www.apache.org/dyn/closer.cgi/zookeeper/ 解压 D:\Java\soft\zookeeper-3.4.6 伪集群 1.在 \zookeepe ...
随机推荐
- Nodejs中间件 中间件分类和自定义中间件
中间件 中间件理解 中间件可以理解为业务流程的中间处理环节.如生活中吃一般炒青菜,大约分为如下几步骤 express中当一个请求到达的服务器之后,可以在给客户响应之前连续调用多个中间件,来对本次请求和 ...
- WIn32 C++ 消息处理函数 问题
这个消息处理这个 Winproc 这个 接收到网络信息 在自己的函数用完后可以选择向系统路由传递这个网络消息接收到的数据原型 你处理完,系统也处理,不想让系统处理可以不将接受到的那几个变量啊数据啊,就 ...
- 找不到 .NETFramework,Version=v5.0 的引用程序集。要解决此问题,请为此框架版本安装开发人员工具包(SDK/目标包)或者重新定向应用程序。
找不到 .NETFramework,Version=v5.0 的引用程序集.要解决此问题,请为此框架版本安装开发人员工具包(SDK/目标包)或者重新定向应用程序. visual studio 2019 ...
- LNMP单机架构
黄金架构LNMP LNMP是网站架构初期最合适的单体架构.因为初创型技术团队对于技术的选型,需要考虑如下因素 在创业初期,研发资源有限,研发人力有限,技术储备有限,需要选择一个易维护.简单的技术架构: ...
- undefined,null 和 undeclared 有什么区别?
a.null表示"没有对象",即该处不应该有值,转为数值时为0.典型用法是:作为函数的参数,表示该函数的参数不是对象.作 为对象原型链的终点. b.undefined表 ...
- 实战分析Java的异步编程,并通过CompletableFuture进行高效调优
一.写在开头 在我们一开始讲多线程的时候,提到过异步与同步的概念,这里面我们再回顾一下: 同步:调用方在调用某个方法后,等待被调用方返回结果:调用方在取得被调用方的返回值后,再继续运行.调用方顺序执行 ...
- Feign的客户端注解@EnableFeignClients,解决No qualifying bean of type 'xx.xx.类' available注入报错
//如果使用Feign的客户端,请放开下列注释@EnableFeignClientsNo qualifying bean of type 'xx.xx.类' available //需要添加扫描的路径 ...
- 网络诊断工具iPerf的使用
iPerf 是一个网络性能测试工具,用于测量最大 TCP 和 UDP 带宽性能.它支持多种平台,包括 Windows.Linux.macOS 等.以下是 iPerf 的基本使用方法: 安装 iPerf ...
- Centos编译加载toa模块
什么是toa模块 toa模块是为了让后端的realserver能够看到真实的clientip而不是lvs的dip 安装步骤 安装依赖包 yum -y install kernel-devel gcc ...
- 面试官:transient关键字修饰的变量当真不可序列化?我:烦请先生教我!
一.写在开头 在这篇文章中记录一下之前自己面试时学到的东西,是关于transient关键字的,当时面试官问我IO的相关问题,基本上全答出来了,关于如何不序列化对象中某个字段时,我果断的选择了stati ...