Kafka 搭建
官方文档
http://kafka.apache.org/quickstart
下载
kafka http://kafka.apache.org/downloads
wget http://mirrors.tuna.tsinghua.edu.cn/apache/kafka/0.11.0.0/kafka_2.11-0.11.0.0.tgz tar -zxf kafka_2.11-0.11.0.0.tgz mv kafka_2.11-0.11.0.0 /usr/local/
编辑配置文件
三个实例,准备配置文件
cp config/server.properties config/server-1.properties cp config/server.properties config/server-2.properties
配置文件1:
vim config/server.properties
broker.id=0 listeners=PLAINTEXT://10.1.1.1:9092
配置文件2:
vim config/server-1.properties
broker.id=1 listeners=PLAINTEXT://10.1.1.2:9093
配置文件3:
vim config/server-2.properties
broker.id=2 listeners=PLAINTEXT://10.1.1.3:9094
启动 kafka*
cd /usr/local/kafka_2.11-0.11.0.0/ # zookeeper bin/zookeeper-server-start.sh config/zookeeper.properties 1>/dev/null 2>&1 & # 3个实例 bin/kafka-server-start.sh config/server.properties 1>/dev/null 2>&1 & bin/kafka-server-start.sh config/server-1.properties 1>/dev/null 2>&1 & bin/kafka-server-start.sh config/server-2.properties 1>/dev/null 2>&1 &