Pulsar configuration
本篇博文主要介绍Pulsar configuration中有关zookeeper的参数。
Zookeeper
- Zookeeper在Pulsar中扮演着重要的角色,主要用于处理各种必须的配置以及各组件间协调性相关的task;
- Pulsar中的默认配置文件为:
conf/zookeeper.conf
参数名 | 含义 | 默认值 |
---|---|---|
tickTime | tick是Zookeeper的基本时间单位,为毫秒值,经常用于周期性事件,如:heartbeats、timeout。 | 2000 |
initLimit | Zookeeper leader节点允许follower节点向其发送成功连接和同步的最大时间,为毫秒值,通过tickTime参数进行设置。 | 10 |
syncLimit | Zookeeper follower节点与其他Zookeeper节点进行同步的最大时间,为毫秒值,通过tickTime参数进行设置。 | 5 |
dataDir | Zookeeper中用于在内存中存贮database的快照和更新database事务日志的位置 | data/zookeeper |
clientPort | Zookeeper节点用于监听连接的端口号 | 2181 |
autopurge.snapRetainCount | 决定了Zookeeper中在指定时间间隔内dataDir中可以存储的最近快照的数量,时间间隔由参数autopurge.purgeInterval设定。 | 3 |
autopurge.purgeInterval | 用于指定Zookeeper database清理任务触发的时间间隔,非0值来激活该设置,0为禁用该设置。 | 1 |
maxClientCnxns | 客户端可连接的最大数量,可通过增大该值来允许更多的客户端连接。 | 60 |
除了上表中的参数,在
conf/zookeeper.conf
还需要添加Zookeeper的节点信息,如下示例:
server.1=zk1.us-west.example.com:2888:3888
server.2=zk2.us-west.example.com:2888:3888
server.3=zk3.us-west.example.com:2888:3888