Kafka--HA搭建
[123]zkServer.sh start
[node123]# tar -xvf kafka_2.11-0.8.2.1.tgz
[node123]# cd kafka_2.11-0.8.2.1/config
[node123]# vi server.properties
{
broker.id=0
port=9092
log.dirs=/opt/kafka_2.11-0.8.2.1/kafka-logs
zookeeper.connect=node1:2181, node2:2181, node3:2181
}
[node2]# vi server.properties
{
broker.id=1
}
[node3]# vi server.properties
{
broker.id=2
}
[node123]# vi /etc/profile
{
# 添加
export KAFKA_HOME=/opt/kafka_2.11-0.8.2.1
export PATH=$KAFKA_HOME/bin:$PATH
}
[node123]# source /etc/profile
# 启动kafka
[node1]# kafka-server-start.sh /opt/kafka_2.11-0.8.2.1/config/server.properties
[node2]# kafka-server-start.sh /opt/kafka_2.11-0.8.2.1/config/server.properties
[node3]# kafka-server-start.sh /opt/kafka_2.11-0.8.2.1/config/server.properties
# 关闭kafka
kafka-server-stop.sh stop
本文来自博客园,作者:jsqup,转载请注明原文链接:https://www.cnblogs.com/jsqup/p/16673098.html