zookeeper本机伪集群模式配置,坑人的配置。
来源:互联网 发布:淘宝店铺图标是什么 编辑:程序博客网 时间:2024/05/29 06:38
1.zookeeper解压的路径由以下可知:
/home/doctor/opt/zookeeper-3.4.6/conf
本地设置3个zookeeper,配置文件为:
zoo2.cfg zoo3.cfg zoo.cfg。
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=/home/doctor/zookeeper/d_1
# 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
zoo2.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=/home/doctor/zookeeper/d_2
# the port at which the clients will connect
clientPort=2182
# 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
zoo3.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=/home/doctor/zookeeper/d_3
# the port at which the clients will connect
clientPort=2183
# 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
注意:大家都知道,关键是clientPort 不能相同。
其次,让我启动失败的配置那就是:dataDir=/home/doctor/zookeeper/d_x (d_1,d_2,d_3)
里面的配置。
大家应该知道在此文件下需要建立myid文件,里面的内容就是对应server.1=localhost:2887:3887 里面的server.1中的1.例如:
[doctor@localhost d_1]$ pwd
/home/doctor/zookeeper/d_1
[doctor@localhost d_1]$ ls
myid version-2 zookeeper_server.pid
[doctor@localhost d_1]$
[doctor@localhost d_1]$ cat myid
1
内容是1,
问题根源:我写入的内容为1,不后面加了空格,就报错,启动不了。
所以,。。。。应该程序读取配置文件时候,就应该trim一下吧。。
- zookeeper本机伪集群模式配置,坑人的配置。
- zookeeper 伪集群和集群模式配置
- zookeeper windows伪集群模式配置
- zookeeper伪集群模式安装和配置
- zookeeper伪集群配置
- zookeeper 单机伪集群配置
- zookeeper 单机伪集群配置
- zookeeper单机伪集群配置
- zookeeper 单机伪集群配置
- zookeeper单机伪集群配置
- Zookeeper单机伪集群配置
- zookeeper单机伪集群配置
- zookeeper单机伪集群配置
- ZooKeeper的集群配置(使用于单机伪集群)
- ZeeKeeper 集群 伪分布式配置 zookeeper的使用
- zookeeper单机伪集群配置(备忘)
- 如何配置zookeeper单机伪集群
- Zookeeper基础安装--伪分布式集群配置
- 查漏补缺2(面试小题目)
- C#格式化字符串大全
- dnw在linux下的安装方法
- Maximum Product Subarray -- LeetCode
- 数据结构:链表
- zookeeper本机伪集群模式配置,坑人的配置。
- linux touch 命令
- 【android】在eclipse中更改应用包名及源码包名
- 第一篇—开端
- C# Slugify方法
- C# URL操作
- .htaccess实现301网页永久重定向及302临时重定向
- URL重写:RewriteCond指令与RewriteRule 指令格式
- Dynamic dates in Selenium IDE