ZooKeeper3.4.10集群安装配置-Docker
一. 服务器规划
|
主机 |
IP |
端口 |
备注 |
|
b-mid-24 |
172.16.0.24 |
2181, 2888, 3888 |
2181:对cline端提供服务 3888:选举leader使用 2888:集群内机器通讯使用(Leader监听此端口) |
|
b-mid-25 |
172.16.0.25 |
2181, 2888, 3888 |
|
|
b-mid-26 |
172.16.0.26 |
2181, 2888, 3888 |
二. 集群部署
注:以下步骤需要分别在三台主机操作
1. 配置
1.1 创建宿主机映射目录
mkdir /data/docker/zookeeper-home/{conf,data,logs,datalog} -p
1.2. 创建配置文件(3台zk节点配置文件一样)
vi /data/docker/zookeeper-home/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=/data
dataLogDir=/datalog # 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.24=172.16.0.24:2888:3888
server.25=172.16.0.25:2888:3888
server.26=172.16.0.26:2888:3888
1.3. 配置zookeeper主机id,每个机器id不能相同,需要对应配置文件server后面的值:
echo "24" > /data/docker/zookeeper-home/data/myid
echo "25" > /data/docker/zookeeper-home/data/myid
echo "26" > /data/docker/zookeeper-home/data/myid
1.4 修改 zookeeper-home 目录及子目录所属用户为 yunwei :
chown -R yunwei:yunwei /data/docker/zookeeper-home
2. 启动
2.1 开启端口
firewall-cmd --permanent --add-port=2181/tcp
firewall-cmd --permanent --add-port=2888/tcp
firewall-cmd --permanent --add-port=3888/tcp
firewall-cmd --reload
firewall-cmd --list-all
2.2 启动服务(用 yunwei 账号执行)
拉取镜像:
docker pull zookeeper:3.4.10
启动服务:
docker run -d \
--name zookeeper \
--network host \
--restart=unless-stopped \
-v /data/docker/zookeeper-home/data:/data \
-v /data/docker/zookeeper-home/conf:/conf \
-v /data/docker/zookeeper-home/datalog:/datalog \
-v /data/docker/zookeeper-home/logs:/logs \
-v /etc/localtime:/etc/localtime \
zookeeper:3.4.10
2.3 查看服务器状态
docker exec -it zookeeper bash
zkServer.sh status echo mntr | nc 127.0.0.1 2181 zkCli.sh -server 127.0.0.1:2181
ls /
ZooKeeper3.4.10集群安装配置-Docker的更多相关文章
- (转)ZooKeeper-3.3.4集群安装配置
转载于 千与 的 http://blog.csdn.net/shirdrn/article/details/7183503 ZooKeeper是一个分布式开源框架,提供了协调分布式应用的基本服务,它向 ...
- ZooKeeper-3.3.4集群安装配置(转载)
ZooKeeper是一个分布式开源框架,提供了协调分布式应用的基本服务,它向外部应用暴露一组通用服务——分布式同步(Distributed Synchronization).命名服务(Naming S ...
- ZooKeeper-3.3.4集群安装配置
https://blog.csdn.net/shirdrn/article/details/7183503
- windows安装elasticsearch服务以及elasticsearch5.6.10集群的配置(elasticsearch5.6.10配置跟1.1.1的配置不太相同,有些1.1.1版本下的配置指令在5.6.10中不能使用)
1.下载elasticsearch5.6.10安装包 下载地址为: https://artifacts.elastic.co/downloads/elasticsearch/elasticsearc ...
- 原创:centos7.1下 ZooKeeper 集群安装配置+Python实战范例
centos7.1下 ZooKeeper 集群安装配置+Python实战范例 下载:http://apache.fayea.com/zookeeper/zookeeper-3.4.9/zookeepe ...
- hive集群安装配置
hive 是JAVA写的的一个数据仓库,依赖hadoop.没有安装hadoop的,请参考http://blog.csdn.net/lovemelovemycode/article/details/91 ...
- spark集群安装配置
spark集群安装配置 一. Spark简介 Spark是一个通用的并行计算框架,由UCBerkeley的AMP实验室开发.Spark基于map reduce 算法模式实现的分布式计算,拥有Hadoo ...
- hbase和ZooKeeper集群安装配置
一:ZooKeeper集群安装配置 1:解压zookeeper-3.3.2.tar.gz并重命名为zookeeper. 2:进入~/zookeeper/conf目录: 拷贝zoo_sample.cfg ...
- RabbitMQ集群安装配置+HAproxy+Keepalived高可用
RabbitMQ集群安装配置+HAproxy+Keepalived高可用 转自:https://www.linuxidc.com/Linux/2016-10/136492.htm rabbitmq 集 ...
随机推荐
- 北航内核操作系统-lab0
1.lab0环境介绍. 2.进入实验界面. 3.进入实战测试. 任务要求: 3.1编写斐波那契数列. 3.2编写Makefile脚本. Makefile介绍: make命令执行时,需要一个 Makef ...
- redis 基础1
1.redis是什么? redis是非关系型数据库key-value数据库,开源免费.是当下NoSQL技术之一 2.redis能干吗? (1)内存存储,可以持久化,redis存储在内存中,内存的话是断 ...
- 开源LIMS系统miso LIMS(适用于NGS基因测序)
开源地址 https://github.com/miso-lims/miso-lims github加速可使用:https://kfqbvpat.fast-github.tk/-----https:/ ...
- while和for循环的补充与数据类型的内置方法(int, float, str)
目录 while与for循环的补充 while + else 死循环 while的嵌套 for补充 range函数 break与continue与else for循环的嵌套 数据类型的内置方法 int ...
- ethtools-网卡适配器管理
查看网卡适配器配置信息,并且我们可以通过它修改网卡适配器的双工模式. 1.安装Ethtools [root@localhost ~]# yum -y install ethtools 2.命令语法 语 ...
- Spring大事务到底如何优化?
所谓的大事务就是耗时比较长的事务. Spring有两种方式实现事务,分别是编程式和声明式两种. 不手动开启事务,mysql 默认自动提交事务,一条语句执行完自动提交. 一.大事务产生的原因 操作的数据 ...
- MVC 调试页面路径变成 Views/Controller/Action.cshtml问题
MVC在路由里面已经写好了路径,但是调试时地址栏还是会变成 Views/Controller/Action.cshtml,导致报404错误,找不到路径. 原因可能是你将某一页面设为了起始页,导致每次运 ...
- 基于“均态分布”随机数算法的一次性口令OneTimePassword(原创)
/* 所谓均态分布随机数算法是指:每个数(整数或实数)无序地分布在数轴上,值只出现一次永不重复.体现了香农的一次一密理论. * 均体现在每个数的值是平均概率,即都有出现:态体现在每个数在数轴上的位置是 ...
- docker-compose 搭建 Prometheus+Grafana监控系统
有关监控选型之前有写过一篇文章: 监控系统选型,一文轻松搞定! 监控对象 Linux服务器 Docker Redis MySQL 数据采集 1).prometheus: 采集数据 2).node-ex ...
- 打字练习-编程语言关键字系列-html
以下是小编整理的部分html关键字,专门给有需要的朋友进行打字练习用,通过打字练习的方式,既提高了打字速度,又可以熟悉html关键字~~~ www, url, http, W3C, html, htm ...