1、找到kafka官网 http://kafka.apache.org/
2、下载 wget http://mirror.bit.edu.cn/apache/kafka/2.1.0/kafka_2.12-2.1.0.tgz
3、解压 tar -zxvf kafka
4、修改配置文件 server.properties
以server.properties 为基础,cp 三个配置,分别server1.properties 、server2.properties 、server3.properties
分别修改配置
s1:broker.id=0
port=9092
advertised.listeners=PLAINTEXT://47.110.55.185:9092
log.dirs=/usr/local/kafka/broker1
s2:broker.id=1
port=9093
advertised.listeners=PLAINTEXT://47.110.55.185:9093
log.dirs=/usr/local/kafka/broker2
s3:broker.id=2
port=9094
advertised.listeners=PLAINTEXT://47.110.55.185:9094
log.dirs=/usr/local/kafka/broker3
5、启动
./kafka-server-start.sh -daemon ../config/server1.properties
./kafka-server-start.sh -daemon ../config/server2.properties
./kafka-server-start.sh -daemon ../config/server3.properties
分别启动,如果报错,
free -m 查看是不是内存不足