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

时间:2021-12-09 16:47:28

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

kafka-console-consumer.sh  --zookeeper hadoop-:,hadoop-:,hadoop-: -topic kafkademo --from-beginning

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

 history|grep kafka

3.配置本机与远程机

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

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

 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入门学习---1  启动kakfa

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 &

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