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