当前位置:   article > 正文

org.apache.zookeeper.KeeperException$InvalidACLException: KeeperErrorCode = InvalidACL for /f_kafka创建主题报错keepererrorcode=invalidacl

kafka创建主题报错keepererrorcode=invalidacl

spark streaming中更新数据到zookeeper,第一次更新的时候可能会报如上错(from kafka_0.9),


解决方案就是在测试过程中临时加入如下代码: 目的是创建相对应的文件夹

ZkUtils(zkClient, false).updatePersistentPath(path="/consumers/groupId", data="groupId")
ZkUtils(zkClient, false).updatePersistentPath(path="/consumers/groupId/offsets", data="offset")
ZkUtils(zkClient, false).updatePersistentPath("/consumers/groupIdoffsets/topic1",  "partiiton=12")
ZkUtils(zkClient, false).updatePersistentPath("/consumers/groupId/offsets/topic2",  "partition=3")

// 提交部分    

val zkPath = s"${topicDir.consumerOffsetDir}/${o.partition}"
ZkUtils(zkClient, isZkSecurityEnabled=false).updatePersistentPath(zkPath, offset)

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/空白诗007/article/detail/784293
推荐阅读
相关标签
  

闽ICP备14008679号