Confluent:修订间差异
跳到导航
跳到搜索
此页面具有访问限制。如果您看见此消息,则说明您没有权限访问此页面。
第50行: | 第50行: | ||
== 設定Kafka == | == 設定Kafka == | ||
如果[[ZooKeeper]]與[[Kafka]]不同伺服器,需要修改<code>/etc/kafka/server.properties</code>的<code>zookeeper.connect</code>的值,像是這樣: | |||
<syntaxhighlight lang="ini"> | |||
#zookeeper.connect=localhost:2181 | |||
zookeeper.connect=internal-test-gslin-confluent-xxxxxxxxx.us-east-1.elb.amazonaws.com:2181 | |||
</syntaxhighlight> | |||
修改<code>/etc/kafka/server.properties</code>的<code>broker.id</code>設定,讓他自動產生而不需要自己指定: | |||
<syntaxhighlight lang="bash"> | |||
#broker.id=0 | |||
broker.id.generation.enable=true | |||
</syntaxhighlight> | |||
== 相關連結 == | == 相關連結 == |
2019年3月5日 (二) 21:04的版本
Confluent是一家公司,也是该公司的Apache Kafka产品名。
安装
当然要先装Java:
sudo apt install -y default-jre
这边只安装社群版本:
wget -qO - https://packages.confluent.io/deb/5.1/archive.key | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://packages.confluent.io/deb/5.1 stable main"
sudo apt install -y confluent-community-2.11
设定ZooKeeper
修改/etc/kafka/zookeeper.properties
:
#
tickTime=2000
dataDir=/var/lib/zookeeper/
clientPort=2181
initLimit=5
syncLimit=2
server.1=1.2.3.4:2888:3888
server.2=5.6.7.8:2888:3888
server.3=9.10.11.12:2888:3888
autopurge.snapRetainCount=3
autopurge.purgeInterval=24
新增/var/lib/zookeeper/myid
,每一台都需要不同,1
或2
或3
:
1
然后修改档案拥有人:
sudo chown cp-kafka:confluent /var/lib/zookeeper/myid
接下来可以将TCP Port 2181建立对应的TCP Load Balancer(像是用ELB)。
设定Kafka
如果ZooKeeper与Kafka不同服务器,需要修改/etc/kafka/server.properties
的zookeeper.connect
的值,像是这样:
#zookeeper.connect=localhost:2181
zookeeper.connect=internal-test-gslin-confluent-xxxxxxxxx.us-east-1.elb.amazonaws.com:2181
修改/etc/kafka/server.properties
的broker.id
设定,让他自动产生而不需要自己指定:
#broker.id=0
broker.id.generation.enable=true