搭建kafka cluster
机器A和B,假设hostname和ip都是A, B
首先都下载kafka
wget http://www-eu.apache.org/dist/kafka/1.0.0/kafka_2.11-1.0.0.tgz
tar xzvf kafka_2.11-1.0.0.tgz
并且在A上安装好zookeeper,并且设kafka-A的zk为A:2181
A机器保持原样,去B机器修改config/server.properties
# 这个一定要设置,因为A是默认的0,要不一样 broker.id=1 # 这里设zk zookeeper.connect=A:2181
然后启动即可。因为都注册到一个zk,所以组成cluster,2个broker
在任意一个broker上都可以操作topic
#创建一个普通topic bin/kafka-topics.sh --create --zookeeper localhost:2181 --partitions 1 --topic test #创建一个多节点的topic bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 2 --partitions 1 --topic test_cluster
sort of, I have some experience in the domain of database(MySQL/mongo), java, python, front-end, etc. I'll willing to give and accept bits of help from others.
now base in Singapore.