关于kafka的简单常用的命令

1、kafka bin 目录路径:/xxxx/kafka_2.11-1.0.0/bin

2、搭载zookeeper的主机名与端口:xxxxx:2181

1、2 按照自己的服务器配置

 

kafka 创建主题

 

/xxxx/kafka_2.11-1.0.0/bin/kafka-topics.sh --create --zookeeper xxxxx:2181/kafka --replication-factor 1 --partitions 4 --topic xxxxx

 

 

kafka 查看主题列表

 

/xxxx/kafka_2.11-1.0.0/bin/kafka-topics.sh --list --zookeeper xxxxx:2181//kafka

 

 

kafka生产者命令

 

/xxxx/kafka_2.11-1.0.0/bin/kafka-console-producer.sh --broker-list xxxxx:2181 --topic meyao

 

kafka消费者查看命令

 

/xxxx/kafka_2.11-1.0.0/bin/kafka-console-consumer.sh --bootstrap-server xxxx:9092 --topic meyao

 

你可能感兴趣的:(Linux,常见命令)