下载稳定版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. Linux Debian安装教程

    Debian 是一个免费的开源操作系统,是最古老的 Linux 发行版之一,于 1993 年由 Ian Murdock 创建.它采用了自由软件协议,并且由志愿者社区维护和支持.Debian 的目标是创 ...

  2. 为什么https要使用证书

    为什么https要使用证书 什么是httpshttps不是一种新的协议,只是http的通信接口部分使用了ssl和tsl协议替代,加入了加密.证书.完整性保护的功能. 加密:共享密钥加密加密和解密公用一 ...

  3. LLDB辅助工具Chisel入门初探

    LLDB辅助工具Chisel入门初探 基础适用方法 使用场景 iOS开发的调试过程中,LLDB的使用难度较大等各种原因,所以更多的时间开发者们仅仅用于po.expr输出,实际上Facebook(现在该 ...

  4. Win10任务栏图标居中

    win+q键搜索并打开字符映射表 点击第五行的空白字符,然后先后点击下方的选择以及复制 在桌面新建一个文件夹,然后重命名,将刚才复制的空白字符粘贴进去,如图,这样我们就拥有了一个空白名称的文件夹 在任 ...

  5. Java多线程生成波场靓号

    ​  玩区块链,手上没靓号怎么行.用网上的靓号生成器有一定的风险性,思来想去决定自己写一个.首先需要导入波场官方编辑 <!-- 引用本地Maven仓库--> <dependency& ...

  6. OpenSSL&&libcurl库的交叉编译

    一.编译前环境准备 使用的内核:4.15.0-118-generic(命令:uname -r可以查看) 交叉编译器:aarch64-linux-gnu-gcc curl源码:curl-7.72.0.t ...

  7. hive第一课:# hive-3.1.2分布式搭建文档

    hive-3.1.2分布式搭建文档 谷歌浏览器下载网址:Google Chrome – Download the fast, secure browser from Google 华为云镜像站:htt ...

  8. 理解shell

    理解shell shell不单单是CLI,而是一种复杂的交互式程序. 1. shell的类型 当你登录系统时,系统启动什么样的shell程序取决于你的个人用户配置.在/etc/passwd文件中,用户 ...

  9. uniapp+thinkphp5实现微信扫码支付(APP支付)

    前言 统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返回预支付订单号的接口,目前微信支付所有场景均使用这一接口.下面介绍的是其中APP的支付的配置与实现流程 配置 1.首先登录 ...

  10. TI AM62x工业核心板规格书(单/双/四核ARM Cortex-A53 + 单核ARM Cortex-M4F,主频1.4GHz)

    1 核心板简介 创龙科技SOM-TL62x是一款基于TI Sitara系列AM62x单/双/四核ARM Cortex-A53 + 单核ARM Cortex-M4F异构多核处理器设计的高性能低功耗工业级 ...