kafka集群安装部署

kakfa集群部署
 
实验室3台机器:34,35,36
 
1、到官网 http://kafka.apache.org/下载安装包kafka_2.12-1.1.0.tgz
 
2、解压到36服务器:
cd  /utxt/soft/qydx
tar -zxvf  kafka_2.12-1.1.0.tgz 
 
3、cd kafka_2.12-1.1.0/config
 
4 、修改配置文件:vi server.properties
 
broker.id=0
host.name=192.168.150.36
port=9097
advertised.host.name=192.168.150.36
 
delete.topic.enable=true
advertised.listeners= PLAINTEXT://192.168.150.36:9097
log.dirs=/utxt/soft/qydx/kafka_2.12-1.1.0/kafka-logs
num.partitions=10
# zookeeper集群的ip端口
zookeeper.connect=192.168.150.34:4181,192.168.150.35:4181,192.168.150.36:4181
zookeeper.connection.timeout.ms=100000
default.replication.factor=2
auto.create.topics.enable=true
如下图所示:
kafka集群安装部署_第1张图片

 

kafka集群安装部署_第2张图片

 kafka集群安装部署_第3张图片

 

5、将kafka_2.12-1.1.0文件夹复制到另外两台节点下
scp -r kafka_2.12-1.1.0 @192.168.150.35:/utxt/soft/qydx/
scp -r kafka_2.12-1.1.0 @192.168.150.34:/utxt/soft/qydx/
 
并修改每个节点对应的server.properties文件的broker.id和listenrs
35:
     broker.id=1
    advertised.listeners= PLAINTEXT://192.168.150.35:9097
34: 
    broker.id=2
    advertised.listeners= PLAINTEXT://192.168.150.34:9097

你可能感兴趣的:(kafka集群安装部署)