2.2.2 生产者命令行操作
1)查看操作生产者命令参数
[atguigu@hadoop102 kafka]$ bin/kafka-console-producer.sh
2)发送消息
[atguigu@hadoop102 kafka]$
bin/kafka-console-producer.sh --bootstrap-server hadoop102:9092 --topic first
>hello world
>atguigu atguigu
2.2.3 消费者命令行操作
1)查看操作消费者命令参数
[atguigu@hadoop102 kafka]$ bin/kafka-console-consumer.sh
(1)消费 first 主题中的数据。
[atguigu@hadoop102
kafka]$ bin/kafka-console-consumer.sh --bootstrap-server hadoop102:9092 --topic first
(2)把主题中所有的数据都读取出来(包括历史数据)。
[atguigu@hadoop102
kafka]$ bin/kafka-console-consumer.sh --bootstrap-server hadoop102:9092 --from-beginning --topic first