2020-02-14 12:30:03
Zookeeper 是个分布式开源框架,之前在做分布式日志收集的时候,就使用到,Zookeeper搭建比较简单。
目前最新稳定版本:3.4.10, 下载地址http://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/
进入 stable 目录下载:
下载后解压:
[root@1c271ed316ca ~]# tar zxvf zookeeper-3.4.10.tar.gz
使用默认配置,启动监听端口:2181
[root@1c271ed316ca ~]# cd zookeeper-3.4.10
[root@1c271ed316ca zookeeper-3.4.10 ]# cp conf/zoo_sample.cfg conf/zoo.cfg
[root@1c271ed316ca zookeeper-3.4.10 ]# bin/zkServer.sh start
默认情况下,zkServer.sh 加载 ../conf/zoo.cfg 配置文件,配置文件主要有下面内容:
可以修改 dataDir 的目录,Zookeeper暴露给客户端的端口。
# 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=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
步骤1:配置文件增加节点信息
分别在不同的节点A、B、C机器上下载Zookeeper,并且解压,在默认配置文件基础上,添加下面的节点信息:
server.1=xx.xx.xx.xx:2888:3888 # A节点IP
server.2=xx.xx.xx.xx:2888:3888 # B节点IP
server.2=xx.xx.xx.xx:2888:3888 # C节点IP
说明:
2888 端口: Zookeeper 各个节点之间的通信端口; 3888端口: Zookeeper 选择Leader的端口; 这些端口可以自行修改,需要指定好 当前节点的ID(myid)即可,Zookeeper在启动服务后,会开启当前节点的端口配置;步骤2:配置当前节点的ID
[root@1c271ed316ca ~]# echo "X" > /tmp/zookeeper/myid
注意:
“X” 改为当前节点的编号,对应于配置文件中 server.X ; /tmp/zookeeper 改为实际 Zookeeper 配置文件中的 dataDir路径;Zookeeper 服务启动的时候,会在 Zookeeper DataDir 目录查找 myid文件,里面的数字即表示当前的节点是 server.X.
步骤3:各个节点分别启动服务
[root@A节点 zookeeper-3.4.10 ]# bin/zkServer.sh start
[root@B节点 zookeeper-3.4.10 ]# bin/zkServer.sh start
[root@C节点 zookeeper-3.4.10 ]# bin/zkServer.sh start
Zookeeper实现参数的集中式管理
03-24
Docker安装部署MySQL5.7
05-26
Docker创建的集群下使用ansible部署Zookeeper
04-26
docker安装部署gitlab 配置使用部外nginx
04-14
CentOS 7.2安装配置MariaDB Galera Cluster(10.1.21-MariaDB) 三主集群环境
05-13
docker部署Elasticsearch集群
03-10
在Kubernetes上使用Sateful Set部署RabbitMQ集群
02-15
58 赶集基于 Docker 的自动化部署实践
05-02
CentOS 7.3 上用 docker 部署 redis 介绍
05-07
Centos7下Etcd集群搭建
07-07
Debian 7 (Wheezy)安装配置Apache mod_fastcgi PHP-FPM
07-20
Docker Compose 项目打包部署
04-17
Docker命令行参考(33) – docker swarm init初始化集群
04-15
EDU 8.0首次部署操作步骤
06-05
Intel芯片组USB3.0驱动程序的手动安装方法
07-13
Kubernetes集群中Service的滚动更新
02-17
Lenovo G550在Windows XP操作系统下触控板驱动安装方法
07-17
Linux系统SureHA 2.0集群磁盘资源/镜像磁盘资源FSCK设置导致启动时间过长的解决办法
05-18
Linux系统SureHA集群中手动mount磁盘资源、镜像磁盘资源处于只读模式的解决方法
03-24
Lvs自动部署及监控shell脚本
04-11
3d蓝光播放器(高清3D影音播放软件) V1.8.0.4 绿色免安装版
36.8 MB
下载Virtual CloneDrive V5.4.4.0 汉化纯净安装版
1.6MB
下载usb3.0驱动(硬件驱动安装工具) v6.6 绿色版
8.67MB
下载硬盘安装器(系统安装工具) 1.6.10.6 中文版
17.35 MB
下载驱动总裁最新绿色免安装版 2.6.0.0 最新版
287.73M
下载360安全桌面下载
42.53M
下载HofoSetup下载
5.7M
下载autocad2014(cad设计软件) 免费版
1505.28MB
下载editplus3下载
1.41M
下载pkpm2010破解版下载
1.56GB
下载xlive下载
21.3MB
下载和平网络电视下载
4.2M
下载矮人DOS工具箱下载
9.01M
下载系统之家一键重装系统下载
28.4M
下载黄山IE修复专家下载
4.44MB
下载