zookeeper集群搭建
来源:互联网 发布:数据分析就业前景 编辑:程序博客网 时间:2024/06/07 20:21
zookeeper集群环境有集群环境、单机环境、伪集群三种情况。
1:创建配置文件。进入conf目录,运行命令:
cp zoo_sample.cfg zoo.cfg
zoo_sample.cfg是一个配置样例文件。修改其配置文件如下:
1 # The number of milliseconds of each tick 2 tickTime=2000 3 # The number of ticks that the initial 4 # synchronization phase can take 5 initLimit=10 6 # The number of ticks that can pass between 7 # sending a request and getting an acknowledgement 8 syncLimit=5 9 # the directory where the snapshot is stored. 10 # do not use /tmp for storage, /tmp here is just 11 # example sakes. 12 dataDir=/opt/zookeeper/2181 13 # the port at which the clients will connect 14 clientPort=2181 15 # the maximum number of client connections. 16 # increase this if you need to handle more clients 17 #maxClientCnxns=60 18 # 19 # Be sure to read the maintenance section of the 20 # administrator guide before turning on autopurge. 21 # 22 # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance 23 # 24 # The number of snapshots to retain in dataDir 25 #autopurge.snapRetainCount=3 26 # Purge task interval in hours 27 # Set to "0" to disable auto purge feature 28 #autopurge.purgeInterval=1 29 30 server.1=10.66.140.32:2888:3888 31 server.2=10.66.131.57:2888:3888 32 server.3=10.66.140.32:2889:3889
配置说明:
dataDir:为zookeeper运行时数据的快照文件。
clientPort:为客户端连接端口。
server.id=host.port.port:集群节点配置。
id:为集群节点的标识。一般为整数。其他的没试过~
host:为集群节点的ip。
第一个port:follower服务器和leader服务器通信的端口。
第二个port:用于leader选举过程中的投票通信。(具体内容后续更新)
2:进入上述配置文件dataDir配置的目录中创建文件myid,并将内容设置为上述server中的id。
配置例子如下:
3:进入bin目录下启动zk。
./zkServer.sh start
4:测试启动是否正常
运行命令:telnet ip port之后输入netstat检查情况。
出现该情况原因是在集群环境下,如果只有1台服务器在运行时,zk是不对外提供的。
启动其他机器节点后,再运行该命令就可以看到各个节点自己的情况。
0 0
- Zookeeper 介绍 Zookeeper 搭建 Zookeeper 集群搭建
- zookeeper(3) zookeeper集群搭建
- zookeeper集群搭建
- zookeeper集群搭建
- hbase+zookeeper集群搭建
- ZooKeeper集群搭建
- zookeeper集群搭建
- Zookeeper 集群搭建
- zookeeper集群搭建
- zookeeper 集群搭建
- Zookeeper 集群搭建
- Zookeeper集群搭建
- zookeeper集群环境搭建
- Zookeeper集群搭建
- ZooKeeper集群搭建
- Zookeeper分布式集群搭建
- ZooKeeper集群搭建
- ZooKeeper集群搭建
- C 编程语言走上下坡路了吗?
- 正则表达式:手机、邮箱、IP、日期
- Python面向对象01
- php操作memcache缓存基础方法
- Tomcat(8005,8080,8009)端口占用问题常见原因及解决方法
- zookeeper集群搭建
- 代码混淆 proguard-rules.pro
- Spark入门实战指南——Spark生态圈+第一个Spark程序
- win10下的iis的配置(服务于asp.net)
- Android内存泄露之Handler
- 模仿 Android支付宝咻一咻功能实现
- 在main方法中启动TestNG测试时build path的问题
- 如何让div在整个屏幕中垂直居中
- Leetcode 391. Perfect Rectangle 完美矩形 解题报告