在三台Centos或Windows中部署三台Zookeeper集群配置
一、安装包
1、下载最新版(3.4.13):https://archive.apache.org/dist/zookeeper/ 下载https://archive.apache.org/dist/zookeeper/zookeeper-3.4.13/zookeeper-3.4.13.tar.gz解压开即可。本文中解压到/opt目录下。
二、环境
1、三台服务器IP分别为:192.168.1.104、192.168.1.105、192.168.1.106
2、三台的Zookeeper配置文件路径都是:/opt/zookeeper/zookeeper-3.4.13/conf/zoo.cfg
三、配置集群:
1、服务器192.168.1.104中:
(1)修改/opt/zookeeper/zookeeper-3.4.13/conf/zoo.cfg文件内容如下:
# The number of milliseconds of each tick
tickTime=
# The number of ticks that the initial
# synchronization phase can take
initLimit=
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/opt/zookeeper/zkdata/data
dataLogDir=/opt/zookeeper/zkdata/log
# the port at which the clients will connect
clientPort=
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=
#
# 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=
# Purge task interval in hours
# Set to "" to disable auto purge feature
#autopurge.purgeInterval= server.=0.0.0.0::
server.=192.168.6.105::
server.=192.168.6.106::
(2)创建目录并配置myid。
I、创建目录:/opt/zookeeper/zkdata/data
II、创建文件:/opt/zookeeper/zkdata/data/myid ,内容为"104" ,或者使用命令快速生成:
echo 104>/opt/zookeeper/zkdata/data/myid
2、服务器192.168.1.105中:
(1)修改/opt/zookeeper/zookeeper-3.4.13/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=/opt/zookeeper/zkdata/data
dataLogDir=/opt/zookeeper/zkdata/log
# 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.104=192.168.6.104:2888:3888
server.105=0.0.0.0:2888:3888
server.106=192.168.6.106:2888:3888
(2)创建目录并配置myid。
I、创建目录:/opt/zookeeper/zkdata/data
II、创建文件:/opt/zookeeper/zkdata/data/myid ,内容为"105" ,或者使用命令快速生成:
echo 105>/opt/zookeeper/zkdata/data/myid
3、服务器192.168.1.106中:
(1)修改/opt/zookeeper/zookeeper-3.4.13/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=/opt/zookeeper/zkdata/data
dataLogDir=/opt/zookeeper/zkdata/log
# 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.104=192.168.6.104:2888:3888
server.105=192.168.6.105:2888:3888
server.106=0.0.0.0:2888:3888
(2)创建目录并配置myid。
I、创建目录:/opt/zookeeper/zkdata/data
II、创建文件:/opt/zookeeper/zkdata/data/myid ,内容为"106" ,或者使用命令快速生成:
echo 106>/opt/zookeeper/zkdata/data/myid
四、三台机器中,都为防火墙中添加2181、2888、3888端口入站。
添加端口:
firewall-cmd --zone=public --add-port=/tcp --permanent
firewall-cmd --zone=public --add-port=/tcp --permanent
firewall-cmd --zone=public --add-port=/tcp --permanent
重新载入:
firewall-cmd --reload
五、启动Zookeeper:三台机器中依次运行
/opt/zookeeper/zookeeper-3.4./bin/zkServer.sh start /opt/zookeeper/zookeeper-3.4./conf/zoo.cfg
在三台Centos或Windows中部署三台Zookeeper集群配置的更多相关文章
- Centos或Windows中部署Zookeeper集群及其简单用法
一.简介 ZooKeeper是一个分布式的,开放源码的分布式应用程序协调服务,是Google的Chubby一个开源的实现,是Hadoop和Hbase的重要组件.它是一个为分布式应用提供一致性服务的软件 ...
- 分布式架构中一致性解决方案——Zookeeper集群搭建
当我们的项目在不知不觉中做大了之后,各种问题就出来了,真jb头疼,比如性能,业务系统的并行计算的一致性协调问题,比如分布式架构的事务问题, 我们需要多台机器共同commit事务,经典的案例当然是银行转 ...
- China Azure中部署Kubernetes(K8S)集群
目前China Azure还不支持容器服务(ACS),使用名称"az acs create --orchestrator-type Kubernetes -g zymtest -n kube ...
- 10分钟学会windows中iis搭建服务器集群实现负载均衡和nginx代理转发
前言 我们之前聊过 10分钟搭建服务器集群--Windows7系统中nginx与IIS服务器搭建集群实现负载均衡:https://www.cnblogs.com/xiongze520/p/103087 ...
- windows server 2012R2 故障转移集群配置
配置说明: AD:10.10.1.10/24 Node-2:10.10.1.20/24 Node-3:10.10.1.30/24 zhangsan-PC:10.10.1.50/24 VIP1:10 ...
- Centos6下zookeeper集群部署记录
ZooKeeper是一个开放源码的分布式应用程序协调服务,它包含一个简单的原语集,分布式应用程序可以基于它实现同步服务,配置维护和命名服务等. Zookeeper设计目的 最终一致性:client不论 ...
- windows下zookeeper集群安装
windows下zookeeper单机版安装,见:https://www.cnblogs.com/lbky/p/9867899.html 一:zookeeper节点为什么是奇数个? 单机模式的zk进程 ...
- K8S部署Redis Cluster集群
kubernetes部署单节点redis: https://www.cnblogs.com/zisefeizhu/p/14282299.html Redis 介绍 • Redis代表REmote DI ...
- K8S部署Redis Cluster集群(三主三从模式) - 部署笔记
一.Redis 介绍 Redis代表REmote DIctionary Server是一种开源的内存中数据存储,通常用作数据库,缓存或消息代理.它可以存储和操作高级数据类型,例如列表,地图,集合和排序 ...
随机推荐
- day8数据类型补充,集合,深浅拷贝
思维导图: 集合的补充:下面的思维导图有一个点搞错了,在这里纠正一下,没有合集,是反交集,^这个是反差集的意思 . 交集&,反交集^,差集-,并集|,然后就是子集和超集 数据类型补充: ''' ...
- scrapy 日志一般配置
- scrapy 第一个案例(爬取腾讯招聘职位信息)
import scrapy import json class TzcSpider(scrapy.Spider): # spider的名字,唯一 name = 'tzc' # 起始地址 start_u ...
- 爬虫之xpath用法
导包用: from lxml import etree
- linux 学习笔记 管道 pipe ls cp mv
如ls |less -MN 含义把ls结果输出到less [ls] ==管道== [more] ls命令 ls -a 展示隐藏的文件 <隐藏文件一般以. 开始> ls -t 以时间戳排 ...
- html 的实践
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Codeforces.468C.Hack it!(构造)
题目链接 \(dls\)出的比赛诶...这么妙. \(Description\) 令\(f(x)\)表示整数\(x\)在十进制下各个数位的数字之和.给定\(a\),求两个整数\(l,r\),使得\(\ ...
- BZOJ.1312.[Neerc2006]Hard Life(分数规划 最大权闭合子图)
BZOJ 最大密度子图. 二分答案\(x\),转为求是否存在方案满足:\(边数-x*点数\geq 0\). 选一条边就必须选两个点,所以可以转成最大权闭合子图.边有\(1\)的正权,点有\(x\)的负 ...
- go学习资源
教程 GO 命令教程 Go示例学 Book <Go Web 编程> <Go入门指南> <深入解析Go> 应该是go的进阶,等熟悉go之后再来看 <Go语言圣经 ...
- node中的cluster模块开启进程,进程共享数据
说明:共享数据 var collection = [41, 41, 41, 41] master.js console.log('###---start---###') var cluster = r ...