下载稳定版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平台伪集群搭建的更多相关文章

  1. 【ZooKeeper】单机伪集群搭建(适用于mac)

    1.配置 .zookeeper下载地址:http://apache.mirrors.lucidnetworks.net/zookeeper/ 可以选择需要的版本,我下载的是zookeeper-3.4. ...

  2. 分享知识-快乐自己:zookeeper 伪集群搭建

    1):单一 zookeeper  搭建步骤 2):zookeeper 伪集群搭建 1):新建一个集群目录 [root@zoodubbo opt]# mkdir zookeeper_cluster 2) ...

  3. 【ZooKeeper系列】1.ZooKeeper单机版、伪集群和集群环境搭建

    ZooKeeper安装模式主要有3种: 单机版(Standalone模式)模式:仅有一个ZooKeeper服务 伪集群模式:单机多个ZooKeeper服务 集群模式:多机多ZooKeeper服务 1 ...

  4. zookeeper伪集群搭建

    zookeeper伪集群搭建 1. 下载zookeeper: https://zookeeper.apache.org/ 2. 解压: tar -zxvf zookeeper-3.4.14.tar.g ...

  5. linux环境下redis安装(redis伪集群搭建)

    redis在linux环境下搭建 1.创建目录 [root@192 local]# mkdir /usr/local/redis 2.下载redis,并解压 [root@192 local]# wge ...

  6. [dubbo实战] dubbo+zookeeper伪集群搭建

    zookeeper作为注册中心,服务器和客户端都要访问,如果有大量的并发,肯定会有等待.所以可以通过zookeeper集群解决. 一.为什么需要zookeeper呢? 大部分分布式应用需要一个主控.协 ...

  7. zookeeper windows伪集群搭建

    1.下载zookeeper http://mirror.bit.edu.cn/apache/zookeeper/ 解压后,目录重命名为zookeeper1,进入 conf目录,把zoo_sample. ...

  8. [dubbo实战] dubbo+zookeeper伪集群搭建 (转)

    zookeeper作为注册中心,服务器和客户端都要访问,如果有大量的并发,肯定会有等待.所以可以通过zookeeper集群解决. 一.为什么需要zookeeper呢? 大部分分布式应用需要一 个主控. ...

  9. 四、Zookeeper伪集群搭建

    伪集群模式 Zookeeper不但可以在单机上运行单机模式 Zookeeper,而且可以在单机模拟集群模式 Zookeeper的运 行,也就是将不同实例运行在同一台机器,用端口进行区分,伪集群模式为我 ...

  10. windows下zookeeper伪集群搭建

    下载 http://www.apache.org/dyn/closer.cgi/zookeeper/ 解压 D:\Java\soft\zookeeper-3.4.6 伪集群 1.在 \zookeepe ...

随机推荐

  1. 通过 Canal 将 MySQL 数据实时同步到 Easysearch

    Canal 是阿里巴巴集团提供的一个开源产品,能够通过解析数据库的增量日志,提供增量数据的订阅和消费功能.使用 Canal 模拟成 MySQL 的 Slave,实时接收 MySQL 的增量数据 bin ...

  2. 修改 WIN10 WIN11 操作系统启动菜单名称

    修改 WIN10 WIN11 操作系统启动菜单名称 一块硬盘装双系统后,自动更新的启动菜单名称可能无法区分WIN10.WIN11,需要通过"卷2"."卷3"字样 ...

  3. 像 Google SRE 一样 OnCall

    在 Google SRE 的著作<Google运维解密>(原作名:Site Reliability Engineering: How Google Runs Production Syst ...

  4. kettle从入门到精通 第六十九课 ETL之kettle kettle cdc mysql,轻松实现实时增量同步

    1.之前kettle cdc mysql的时候使用的方案是canal+kafka+kettle,今天我们一起学习下使用kettle的插件Debezium直接cdc mysql. 注:CDC (Chan ...

  5. 父类和子类对象的获取值的方式验证,通过父类属性的方式获取不到值,需要使用get方法

    父类和子类对象的获取值的方式验证,通过父类属性的方式获取不到值,需要使用get方法 静态属性通过类.属性的方式获取,对象获取使用get方法获取 package com.example.core.myd ...

  6. Excel Wps 透视表去重计数方法

    Excel Wps 透视表去重计数方法 在处理表格,遇到处理根据某个列去重后统计数量,而不是仅仅统计数量.在网上查找资料,不确定EXCEL或者WPS某个版本可以支持该功能的实现. 折中的方案,分两步来 ...

  7. apollo配置中心从数据库中查询所有的配置及项目

    apollo配置中心从数据库中查询所有的配置及项目 需求背景:如果需要从Apollo查询某个配置项做批量的更新替换,如果一个一个找不合适且容易遗漏,需要从底层数据库表中模糊查询来实现. 1.查看apo ...

  8. email邮件(带附件,模拟文件上传,跨服务器)发送核心代码 Couldn't connect to host, port: smtp.163.com, 25; timeout -1;

    邮件(带附件,模拟文件上传,跨服务器)发送核心代码1.测试邮件发送附件接口 /** * 测试邮件发送附件 * @param multipartFile * @return */ @RequestMap ...

  9. 58同城的登录(RSA算法)

    Tips:当你看到这个提示的时候,说明当前的文章是由原emlog博客系统搬迁至此的,文章发布时间已过于久远,编排和内容不一定完整,还请谅解` 58同城的登录(RSA算法) 日期:2016-11-23 ...

  10. 端口占用,无法通过netstat找到进程,占用的端口又不能修改,该怎么办?

    最近遇到一个奇葩的问题,项目跑的好好的,没有安装其它特殊软件,突然服务器启动报错,日志如下,显然是服务器的8080端口占用了. Caused by: java.net.BindException: A ...