zookeeper单机伪集群配置
一、配置
1、在 opt 目录下建一个文件夹 zk,分别把zookeeper 安装包复制三份,命令为zookeeper-0 zookeeper_1 zookeeper_2
2、分别在每一个zookeeper目录下创建一个date目录--->mkdir date
3、配置 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=/opt/zk/zookeeper-3.4.6_0/data
dataLogDir=/opt/zk/zookeeper-3.4.6_0/logs
# 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.1=localhost:2887:3887
server.2=localhost:2888:3888
server.3=localhost:2889:3889
注意:
在zookeeper_0 的 clientPort=2181
在zookeeper_1 的 clientPort=2182
在zookeeper_2 的 clientPort=2183
4、配置 data
在 data 目录下建立 myid 文件,内容分别为:
zookeeper_0 myid 为 1
zookeeper_0 myid 为 2
zookeeper_0 myid 为 3(和zoo.cfg 里面server 后面的数字相同)
5、配置 bin/zkServer.sh
f分别把 三个zk下的bin/zkServer.sh重命名为bin/zkServer.-1sh; bin/zkServer.-2sh; bin/zkServer-3.sh
6、配置环境变量
export ZK_HOME=/opt/zk
export PATH=$ZK_HOME/zookeeper-3.4.6_0/bin:$ZK_HOME/zookeeper-3.4.6_1/bin:$ZK_HOME/zookeeper-3.4.6_2/bin:$PATH
7、启动
分别执行:bin/zkServer.-1sh start; bin/zkServer.-2sh start; bin/zkServer-3.sh start
验证:bin/zkServer.-1sh status; bin/zkServer.-2sh status; bin/zkServer-3.sh status
出现两个:follow,一个leader 则启动成功
zookeeper单机伪集群配置的更多相关文章
- Zookeeper单机伪集群
Zookeeper单机伪集群 1.配置 zookeeper下载地址:http://apache.mirrors.lucidnetworks.net/zookeeper/ 可以选择需要的版本,我下载的是 ...
- 备忘zookeeper(单机+伪集群+集群)
#下载: #单机模式 解压到合适目录. 进入zookeeper目录下的conf子目录, 复制zoo_sample.cfg-->zoo.cfg(如果没有data和logs就新建):tickTime ...
- ZooKeeper单机伪集群搭建与启动
下载解压 [xiaobai@xiaobai ~]$ tar -zvxf zookeeper-3.4.9.tar.gz 本机ip地址映射 [xiaobai@xiaobai /]$ su - rootPa ...
- 记一次zookeeper单机伪集群分布
zookeeper的各版本(历史版本)下载地址:http://apache.org/dist/zookeeper/ 环境>:linux 下载的zookeeper解压成3个
- zookeeper[5] zookeeper集群配置及伪集群配置
参考:http://zookeeper.apache.org/doc/trunk/zookeeperStarted.html 集群配置: 1.配置文件conf/zoo.cfg,除了单机模式的配置之外, ...
- Zookeeper集群搭建(多节点,单机伪集群,Docker集群)
Zookeeper介绍 原理简介 ZooKeeper是一个分布式的.开源的分布式应用程序协调服务.它公开了一组简单的原语,分布式应用程序可以在此基础上实现更高级别的同步.配置维护.组和命名服务.它的设 ...
- 【运维技术】Zookeeper单机以及集群搭建教程
Zookeeper单机以及集群搭建教程 单机搭建 单机安装以及启动 安装zookeeper的前提是必须有java环境 # 选择目录进行下载安装 cd /app # 下载zk,可以去官方网站下载,自己上 ...
- redis在Windows下以后台服务一键搭建集群(单机--伪集群)
redis在Windows下以后台服务一键搭建集群(单机--伪集群) 一.概述 此教程介绍如何在windows系统中同一台机器上布置redis伪集群,同时要以后台服务的模式运行.布置以脚本的形式,一键 ...
- java:redis(redis安装配置,redis的伪集群配置)
1.redis安装配置: .安装gcc : yum install gcc-c++ .使用FTP工具FileZilla上传redis安装包到linux根目录下(当前步骤可以替换为:在root目录下执行 ...
随机推荐
- XX年年终总结---重新飞跃
XX年年终总结---重新飞跃 写之前先解释一下为什么是年终总结,由于在提高班学习,每年结束于暑假:新的一年開始于9月. 肚子里的墨水已经找不到新的词语来形容时间过得快了,一年结束了.还有一年又结束了: ...
- LA 5009 (HDU 3714) Error Curves (三分)
Error Curves Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu SubmitStatusPr ...
- DevStore开发人员服务有奖征文:小谈新浪微博开放平台
DevStore开发人员服务有奖征文:小谈新浪微博开放平台 笔者接入新浪微博开发平台也有一段时间了,对整个平台的接入也算比較熟悉,新浪提供了统一的API接口,能够让开发人员更方便的使用API来实现自己 ...
- GTS、GCK,GSR全称
GTS:Global 3-state buffer delay 全局使能,三态 GCK:Global Clock buffer delay 全局时钟 GSR:Global set/reset bu ...
- JSON串常用函数
1.JSON.parse() parse 用于从一个字符串中解析出json 对象. 例如 var str='{"name":"cpf","age&qu ...
- iOS 后台定位审核被拒How to clarify the purpose of its use in the locatio
4.5 - Apps using background location services must provide a reason that clarifies the purpose of th ...
- row format delimited fields terminated by ','
row format delimited fields terminated by ',' 以','结尾的行格式分隔字段
- 设计模式中类的关系之依赖关系(Dependence)
依赖关系是一种使用关系,特定事物的改变有可能会影响到使用该事物的其他事物,在需要表示一个事物使用另一个事物时使用依赖关系.可以简单的理解,就是一个类A使用到了另一个类B,而这种使用关系是具有偶然性的. ...
- 【ASP.NET】——AdRotator控件
AdRotator控件即广告控件. 广告,是站点不可缺少的一部分.也是站点获取收益的最主要途径,但最初制作广告非常麻烦.asp.net就将该方法封装成了一个控件.为我们节省了非常多时间.这也是ASP. ...
- if not aa 表示如果aa等于空就是true 相当于if not aa 相当于 if aa== 空
aa='tt' print(not aa) #表示 bb是空的 not 表示空 bb='' print(not bb)