kafka集群环境搭建
# 准备zookeeper环境 (zookeeper-3.4.6)
# 下载kafka安装包
https://archive.apache.org/dist/kafka/2.1.0/kafka_2.12-2.1.0.tgz
# 上传 : 172.16.144.133
cd /usr/local/software
tar -zxvf /usr/local/software/kafka_2.12-2.1.0.tgz -C /usr/local
cd /usr/local
mv kafka_2.12-2.1.0 kafka_2.12
## 3修改kafka配置文件
vim /usr/local/kafka_2.12/config/server.properties
##修改内容:
## The id of the broker. This must be set to a unique integer for each broker
broker.id=0 #kafka的id不能相同 默认是0
port=9092 # 默认没有 自己加就可以了
host.name=172.16.144.133
dvertised.host.name=172.16.144.133
log.dirs=/usr/local/kafka_2.12/kafka-logs # 日志文件 存储数据实际位置 log日志
num.partitions=5
## 连接zookeeper
zookeeper.connect=172.16.144.133:2181,172.16.144.134:2181,172.16.144.135:2181
## 4创建kafka存储消息(1og日志数据)的目录
mkdir /usr/local/kafka_2.12/kafka-logs
## 5到此为止,kafka已经配置成功,执行启动命令,启动kafka
/usr/local/afka_2.12/bin/kafka-server-start.sh /usr/local/kafka_2.12/config/server.properties &
/usr/local/afka_2.12/bin/kafka-server-stop.sh
成功标志