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目录下执行 ...
随机推荐
- the filename directory name or volume label syntax is incorrect
使用virtual PC 时出现的一些问题 1.问题点:在安装virtual PC的时候,需要先安装WindowsXPMode_en-us.exe 我下载的英文版,路径默认在C:\360安全浏览器下载 ...
- org.apache.jasper.compiler.TldLocationsCache tldScanJar
我在页面上一点击查询.console以下就有例如以下的红色文字: 2014-8-19 15:09:27 org.apache.jasper.compiler.TldLocationsCache tld ...
- 分布式服务框架 Zookeeper(二)官方介绍
ZooKeeper:为分布式应用而生的分布式协调服务 ZooKeeper是一个为分布式应用而设计的分布式的.开源的协调服务.它提供了一套简单的原语,分布式应用利用这套原语可以实现更高层的服务,比如一致 ...
- Modification of UCT with Patterns in Monte-Carlo Go(论文阅读)
摘要:用于解决多臂赌博机UCB1算法已经被扩展成了解决极大极小树搜索的UCT算法.我们开发了一套Monte-Carlo围棋程序,MoGo,这是第一个使用UCT算法实现的计算机围棋程序.我们解释了为了围 ...
- 文件上传下载:commons-fileupload + Servlet 2.5
数据库:MySQL 开发技术:JSP + Servlet 2.5 第三方的上传组件: commons-fileupload connons-io 上传页面1.form表单需要增加:enctype=&q ...
- neocomplcache 自动补全
key description ctrl+n 当前词补全项,下一个 ctrl+p 当前词补全项,上一个 :help NERDTree NERDTree帮助手册
- 基于consul构建golang系统分布式服务发现机制
原文地址-石匠的Blog: http://www.bugclosed.com/post/5 在分布式架构中,服务治理是一个重要的问题.在没有服务治理的分布式集群中,各个服务之间通过手工或者配置的方式进 ...
- 嵌入式开发之davinci--- 8148/8168/8127 中的音频alsa 采集
1.snd_pcm_open,打开句柄. 2.配置参数,可能用到的接口:snd_pcm_hw_params_alloca.snd_pcm_hw_params_any.snd_pcm_hw_params ...
- 我的消灭复杂password之行
近期几天.网易一直提示邮箱账号异常.特意去查看了一下,发现须要改动password.可是经常使用的password又不让反复使用.于是无奈之下.就想办法消灭这些复杂password,由于实在是太难(g ...
- Android-ViewPagerIndicator框架使用——TitlePageIndicator
前言:TitlePageIndicator这个就是效果比较好. 一:定义布局文件simple_titles: <LinearLayout xmlns:android="http://s ...