博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
kafka消费者报错:Consider using the new consumer by passing [bootstrap-server] instead of [zookeeper].
阅读量:4280 次
发布时间:2019-05-27

本文共 1158 字,大约阅读时间需要 3 分钟。

一、问题描述

环境:kafka_2.11-0.10.2.1

Kafka开启生产者和消费者,当生产者发出消息的时候,消费者报错,而之前采用kafka_2.10-0.8.2.1运行该消费者的时候有没有问题:
root@hadoop kafka_2.11-0.10.2.1]# bin/kafka-console-consumer.sh --topic dayu --zookeeper hadoop:2181/kafka10_01
Using the ConsoleConsumer with old consumer is deprecated and will be removed in a future major release. Consider using the new consumer by passing [bootstrap-server] instead of [zookeeper].
[2020-03-01 16:55:19,994] WARN [ConsumerFetcherThread-console-consumer-11986_hadoop-1583052858368-33af0818-0-2], Error in fetch kafka.consumer.ConsumerFetcherThread$FetchRequest@66bc1f66 (kafka.consumer.ConsumerFetcherThread)

二、问题原因

kafka_2.11-0.10.2.1升级了消费者命令,采用bootstrap-server参数,而不是之前的zookeeper参数。其实报错里面已经很清楚了。

三、解决办法

1.准备

(1)创建topic

bin/kafka-topics.sh --create --topic dayu --zookeeper hadoop:2181/kafka10_01 --partitions 1 --replication-factor 1

(2)查看topic

bin/kafka-topics.sh --list --zookeeper hadoop:2181/kafka10_01

2.开启producer

bin/kafka-console-producer.sh --broker-list hadoop:9092 --topic dayu

3.开启消费者,同时从生产者输入sdf sdf  sdf

[root@hadoop kafka_2.11-0.10.2.1]# bin/kafka-console-consumer.sh --bootstrap-server hadoo9092 --topic dayusdf sdf  sdf

 

转载地址:http://ecygi.baihongyu.com/

你可能感兴趣的文章
流媒体开发之–HLS–M3U8解析(1)
查看>>
environ用户环境
查看>>
Linux tcpdump命令详解
查看>>
changed default gateway
查看>>
html5 input video url
查看>>
html5 controls property
查看>>
How to find a directory on linux?
查看>>
英文2014.02.07
查看>>
LDD3
查看>>
makefile shell function
查看>>
LDD3分析(第四章)
查看>>
ubuntu12.04 使用dhcp去重新要ip 與 釋放ip
查看>>
Ubuntu 12.04 下安装ncurses-devel
查看>>
dos2unix, unix2dos
查看>>
ubuntu 12.04 安装wireshark
查看>>
Linux 下找出超過某些容量的檔案
查看>>
Essential Linux Device Drivers(source code)
查看>>
minicom runscript
查看>>
linux expect
查看>>
Makefile 函數使用
查看>>