解压重命名等步骤略过,这些在Linux下通用操作,不懂问百度
修改/data/kafka/config/server.properties,主要有以下
host.name=192.168.147.132
broker.id=0
port=9092
listeners=PLAINTEXT://192.168.147.132:9092
advertised.listeners=PLAINTEXT://192.168.147.132:9092
log.dirs=/data/kafka/tmp/kafka-logs
zookeeper.connect=localhost:2181
方便的话,编写一个启动脚本,不然每次挨个启动Zookeeper和Kafka,甚是麻烦
kafkastart.sh
!/bin/sh
sh $zookeeper_home/bin/zkServer.sh start &
sleep 12
sh /data/app/kafka/bin/kafka-server-start.sh /data/app/kafka/config/server.properties &
sh kafka-topics.sh --create --zookeeper 192.168.147.129:2181 --replication-factor 1 --partitions 1 --topic wongs
sh kafka-topics.sh --list --zookeeper 192.168.147.129:2181