公司很多产品有在使用Kafka进行数据的处理,因为各种原因,没有在产品中有用到这快,偶尔,自己去研究下,做个文档进行记录:
本文是在一个机器上进行的kafka集群,分为三个节点,并且测试peoducer、cunsumer在正常和非正常情况下的测试:
1. 下载和安装Kafka
> mkdir kafka
> cd kafka
> wget https://archive.apache.org/dist/kafka/0.8.0/kafka_2.8.0-0.8.0.tar.gz
> tar -xzvf kafka_2.8.0-0.8.0.tar.gz
Ok,Kafka安装完成,比较简单。
2. 启动单节点的zookeeper
> $ nohup bin/zookeeper-server-start.sh config/zookeeper.properties &
3. 准备启动一个3个broker节点的kafka集群,因此做如下配置
>cp config/server.properties config/server-1.properties
>cp config/server.properties config/server-2.properties
修改下面的如下参数:
server-