栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

zookeeper 安装配置启动

zookeeper 安装配置启动

文章目录
      • 1. 安装
      • 2. 配置
      • 3. 启动zookeeper集群
      • 4. 查看启动情况

创建3个ecs实例,在每台机器上下载zookeeper
下载地址:
https://mirrors.cnnic.cn/apache/zookeeper/stable/apache-zookeeper-3.6.3-bin.tar.gz
http://mirrors.cnnic.cn/apache

1. 安装
# 解压gz包
tar -zxvf apache-zookeeper-3.6.3-bin.tar.gz
2. 配置
  1. 创建一个数据目录和日志目录
mkdir /root/data
mkdir /root/log
  1. 在创建的数据目录下创建myid文件
touch /root/data/myid
ehoc 1 >> /root/data/myid # 每个节点的编号不一样
  1. 复制zoo_sample.cfg文件
# 在zookeeper解压后的conf目录下
cp zoo_sample.cfg zoo.cfg
  1. 增加集群节点信息
# server.1 这里的数字和之前创建的myid文件中写入的编号一致
quorumListenOnAllIPs=true
server.1=ip:2888:3888
server.2=ip:2888:3888
server.3=ip:2888:3888
  1. 最终的配置文件
# 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=/root/data
dataLogDir=/root/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

## Metrics Providers
#
# https://prometheus.io Metrics Exporter
#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
#metricsProvider.httpPort=7000
#metricsProvider.exportJvmInfo=true

quorumListenOnAllIPs=true
server.1=ip1:2888:3888
server.2=ip2:2888:3888
server.3=ip3:2888:3888

3. 启动zookeeper集群
./bin/zkServer.sh start
4. 查看启动情况
./bin/zkServer.sh status
netstat -nltp 查看端口监听情况
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/443634.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号