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 集 ...
随机推荐
- VsCode[Git] | 配置Gitee和Github | 不使用全局用户名和邮箱
(VsCode[Git] | 配置Gitee和Github | 不使用全局用户名和邮箱 | 2021-04-11) 目录 一 .安装Git / VsCode配置Git / Win10系统 二.Git配 ...
- 被迫开始学习Typescript —— vue3的 props 与 interface
vue3 的 props Vue3 的 props ,分为 composition API 的方式以及 option API 的方式,可以实现运行时判断类型,验证属性值是否符合要求,以及提供默认值等功 ...
- arts-week12
Algorithm 69. Sqrt(x) - LeetCode Review Cloudflare goes InterPlanetary - Introducing Cloudflare's IP ...
- linux篇-linux命令大全
Linux常用命令大全(非常全!!!) 最近都在和Linux打交道,感觉还不错.我觉得Linux相比windows比较麻烦的就是很多东西都要用命令来控制,当然,这也是很多人喜欢linux的原因,比较短 ...
- .NET MAUI 正式发布,再见了 Xamarin.Forms
David Ortinau 在dotnet 团队博客上发表了一篇文章<Introducing .NET MAUI – One Codebase, Many Platforms>,在这篇文章 ...
- java接口多实现注入方法总结
1. 单实现接口注入方法 1.1 构造注入(推荐) @RequiredArgsConstructor public class TestController { // 其只有一个具体的实现类 priv ...
- 【Java】在IDEA中将Javafx项目打包成为可运行的.jar文件
在使用Javafx制作一个图形化界面程序的时候,我遇到了打包文件的难题. 按照网上给出的解决方案构建出来的jar文件总是没有办法运行. 以下是我最终的解决方案. 我使用的IDE是IntelliJ ID ...
- Linux Cgroup v1(中文翻译)(1):Control Group
英文原文:https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v1/cgroups.html 1 控制组 1.1 什么是控制组? 控制组 ...
- CentOS7及以下版本安装禅道
由于是CentOS7以及以下系统,禅道已经集成了 Apache Nginx Mysql 服务,不需要我们再次安装搭建,我们只进行解压使用就好: 一.进行下载安装 1.在终端命令中输入以下命令确认系统是 ...
- CabloyJS v4.0.0支持工作流引擎及更多 🎉
截至2020年12月21日冬至,花了近5年时间作出最小可用NodeJS开源全栈框架,这就是CabloyJS V4.0.0 5年,90个模块,30万行代码,5400次提交(Commits),开启Node ...