开发者社区> 问答> 正文

kafka 执行Consumer的时候,发生异常。Could not retri?报错

我在linux端部署了一个zookeeper和kafka服务,都是单个的服务,不是集群。然后我在网上找的producer例子,向topic放入数据是没有问题的,但是我执行Consumer的时候,总是报错。请大神帮忙。

10:47:19.493 [main] DEBUG org.apache.zookeeper.ClientCnxn - zookeeper.disableAutoWatchReset is false
10:47:19.526 [main-SendThread(vm-vmw674-t:2181)] INFO  org.apache.zookeeper.ClientCnxn - Opening socket connection to server vm-vmw674-t/10.6.50.53:2181. Will not attempt to authenticate using SASL (无法定位登录配置)
10:47:19.531 [main-SendThread(vm-vmw674-t:2181)] INFO  org.apache.zookeeper.ClientCnxn - Socket connection established to vm-vmw674-t/10.6.50.53:2181, initiating session
10:47:19.533 [main-SendThread(vm-vmw674-t:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Session establishment request sent on vm-vmw674-t/10.6.50.53:2181
10:47:19.534 [main-SendThread(vm-vmw674-t:2181)] DEBUG o.a.z.client.ZooKeeperSaslClient - Could not retrieve login configuration: java.lang.SecurityException: 无法定位登录配置
10:47:19.573 [main-SendThread(vm-vmw674-t:2181)] INFO  org.apache.zookeeper.ClientCnxn - Session establishment complete on server vm-vmw674-t/10.6.50.53:2181, sessionid = 0x14ca14ee6d70003, negotiated timeout = 6000
10:47:19.574 [main-SendThread(vm-vmw674-t:2181)] DEBUG o.a.z.client.ZooKeeperSaslClient - Could not retrieve login configuration: java.lang.SecurityException: 无法定位登录配置

展开
收起
爱吃鱼的程序员 2020-06-14 16:49:52 662 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    修改一下你hosts得映射

    回复 @呼啦_小呆:这个怎么看啊。下面第三个答案是我的配置信息,因为太长了,给你发不了。你帮我看下吧,谢谢了回复 @初级屌丝:看一下你zoo.cfg的配置对不对是不是用得机器名我在Windows端中hosts中已经设置了啊。。。如下#Forexample:#localhostnameresolutionishandledwithinDNSitself.#127.0.0.1localhost#::1localhost10.6.50.53vm-vmw674-t​这样设置不对吗

    我在Windows端中hosts中已经设置了啊。。。如下


    #Forexample:
    #
    #   102.54.94.97  rhino.acme.com     #sourceserver
    #   38.25.63.10  x.acme.com       #xclienthost


    #localhostnameresolutionishandledwithinDNSitself.
    #127.0.0.1   localhost
    #::1      localhost
    10.6.50.53vm-vmw674-t
    这样设置不对吗

    #Thenumberofmillisecondsofeachtick
    tickTime=2000
    #Thenumberofticksthattheinitial 
    #synchronizationphasecantake
    initLimit=10
    #Thenumberofticksthatcanpassbetween 
    #sendingarequestandgettinganacknowledgement
    syncLimit=5
    #thedirectorywherethesnapshotisstored.
    #donotuse/tmpforstorage,/tmphereisjust 
    #examplesakes.
    dataDir=/opt/app/dev/liht/zookeeper-3.4.6/data_zk
    server.1=10.6.50.53:2888:3888
    #theportatwhichtheclientswillconnect
    clientPort=2181
    #themaximumnumberofclientconnections.
    #increasethisifyouneedtohandlemoreclients
    #maxClientCnxns=60
    #
    #Besuretoreadthemaintenancesectionofthe 
    #administratorguidebeforeturningonautopurge.
    #
    #http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
    #
    #ThenumberofsnapshotstoretainindataDir
    #autopurge.snapRetainCount=3
    #Purgetaskintervalinhours
    #Setto"0"todisableautopurgefeature
    #autopurge.purgeInterval=1
    这个事zoo.cfg配置文件,你帮我看下,有什么不对吗有一个折中的办法,就是把日志级别由debug改为info和log4j.logger.org.apache.zookeeper=info
    我也遇到这样问题改了之后不行

    2018-02-2717:05:19DEBUG: Gotpingresponseforsessionid:0x161d64b0b380001after3ms
    2018-02-2717:05:19DEBUG: Couldnotretrieveloginconfiguration:java.lang.SecurityException:无法定位登录配置;;

    我也遇到了,

    2020-06-15 11:05:49
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Java Spring Boot开发实战系列课程【第16讲】:Spring Boot 2.0 实战Apache Kafka百万级高并发消息中间件与原理解析 立即下载
MaxCompute技术公开课第四季 之 如何将Kafka数据同步至MaxCompute 立即下载
消息队列kafka介绍 立即下载