//获取
wget https://dlcdn.apache.org/kafka/2.8.0/kafka_2.12-2.8.0.tgz
//解压
tar -zxvf kafka_2.12-2.8.0.tgz
//移动
mv kafka_2.12-2.8.0 kafka
//配置外网访问
vi server.properties
listeners=PLAINTEXT://0.0.0.0:9092
advertised.listeners=PLAINTEXT://***:9092 //***标识外网ip
//启动zookeeper
./bin/zookeeper-server-start.sh -daemon config/zookeeper.properties
//启动kafka
./bin/kafka-server-start.sh -daemon config/server.properties
# 列出现有的主题
kafka-topics.sh --list --zookeeper localhost:2181/myKafka
# 创建主题,该主题包含一个分区,该分区为Leader分区,它没有Follower分区副本。
kafka-topics.sh --zookeeper localhost:2181/myKafka --create
--topic topic_1 --partitions 1 --replication-factor 1
# 查看分区信息
kafka-topics.sh --zookeeper localhost:2181/myKafka --list
# 查看指定主题的详细信息
kafka-topics.sh --zookeeper localhost:2181/myKafka --describe --topic topic_1
# 删除指定主题
kafka-topics.sh --zookeeper localhost:2181/myKafka --delete --topic topic_1
centos7 安装kafka
最新推荐文章于 2025-04-01 19:42:56 发布