MAPREDUCE服务 MRS-执行Kafka Topic创建操作时发现无法创建提示“NoNode for /brokers/ids”:原因分析

时间:2024-08-27 10:23:52

原因分析

  1. 使用客户端命令,打印NoNodeException异常。
    Error while executing topic command : org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /brokers/ids
    [2017-09-17 16:35:28,520] ERROR org.I0Itec.zkclient.exception.ZkNoNodeException: org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /brokers/ids
    	at org.I0Itec.zkclient.exception.ZkException.create(ZkException.java:47)
    	at org.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:995)
    	at org.I0Itec.zkclient.ZkClient.getChildren(ZkClient.java:675)
    	at org.I0Itec.zkclient.ZkClient.getChildren(ZkClient.java:671)
    	at kafka.utils.ZkUtils.getChildren(ZkUtils.scala:541)
    	at kafka.utils.ZkUtils.getSortedBrokerList(ZkUtils.scala:176)
    	at kafka.admin.AdminUtils$.createTopic(AdminUtils.scala:235)
    	at kafka.admin.TopicCommand$.createTopic(TopicCommand.scala:105)
    	at kafka.admin.TopicCommand$.main(TopicCommand.scala:60)
    	at kafka.admin.TopicCommand.main(TopicCommand.scala)
  2. 通过Manager查看Kafka服务是否处于正常状态。
  3. 检查客户端命令中ZooKeeper地址是否正确,访问ZooKeeper上所存放的Kafka信息,其路径(Znode)应该加上/kafka,发现配置中缺少/kafka:
    [root@10-10-144-2 client]# 
    kafka-topics.sh --create  --replication-factor 1 --partitions 2 --topic test --zookeeper 192.168.234.231:2181
support.huaweicloud.com/trouble-mrs/mrs_03_0123.html