【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 ...
随机推荐
- itest(爱测试) 开源接口测试,敏捷测试管理平台10.2.3发布
一:itest work 简介 itest work 开源敏捷测试管理,包含极简的任务管理,测试管理,缺陷管理,测试环境管理,接口测试,接口Mock,还有压测 ,又有丰富的统计分析,8合1工作站.可按 ...
- macbookrpro使用体验
前言 之前用的电脑是拯救者y7000 2020,用了四五年,年前就有换电脑的打算.计划就是买一个苹果电脑,在查看了挺多电脑,多方面对比后,最终还是买了Macbook pro. 我买的笔记本的配置如下: ...
- .NET5 ASP.NET Core 使用 EF Core MS SQL SERVER DB First
.NET5 ASP.NET Core 使用 EF Core MS SQL SERVER DB First 开发工具:VS2019 1.修改appsettings.json,增加一项. "Co ...
- 两个Excel表格核对 excel表格中# DIV/0 核对两个表格的差异,合并运算VS高级筛选
两个Excel表格核对 excel表格中# DIV/0 核对两个表格的差异,合并运算VS高级筛选 1.两列顺序一样的数据核对 方法1:加一个辅助列,=B2=C2 结果为FALSE的就是不相同的 方 ...
- excel计算日期天数和表格冻结首行
excel计算日期天数和表格冻结首行 1.在单元格E35中输入公式DATEDIF(A35.B35."MD")MD表起始日期.结束日期天数差."Y" 时间段中的整 ...
- nginx轮询负载均衡演示demo
1.nginx /conf/nginx.conf配置文件 #user nobody; worker_processes auto; #error_log logs/error.log; #error_ ...
- 没有 Git,如何下载 Gitee 代码?
目录 没有 Git,如何下载 Gitee 代码? 注册 Gitee 账号 下载代码压缩包 没有 Git,如何下载 Gitee 代码? 鉴于看我博客的人很多都是大学本科生.非 CS 专业,大部分人都不会 ...
- 基于RK3588的8K视频解码显示案例分享!引领超高清工业视频时代
8K.4K.2K显示对比 2K分辨率:也称为全高清(FULL HD),它具有1920 x 1080像素的分辨率.这是目前大多数消费者电视和电脑显示器的标准分辨率,可以提供良好的图像质量. 4K分辨率: ...
- throws和try catch的区别
1.throws是表明方法抛出异常,需要调用者来处理,如果不想处理就一直向外抛,最后会有jvm来处理: 2.try catch 是自己来捕获别人抛出的异常,然后在catch里面去处理: 一般情况下,第 ...
- 【Error】mysql的error.log中ranges: 268 max_threads: 4 split: 268 depth: 2是什么意思?
2021-12-08T09:36:39.612332+08:00 44213799 [Note] [MY-011825] [InnoDB] Parallel scan: 4 2021-12-08T09 ...