# 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=2180
# 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.1=10.91.227.172:2888:3888
server.2=10.91.227.173:2889:3889
server.3=10.91.227.173:2890:3890
在 dataDir 的目录下分别创建
echo '1' > myid
echo '2' > myid
echo '3' > myid
同时删除其他 .pid 文件
重启即可
通过 ./zkServer.sh status可查看集群中的角色:
ZooKeeper JMX enabled by default
Using config: /app/tools/zookeeper-3.4.8/bin/../conf/zoo.cfg
Mode: follower
分享到:
相关推荐
### Dubbo+zookeeper集群配置详解 #### 一、Zookeeper工作原理 Zookeeper的核心功能是通过**原子广播**机制来确保各个服务器之间的数据同步。这一机制由Zab协议支持,Zab协议有两种运行模式:**恢复模式**和**广播...
在Linux集群环境中搭建Zookeeper集群是一个涉及到多台服务器间协调工作的复杂过程,需要对Zookeeper的工作原理和配置有深入的了解。本篇详细阐述了从下载安装到集群配置的全过程。 首先,Zookeeper集群部署的前提...
**Kafka-Zookeeper集群配置详解** 在大数据处理和实时流计算领域,Apache Kafka与Zookeeper是两个非常重要的组件。Kafka作为一个高吞吐量、分布式的消息发布与订阅系统,广泛用于数据管道和实时数据流处理;而...
### Zookeeper集群配置详解 #### 一、Zookeeper集群配置原则及重要性 Zookeeper作为一款分布式的协调服务工具,在高可用系统架构中扮演着重要角色。为了保证系统的稳定性与可靠性,Zookeeper集群通常采用奇数节点...
**Kafka与Zookeeper集群配置详解** 在大数据处理和实时流计算领域,Apache Kafka和Apache Zookeeper是两个不可或缺的组件。Kafka作为一个高吞吐量的分布式消息系统,用于处理实时数据流,而Zookeeper则作为一个...
zookeeper集群配置带图片详解内容较为清晰上市公司所用的pdf版本的集群配置如有不懂可联系
配置Zookeeper集群涉及: 1. 安装Zookeeper:在所有节点上部署Zookeeper,设置`ZOOKEEPER_HOME`环境变量。 2. 修改`zoo.cfg`配置:包括数据存储路径、集群节点列表(server.1, server.2, ...)等。 3. 分配myid:在...
【CentOS+Jdk+Jboss+dubbo+zookeeper集群配置教程】 在进行大规模分布式系统开发时,集成多种组件是常见的需求。本教程将详细介绍如何在CentOS操作系统上配置Jdk、Jboss应用服务器、dubbo服务治理框架以及zookeeper...
【Hadoop Hbase Zookeeper集群配置】涉及到在Linux环境下搭建分布式计算和数据存储系统的流程,主要涵盖以下几个关键知识点: 1. **集群环境设置**:一个基本的Hadoop Hbase Zookeeper集群至少需要3个节点,包括1个...
Kafka、Zookeeper集群配置Demo
**Zookeeper集群配置的基本概念:** 1. **节点(Node)**:ZooKeeper中的节点分为持久节点(PERSISTENT)、临时节点(EPHEMERAL)和顺序节点(SEQUENTIAL)。 2. **数据模型**:ZooKeeper的数据模型类似于文件系统,...
在配置Zookeeper集群时,首先需要安装Java Development Kit(JDK),因为Zookeeper是用Java编写的,依赖于JDK环境来运行。提供的"jdk8-linux"安装包就是用于在Linux系统上安装JDK 8的。JDK 8是Java的一个稳定版本,...
二、ZooKeeper集群配置 1. 配置文件zoo.cfg:在zoo.cfg文件中,需要配置数据目录、端口号、服务器列表等参数,以便满足集群部署的需求。 2. myid文件配置:在myid文件中,需要配置服务器的唯一标识符,以便...
当需要搭建Zookeeper集群时,需要在`zoo.cfg`中添加以下集群配置: 1. `server.1=`、`server.2=`、`server.3=`等,指定集群中每台服务器的IP地址和通信端口(如2888和3888)。 2. 各个服务器的`dataDir`下创建`myid`...
二、 ZooKeeper 集群配置 1. 配置 ZooKeeper 节点:在每个 ZooKeeper 节点目录下配置 zoo.cfg 文件,包括 tickTime、initLimit、syncLimit、dataDir、dataLogDir、clientPort 等参数。 2. 配置 ZooKeeper 节点之间...
- 在`zoo.cfg`中添加集群配置信息,例如: ```bash server.1=192.168.1.90:2888:3888 server.2=192.168.1.91:2888:3888 server.3=192.168.1.92:2888:3888 ``` 3. **启动集群**:在每个节点上分别启动Zookeeper...
例如,在HBase中,客户端可以通过连接Zookeeper来获取必要的集群配置信息,从而实现对HBase集群的操作。 2. **名字服务** 名字服务是Zookeeper提供的一项基本功能,类似于DNS在互联网中的作用。在分布式系统中,...
修改 zookeeper 启动配置文件 zoo.cfg,配置 dataDir、dataLogDir、clientPort,并进行集群配置,例如: server.1=172.19.59.46:2888:3888 server.2=172.19.59.47:2889:3889 server.3=172.19.59.50:2890:3890 其中...