1.查看kafka生产者产生的数据
kafka-console-consumer.sh --zookeeper hadoop-:,hadoop-:,hadoop-: -topic kafkademo --from-beginning
2.管道符命令。查看最进使用关于带有kafka关键字的命令
history|grep kafka
3.配置本机与远程机
tail - /usr/local/hadoop/hadoop-2.7./logs/hadoop-root-namenode-hadoop-.out
1.kafka简单的消费命令
kafka-console-consumer.sh --zookeeper hadoop-:,hadoop-:,hadoop-: -topic kafkademo --from-beginning
2.打印kafka所有的主题
kafka-topics.sh --zookeeper hadoop-: --list
3.查看kafka最大的分区(Offset)
kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list hadoop-: -topic kafkademo --time -
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 &