文档章节

windows搭建zookeeper伪集群

聆风阁主
 聆风阁主
发布于 03/26 21:43
字数 808
阅读 4
收藏 0

一、规划 zookeeper 伪集群端口

主机IP:127.0.0.1

消息端口:2181;2182;2183
通信端口:2881,3881;2882,3882;2883,3883;

数据目录:

    D:/clustering-space/zookeeper-3.4.12/zookeeper-3.4.12-2181-2881-3881/data
    D:/clustering-space/zookeeper-3.4.12/zookeeper-3.4.12-2182-2882-3882/data
    D:/clustering-space/zookeeper-3.4.12/zookeeper-3.4.12-2183-2883-3883/data

二、解压 zookeeper-3.4.12.tar.gz 到指定目录

三、分别创建 zoo.cfg 文件

D:\clustering-space\zookeeper-3.4.12\zookeeper-3.4.12-2181-2881-3881\conf\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:/clustering-space/zookeeper-3.4.12/zookeeper-3.4.12-2181-2881-3881/data
# 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
#
# 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:2881:3881
server.2=127.0.0.1:2882:3882
server.3=127.0.0.1:2883:3883

D:\clustering-space\zookeeper-3.4.12\zookeeper-3.4.12-2182-2882-3882\conf\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:/clustering-space/zookeeper-3.4.12/zookeeper-3.4.12-2182-2882-3882/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:2881:3881
server.2=127.0.0.1:2882:3882
server.3=127.0.0.1:2883:3883

D:\clustering-space\zookeeper-3.4.12\zookeeper-3.4.12-2183-2883-3883\conf\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:/clustering-space/zookeeper-3.4.12/zookeeper-3.4.12-2183-2883-3883/data
# the port at which the clients will connect
clientPort=2183
# 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:2881:3881
server.2=127.0.0.1:2882:3882
server.3=127.0.0.1:2883:3883

四、分别创建 data 文件夹

D:\clustering-space\zookeeper-3.4.12\zookeeper-3.4.12-2181-2881-3881\data

D:\clustering-space\zookeeper-3.4.12\zookeeper-3.4.12-2182-2882-3882\data

D:\clustering-space\zookeeper-3.4.12\zookeeper-3.4.12-2183-2883-3883\data

五、分别在 data 文件夹下创建 myid 文件

D:\clustering-space\zookeeper-3.4.12\zookeeper-3.4.12-2181-2881-3881\data\myid

1

D:\clustering-space\zookeeper-3.4.12\zookeeper-3.4.12-2182-2882-3882\data\myid

2

D:\clustering-space\zookeeper-3.4.12\zookeeper-3.4.12-2183-2883-3883\data\myid

3

六、启动脚本

zookeeper1.bat

title zookeeper-3.4.12-2181-2881-3881
D:\clustering-space\zookeeper-3.4.12\zookeeper-3.4.12-2181-2881-3881\bin\zkServer.cmd

zookeeper2.bat

title zookeeper-3.4.12-2182-2882-3882
D:\clustering-space\zookeeper-3.4.12\zookeeper-3.4.12-2182-2882-3882\bin\zkServer.cmd

zookeeper3.bat

title zookeeper-3.4.12-2183-2883-3883
D:\clustering-space\zookeeper-3.4.12\zookeeper-3.4.12-2183-2883-3883\bin\zkServer.cmd

zookeeper-cluster.bat

@echo off
    color 0A

@echo on
    start zookeeper1.bat
    start zookeeper2.bat
    start zookeeper3.bat

@echo off
    echo.
    pause

@echo on

© 著作权归作者所有

聆风阁主
粉丝 0
博文 19
码字总数 16521
作品 0
福州
私信 提问
ZooKeeper的伪分布式集群搭建以及真分布式集群搭建

zk集群的一些基本概念 zookeeper集群搭建: zk集群,主从节点,心跳机制(选举模式) 配置数据文件 myid 1/2/3 对应 server.1/2/3 通过 zkCli.sh -server [ip]:[port] 命令检测集群是否配置成...

ZeroOne01
2018/04/24
0
0
Java之品优购部署_day01(3)

2.2 搭建 Zookeeper 集群 2.2.1 搭建要求 真实的集群是需要部署在不同的服务器上的,但是在我们测试时同时启动十几个虚拟机 内存会吃不消,所以我们通常会搭建伪集群,也就是把所有的服务都搭...

我是小谷粒
2018/07/06
0
0
zookeeper集群搭建设置

zookeeper 官网:http://zookeeper.apache.org/ 现在最新版本是 3.4.6 ,但是这个版本我没有运行起来,可能是那配置出现问题了,现在我用的是3.4.5 http://apache.fayea.com/apache-mirror/z...

dev_zh
2014/08/01
7.8K
2
Zookeeper完全分布式集群的搭建

Zookeeper完全分布式集群的搭建 一、集群模式 1、单机模式 在zoo.cfg中只配置一个server.id就是单机模式了。 这种模式下,如果当前主机宕机,那么所有依赖于当前zookeeper服务工作的其他服务...

星汉
2018/04/27
5K
0
ZooKeeper伪分布式集群安装

获取ZooKeeper安装包 下载地址:http://apache.dataguru.cn/zookeeper 选择一个稳定版本进行下载,我这里下载的是zookeeper-3.4.6版本。 ZooKeeper伪分布式集群安装 伪分布式集群:在一台Ser...

蔡佳娃
2015/03/08
2.4K
0

没有更多内容

加载失败,请刷新页面

加载更多

作为一个(IT)程序员!聊天没有话题?试试这十二种技巧

首先呢?我是一名程序员,经常性和同事没话题。 因为每天都会有自己的任务要做,程序员对于其他行业来说;是相对来说比较忙的。你会经常看到程序员在发呆、调试密密麻麻代码、红色报错发呆;...

小英子wep
今天
14
0
【SpringBoot】产生背景及简介

一、SpringBoot介绍 Spring Boot 是由 Pivotal 团队提供的全新框架,其设计目的是用来简化新 Spring 应用的初始搭建以及开发过程,该框架使用了特定的方式来进行配置,从而使开发人员不再需要...

zw965
今天
5
0
简述并发编程分为三个核心问题:分工、同步、互斥。

总的来说,并发编程可以总结为三个核心问题:分工、同步、互斥。 所谓分工指的是如何高效地拆解任务并分配给线程,而同步指的是线程之间如何协作,互斥则是保证同一时刻只允许一个线程访问共...

dust8080
今天
6
0
OSChina 周四乱弹 —— 当你简历注水但还是找到了工作

Osc乱弹歌单(2019)请戳(这里) 【今日歌曲】 @花间小酌 :#今日歌曲推荐# 分享成龙的单曲《男儿当自强》。 《男儿当自强》- 成龙 手机党少年们想听歌,请使劲儿戳(这里) @hxg2016 :刚在...

小小编辑
今天
3.3K
22
靠写代码赚钱的一些门路

作者 @mezod 译者 @josephchang10 如今,通过自己的代码去赚钱变得越来越简单,不过对很多人来说依然还是很难,因为他们不知道有哪些门路。 今天给大家分享一个精彩的 GitHub 库,这个库整理...

高级农民工
昨天
10
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部