kafka入门学习---1 启动kakfa

1.查看kafka生产者产生的数据

kafka-console-consumer.sh  --zookeeper hadoop-2:2181,hadoop-3:2181,hadoop-5:2181 -topic kafkademo --from-beginning

2.管道符命令。查看最进使用关于带有kafka关键字的命令

 history|grep kafka

3.配置本机与远程机

 tail -100 /usr/local/hadoop/hadoop-2.7.3/logs/hadoop-root-namenode-hadoop-4.out

 

1.kafka简单的消费命令

kafka-console-consumer.sh --zookeeper hadoop-2:2181,hadoop-3:2181,hadoop-5:2181 -topic kafkademo --from-beginning

 2.打印kafka所有的主题

kafka-topics.sh --zookeeper hadoop-2:2181 --list

 3.查看kafka最大的分区(Offset)

kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list hadoop-2:9092 -topic kafkademo --time -1

 1.启动kafak会提示 -bash: kafka-server-start.sh: command not found.这时就需要进入kafka的bin中启动.因为下面是脚本驱动的

 

kafka-server-start.sh /usr/local/kafka_2.11-0.10.0.1/config/server.properties > /usr/local/kafka_2.11-0.10.0.1/logs/logs &

 

 

posted @ 2018-03-12 15:59  努力中国  阅读(464)  评论(0编辑  收藏  举报