zookeeper下载 ticktime 设置多少合适

汇聚2000万达人的兴趣社区下载即送20张免费照片冲印
扫码下载App
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
有我之境,物皆着我之色彩!
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
zoo1.cfg内容:tickTime=2000& initLimit=5& syncLimit=2 & &dataDir=D:\\tools\\zookeeper-3.4.6\\data\\1 & clientPort=2181&& server.1=localhost:server.2=localhost:server.3=localhost:zoo2.cfg内容:tickTime=2000& initLimit=5& syncLimit=2 & dataDir=D:\\tools\\zookeeper-3.4.6\\data\\2& clientPort=2182& server.1=localhost:server.2=localhost:server.3=localhost:zoo3.cfg内容:tickTime=2000& initLimit=5& syncLimit=2 & dataDir=D:\\tools\\zookeeper-3.4.6\\data\\3& clientPort=2183 & server.1=localhost:server.2=localhost:server.3=localhost:注:server.X=A:B:C 其中X是一个数字, 表示这是第几号server. A是该server所在的IP地址.
B配置该server和集群中的leader交换消息所使用的端口. C配置选举leader时所使用的端口. 由于配置的是伪集群模式,
所以各个server的B, C参数必须不同。分别在zookeeper-3.4.6\data\1、zookeeper-3.4.6\data\2、zookeeper-3.4.6\data\3目录下创建一个myid的文件,myid文件的内容分别为1、2、3在zookeeper-3.4.6/bin/目录下创建3个配置文件:zkEvn1.cmd、zkEvn2.cmd、zkEvn3.cmd分别修改set ZOOCFG=%ZOOCFGDIR%\zoo.cfg 为:set ZOOCFG=%ZOOCFGDIR%\zoo1.cfg、set ZOOCFG=%ZOOCFGDIR%\zoo2.cfg、set ZOOCFG=%ZOOCFGDIR%\zoo3.cfg在zookeeper-3.4.6/bin/目录下创建3个配置文件:zkServer1.cmd、zkServer2.cmd、zkServer3.cmd分别修改call "%~dp0zkEnv.cmd" 为:call "%~dp0zkEnv1.cmd"、call "%~dp0zkEnv2.cmd"、call "%~dp0zkEnv3.cmd"分别执行zkServer1.cmd、zkServer2.cmd、zkServer3.cmd就启动了zookeeper服务器。
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
在LOFTER的更多文章
loftPermalink:'',
id:'fks_',
blogTitle:'Zookeeper WINDOWS 安装配置',
blogAbstract:'下载:zookeeper:http://mirrors./apache/zookeeper/zookeeper-3.4.6/
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}Zookeeper(三)配置 - 天行健,君子以自强不息
- 博客频道 - CSDN.NET
2984人阅读
最低配置:
clientPort
监听客户端连接的端口
存储持久数据的本地文件系统位置
基本事件单元,以毫秒为单位,用来控制心跳和超时,默认情况超时的时间为两倍的tickTime
高级配置:
dataLogDir
事件日志写入的目录
maxClientCnxns
限制连接到zookeeper的客户端数量,并且限制并发连接数量,它通过ip区分不同的客户端。
minSessionTimeout和maxSessionTimeout
最小会话超时时间和最大的会话超时时间,在默认情况下,最小的超时时间为2倍的tickTime时间,最大的会话超时时间为20倍的会话超时时间,系统启动时会显示相应的信息。默认为-1
集群配置:
参数设定了允许所有跟随者与领导者进行连接并同步的时间,如果在设定的时间段内,半数以上的跟随者未能完成同步,领导者便会宣布放弃领导地位,进行另一次的领导选举。如果zk集群环境数量确实很大,同步数据的时间会变长,因此这种情况下可以适当调大该参数。默认为10
参数设定了允许一个跟随者与一个领导者进行同步的时间,如果在设定的时间段内,跟随者未完成同步,它将会被集群丢弃。所有关联到这个跟随者的客户端将连接到另外一个跟随着。
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:363517次
积分:4992
积分:4992
排名:第2321名
原创:81篇
转载:10篇
评论:250条
阅读:35890
阅读:5257
文章:11篇
阅读:94530
(2)(2)(1)(1)(1)(9)(4)(2)(7)(10)(4)(13)(6)(19)(4)(8)(1)(1)(4)zookeeper+dubbo+dubbo管理集群的简要配置[单机] -
- ITeye技术网站
注:zookeeper集群是myid文件是没有后缀名的。
转自:
/demo_c353_i4119.html
/demo_c196_i554.html
导读:考虑到单机部署运行,在此文档中RegisterGroup 是单例的Zookeeper,部署集群模式的registerGroup请参考Zookeeper集群/view/649b.html
dubbo是阿里的一个开源soa框架,详细介绍/wiki/display/dubbo/Home-zh
zookeeper是Hadoop的子项目,主要功能基于paxos算法对分布式系统的请求进行调度,详细介绍/developerworks/cn/opensource/os-cn-zookeeper/
考虑到单机部署运行,在此文档中RegisterGroup 是单例的Zookeeper,部署集群模式的registerGroup请参考Zookeeper集群 /view/649b.html
代码下载[不含 app的lib]http://download.csdn.net/detail/goliathray/5048969
需要的工具 eclipse tomcat
ProviderGroup:可以存在多个ProviderGroup,每个Group由多台Node组成,每个Node需要保证以下配置
1.&&&&& 采用相同的application name
2.&&&&& 保证provider的连接地址互不相同(在单机上部署多个provider需要保证端口不同)
3.&&&&& 注册中心地址一致
ConsumerGroup:可以存在多个ConsumerGroup,每个Group由多台Node组成,每个Node需要保证能网络连接到所需业务的Provider并保证以下配置
1.&&&&& 采用相同的application name
2.&&&&& 注册中心地址一致
ProviderNode可以作为ConsumerNode调用别的ProviderGroup组的业务,相对的ConsumerNode也可以作为ProviderNode
RegisterGroup:注册中心组作为服务调用的分配者,每个RegisterNode监听除自身以外所有节点是否存活和健康(包括其RegisterGroup),本文档以Zookeeper单例部署为例子说明。
DubboAdmin:管理节点,可选节点,只作为一个管理者和观察者。
部署说明:
1.&&&&& 在Eclipse中引入DubboConsumerNode1 - 3 和DubboProviderNode1 -3 共6个项目
2.&&&&& 将DubboAdmin中的文件复制到apache-tomcat\webapps\ROOT下
3.&&&&& Zookeeper已经做了基础配置,只需在 \zookeeper-3.4.4\bin启动 zkServer.cmd
Zoo.cfg配置说明
#tickTime:这个时间是作为 Zookeeper 服务器之间或客户端与服务器之间维持心跳的时间间隔,也就是每个 tickTime 毫秒时间就会发送一个心跳。
tickTime=2000
#dataDir:Zookeeper 保存数据的目录,默认情况下,Zookeeper 将写数据的日志文件也保存在这个目录里。
dataDir=/tmp/zookeeper
#dataLogDir:日志文件保存的位置(未配置)
dataLogDir=/tmp/zookeeper/log
#clientPort:这个端口就是客户端连接Zookeeper 服务器的端口,Zookeeper 会监听这个端口,接受客户端的访问请求。
clientPort=2181
#initLimit:这个配置项是用来配置 Zookeeper接受客户端(这里所说的客户端不是用户连接 Zookeeper 服务器的客户端,而是 Zookeeper 服务器集群中连接到 Leader 的 Follower 服务器)初始化连接时最长能忍受多少个心跳时间间隔数。
#当已经超过 10 个心跳的时间(也就是tickTime)长度后 Zookeeper 服务器还没有收到客户端的返回信息,那么表明这个客户端连接失败。总的时间长度就是 10*2000=20 秒。
initLimit=10
启动顺序:
这个部署并不严格要求启动的前后顺序,建议启动顺序
1.&&&&& 启动Zookeeper ,显示
2.&&&&& 启动Tomcat,若先启动Tomcat则会一直监听Zookeeper服务是否启动,当Zookeeper启动后才会加载完成,启动完成后访问127.0.0.1:8080,以root/root 登陆,显示
3.&&&&& 启动Provider,在eclipse中找到Provider1-3.java,直接运行main方法,每启动一个节点,显示
同时在提供者列表中会增加一个节点信息
3个Provider全启动后
4.&&&&& 启动Consumer, 在eclipse中找到Consumer1-3.java,直接运行main方法,每启动一个节点,可以见到console有输出
在Provider的Console中有显示
同时在消费者列表有新增节点信息
3个Consumer全启动后
节点的异常:
ProviderNode异常:当某台ProviderNode宕机后,Register无法再获取此Provider的信息,但是在进行initLimit个心跳连接之前,Register会认为这个Node只是暂时出错,并不会把他剔除出Provider的列表,Consumer的调用会报错(在未配置容错的情况下),某台Consumer可能会显示
但是在经过initLimit次的心跳后,此节点会被剔除出Provider列表,访问恢复
ConsumerNode异常:除非存在P-C-P的循环,不会对此部署产生影响,在经过initLimit次的心跳后,在Consumer列表中被剔除
RegisterNode异常:参考Zookeeper集群异常
异常恢复:对于每个ProviderNode和ConsumerNode,只需要重启动后连接上Register,既可以恢复原有的服务状态。
DubboAdmin管理:
DubboAdmin本身的配置采用的是文件的方式保存配置信息,配置的结果信息会由各个节点保存到临时文件,以保证在重启服务后恢复到原有状态
权重负载均衡:默认采用的是随机权重的负载均衡,对于第一次加载的Provider服务,权重为100,服务的访问率为(节点服务权重/服务重权重)*100%,可以通过增减权重的方式改变节点的访问几率,在对1号节点增加4倍权重后,1号节点的访问概率变为66.7%,可以在3个Provider节点的Console中看到信息的增幅速度明显改变,1号节点的速度远大于其他2个节点。
自定义的负载均衡:可以新增负载均衡的规则,优先于默认的负载均衡,有随机,伦循,按最小并发3种规则,可以细化到方法。
消费者的容错:在Provider端出现异常时,可以默认返回一个容错值,默认为Null,可以自己配置,通过对Provider的Service设置mock类
启动容错后若Provider端出错,返回Null,优先于禁用
可以看到Consumer的Console报错
消费者的禁用:对于ConsumerNode,禁用后则不能访问任何Provider
若设置了容错,则返回NULL
若无容错,则返回调用异常
恢复后显示数据可以正常访问
提供者的禁用:禁止此Provider提供服务,(对下次启动生效),在重启动这个服务后显示
服务无法被访问,在点击启用后服务恢复
上一篇 Blueprint入门之四 下一篇 使用UFT进行接口测试(Web Service、REST)
总结:权重负载均衡:默认采用的是随机权重的负载均衡,对于第一次加载的Provider服务,权重为100,服务的访问率为(节点服务权重/服务重权重)*100%,可以通过增减权重的方式改变节点的访问几率,在对1号节点增加4倍权重后,1号节点的访问概率变为66.7%,可以在3个Provider节点的Console中看到信息的增幅速度明显改变,1号节点的速度远大于其他2个节点。
ahua186186
浏览: 54044 次
来自: 深圳
我也试试看。
非常感谢!!!!It helps!
谢谢,学习了
Tigase 扩展性和集群方面确实比openfire好一些,不 ...Getting Started
Admin & Ops
Contributor
Miscellaneous
ZooKeeper Getting Started Guide
Getting Started: Coordinating Distributed Applications with
This document contains information to get you started quickly with
ZooKeeper. It is aimed primarily at developers hoping to try it out, and
contains simple installation instructions for a single ZooKeeper server, a
few commands to verify that it is running, and a simple programming
example. Finally, as a convenience, there are a few sections regarding
more complicated installations, for example running replicated
deployments, and optimizing the transaction log. However for the complete
instructions for commercial deployments, please refer to the .
Pre-requisites
in the Admin guide.
To get a ZooKeeper distribution, download a recent
release from one of the Apache Download
Standalone Operation
Setting up a ZooKeeper server in standalone mode is
straightforward. The server is contained in a single JAR file,
so installation consists of creating a configuration.
Once you've downloaded a stable ZooKeeper release unpack
it and cd to the root
To start ZooKeeper you need a configuration file. Here is a sample,
create it in conf/zoo.cfg:
tickTime=2000
dataDir=/var/zookeeper
clientPort=2181
This file can be called anything, but for the sake of this
discussion call
it conf/zoo.cfg. Change the
value of dataDir to specify an
existing (empty to start with) directory.
Here are the meanings
for each of the fields:
the basic time unit in milliseconds used by ZooKeeper. It is
used to do heartbeats and the minimum session timeout will be
twice the tickTime.
the location to store the in-memory database snapshots and,
unless specified otherwise, the transaction log of updates to the
clientPort
the port to listen for client connections
Now that you created the configuration file, you can start
ZooKeeper:
bin/zkServer.sh start
ZooKeeper logs messages using log4j -- more detail
available in the
section of the Programmer's Guide. You will see log messages
coming to the console (default) and/or a log file depending on
the log4j configuration.
The steps outlined here run ZooKeeper in standalone mode. There is
no replication, so if ZooKeeper process fails, the service will go down.
This is fine for most development situations, but to run ZooKeeper in
replicated mode, please see .
Managing ZooKeeper Storage
For long running production systems ZooKeeper storage must
be managed externally (dataDir and logs). See the section on
more details.
Connecting to ZooKeeper
Once ZooKeeper is running, you have several options for connection
bin/zkCli.sh 127.0.0.1:2181
This lets you perform simple, file-like operations.
C: compile cli_mt
(multi-threaded) or cli_st (single-threaded) by running
make cli_mt or make
the src/c subdirectory in
the ZooKeeper sources. See the README contained within
src/c for full details.
You can run the program
from src/c using:
LD_LIBRARY_PATH=. cli_mt 127.0.0.1:2181
LD_LIBRARY_PATH=. cli_st 127.0.0.1:2181
This will give you a simple shell to execute file
system like operations on ZooKeeper.
Programming to ZooKeeper
ZooKeeper has a Java bindings and C bindings. They are
functionally equivalent. The C bindings exist in two variants: single
threaded and multi-threaded. These differ only in how the messaging loop
is done. For more information, see the
sample code using of the different APIs.
Running Replicated ZooKeeper
Running ZooKeeper in standalone mode is convenient for evaluation,
some development, and testing. But in production, you should run
ZooKeeper in replicated mode. A replicated group of servers in the same
application is called a quorum, and in replicated
mode, all servers in the quorum have copies of the same configuration
file. The file is similar to the one used in standalone mode, but with a
few differences. Here is an example:
tickTime=2000
dataDir=/var/zookeeper
clientPort=2181
initLimit=5
syncLimit=2
server.1=zoo1:
server.2=zoo2:
server.3=zoo3:
The new entry, initLimit is
timeouts ZooKeeper uses to limit the length of time the ZooKeeper
servers in quorum have to connect to a leader. The entry syncLimit limits how far out of date a server can
be from a leader.
With both of these timeouts, you specify the unit of time using
tickTime. In this example, the timeout
for initLimit is 5 ticks at 2000 milleseconds a tick, or 10
The entries of the form server.X list the
servers that make up the ZooKeeper service. When the server starts up,
it knows which server it is by looking for the file
myid in the data directory. That file has the
contains the server number, in ASCII.
Finally, note the two port numbers after each server
name: " 2888" and "3888". Peers use the former port to connect
to other peers. Such a connection is necessary so that peers
can communicate, for example, to agree upon the order of
updates. More specifically, a ZooKeeper server uses this port
to connect followers to the leader. When a new leader arises, a
follower opens a TCP connection to the leader using this
port. Because the default leader election also uses TCP, we
currently require another port for leader election. This is the
second port in the server entry.
If you want to test multiple servers on a single
machine, specify the servername
as localhost with unique quorum &
leader election ports (i.e. , ,
the example above) for each server.X in that server's config
file. Of course separate dataDirs and
distinct clientPorts are also necessary
(in the above replicated example, running on a
single localhost, you would still have
three config files).
Other Optimizations
There are a couple of other configuration parameters that can
greatly increase performance:
To get low latencies on updates it is important to
have a dedicated transaction log directory. By default
transaction logs are put in the same directory as the data
snapshots and myid file. The dataLogDir
parameters indicates a different directory to use for the
transaction logs.
[tbd: what is the other config param?]zookeeper多种方式安装
本文系统:Centos6.5 x64
一、单机模式安装
二、伪集群模式安装
三、集群模式安装
1、单机模式安装zookeeper
1.1、创建帐号zk
[root@master ~]# useradd -d /opt/zk zk
[root@master ~]# echo &zk& |passwd --stdin zk
1.2、、解压、
[root@master ~]# su - zk
[zk@master ~]$ pwd
[zk@master ~]$
[zk@master ~]$ tar zxvf zookeeper-3.5.0-alpha.tar.gz
[zk@master ~]$ mv zookeeper-3.5.0-alpha zk
1.3、配置当前用户环境变量
export ZOOKEEPER_HOME=/opt/zk/zk
PATH=$ZOOKEEPER_HOME/bin:$PATH
export PATH
1.4、配置配置文件zoo.cfg
[zk@master conf]$ cat zoo.cfg
initLimit=10
syncLimit=5
clientPort=2181
tickTime=2000
dataDir=/opt/zk/zk/data
dataLogDir=/opt/zk/zk/logs
1.5、启动zk
[zk@master bin]$ pwd
/opt/zk/zk/bin
[zk@master bin]$ ./zkServer.sh start
1.6、客户端链接测试下:
[zk@master bin]$ pwd
/opt/zk/zk/bin
[zk@master bin]$ ./zkCli.sh -server localhost:2181
Connecting to localhost:2181
[zk: localhost:2181(CONNECTED) 0] ls /
[zookeeper]
[zk: localhost:2181(CONNECTED) 1] create /Test hellozk
Created /Test
[zk: localhost:2181(CONNECTED) 2] get /Test
[zk: localhost:2181(CONNECTED) 3] set /Test hellozookeeper
[zk: localhost:2181(CONNECTED) 4] get /Test
hellozookeeper
[zk: localhost:2181(CONNECTED) 5] delete /Test
[zk: localhost:2181(CONNECTED) 6] get /Test
Node does not exist: /Test
[zk: localhost:2181(CONNECTED) 7] quit
03:53:50,180 [myid:] - INFO
[main:ZooKeeper@968] - Session: 0x149c475d7db0000 closed
03:53:50,182 [myid:] - INFO
[main-EventThread:ClientCnxn$EventThread@529] - EventThread shut down
zookeeper的配置文件说明:
clientPort
# 客户端连接server的端口,即对外服务端口,一般设置为2181。
# 存储快照文件snapshot的目录。默认情况下,事务日志也会存储在这里。建议同时配置参数dataLogDir, 事务日志的写性能直接影响zk性能。
# ZK中的一个时间单元。ZK中所有时间都是以这个时间单元为基础,进行整数倍配置的。例如,session的最小超时时间是2*tickTime。
dataLogDir
# 事务日志输出目录。尽量给事务日志的输出配置单独的磁盘或是挂载点,这将极大的提升ZK性能。
globalOutstandingLimit
# 最大请求堆积数。默认是1000。ZK运行的时候, 尽管server已经没有空闲来处理更多的客户端请求了,但是还是允许客户端将请求提交到服务器上来,提高吞吐性能。当然,为了防止Server内存溢出,这个请求堆积数还是需要限制下的。
system property:zookeeper.globalOutstandingLimit.
preAllocSize
# 预先开辟磁盘空间,用于后续写入事务日志。默认是64M,每个事务日志大小就是64M。如果ZK的快照频率较大的话,建议适当减小这个参数。
# 每进行snapCount次事务日志输出后,触发一次快照(snapshot), 此时,ZK会生成一个snapshot.*文件,同时创建一个新的事务日志文件log.*。默认是100000.(真正的代码实现中,会进行一定的随机数处理,以避免所有服务器在同一时间进行快照而影响性能)。
# 用于记录所有请求的log,一般调试过程中可以使用,但是生产环境不建议使用,会严重影响性能
maxClientCnxns
# 单个客户端与单台服务器之间的连接数的限制,是ip级别的,默认是60,如果设置为0,那么表明不作任何限制。请注意这个限制的使用范围,仅仅是单台客户端机器与单台ZK服务器之间的连接数限制,不是针对指定客户端IP,也不是ZK集群的连接数限制,也不是单台ZK对所有客户端的连接数限制。
clientPortAddress # 对于多网卡的机器,可以为每个IP指定不同的监听端口。默认情况是所有IP都监听 clientPort 指定的端口。
minSessionTimeoutmaxSessionTimeout
# Session超时时间限制,如果客户端设置的超时时间不在这个范围,那么会被强制设置为最大或最小时间。默认的Session超时时间是在2 * tickTime ~ 20 * tickTime 这个范围 。
fsync.warningthresholdms
# 事务日志输出时,如果调用fsync方法超过指定的超时时间,那么会在日志中输出警告信息。默认是1000ms。
autopurge.purgeInterval
# 3.4.0及之后版本,ZK提供了自动清理事务日志和快照文件的功能,这个参数指定了清理频率,单位是小时,需要配置一个1或更大的整数,默认是0,表不开启自动清理功能
autopurge.snapRetainCount
# 这个参数和上面的参数搭配使用,这个参数指定了需要保留的文件数目。默认是保留3个。
electionAlg
#在之前的版本中, 这个参数配置是允许我们选择leader选举算法,但是由于在以后的版本中,只会留下一种“TCP-based version of fast leader election”算法,所以这个参数目前看来没有用了。
# Follower在启动过程中,会从Leader同步所有最新数据,然后确定自己能够对外服务的起始状态。Leader允许F在 initLimit 时间内完成这个工作。通常情况下,我们不用太在意这个参数的设置。如果ZK集群的数据量确实很大了,F在启动的时候,从Leader上同步数据的时间也会相应变长,因此在这种情况下,有必要适当调大这个参数了。
# 在运行过程中,Leader负责与ZK集群中所有机器进行通信,例如通过一些心跳检测机制,来检测机器的存活状态。如果L发出心跳包在syncLimit之后,还没有从F那收到响应,那么就认为这个F已经不在线了。注意:不要把这个参数设置得过大,否则可能会掩盖一些问题。
leaderServes
# 默认情况下,Leader是会接受客户端连接,并提供正常的读写服务。但是,如果你想让Leader专注于集群中机器的协调,那么可以将这个参数设置为no,这样一来,会大大提高写操作的性能。
server.X=A:B:C
# 其中X是一个数字, 表示这是第几号server. A是该server所在的IP地址. B配置该server和集群中的leader交换消息所使用的端口. C配置选举leader时所使用的端口. 这里的x是一个数字,与myid文件中的id是一致的。右边可以配置两个端口,第一个端口用于F和L之间的数据同步和其它通信,第二个端口用于Leader选举过程中投票通信。
group.x=nnnnn[:nnnnn]weight.x=nnnnn
# 对机器分组和权重设置,
cnxTimeout
# Leader选举过程中,打开一次连接的超时时间,默认是5s
zookeeper.DigestAuthenticationProvider.superDigest
# ZK权限设置相关
# 对所有客户端请求都不作ACL检查。如果之前节点上设置有权限限制,一旦服务器上打开这个开头,那么也将失效
# 这个参数确定了是否需要在事务日志提交的时候调用 FileChannel .force来保证数据完全同步到磁盘
jute.maxbuffer
# 每个节点最大数据量,是默认是1M。这个限制必须在server和client端都进行设置才会生效。
2、伪集群模式安装:
伪集群, 是指在单台机器中启动多个zookeeper进程, 并组成一个集群. 以启动3个zookeeper进程为例
2.1、拷贝zk目录,分别为zk2、zk3
[zk@master ~]$ cp -r zk zk2
[zk@master ~]$ cp -r zk zk3
2.2、分别修改配置文件
[zk@master conf]$ vim zoo.cfg
initLimit=10
syncLimit=5
clientPort=2181
tickTime=2000
dataDir=/opt/zk/zk/data
dataLogDir=/opt/zk/zk/logs
server.0=127.0.0.1:
server.1=127.0.0.1:
server.2=127.0.0.1:
分别修改其他俩个zk目录配置文件dataDir, dataLogDir, clientPort参数即可.
分别在zk、zk2、zk3、的dataDir中新建myid文件, 写入一个数字, 该数字表示这是第几号server. 该数字必须和zoo.cfg文件中的server.X中的X一一对应.
/opt/zk/zk/data/myid文件中写入0, /opt/zk/zk2/data/myid文件中写入1, /opt/zk/zk3/data/myid文件中写入2.
[zk@master ~]$ echo 0 & /opt/zk/zk/data/myid
[zk@master ~]$ echo 1 & /opt/zk/zk2/data/myid
[zk@master ~]$ echo 2 & /opt/zk/zk3/data/myid
2.3、分别启动
3、集群模式安装
集群模式的配置和伪集群基本一致.
由于集群模式下, 各server部署在不同的机器上, 因此各server的conf/zoo.cfg文件可以完全一样.
tickTime=2000
initLimit=5
syncLimit=2
dataDir=/opt/zk/zk/data
dataLogDir=/opt/zk/zk/logs
clientPort=2180
server.0=192.168.10.128:
server.1=192.168.10.129:
server.2=192.168.10.130:
示例文件部署了3台zookeeper server, 分别部署在192.168.10.128~130上. 需要注意的是, 各server的dataDir目录下的myid文件中的数字必须不同.
欢迎大家访问我的个人网站 萌萌的IT人
您对本文章有什么意见或着疑问吗?请到您的关注和建议是我们前行的参考和动力&&
您的浏览器不支持嵌入式框架,或者当前配置为不显示嵌入式框架。

我要回帖

更多关于 zookeeper下载 的文章

 

随机推荐