您的位置:首页 > 运维架构 > Apache

org.apache.zookeeper.KeeperException$InvalidACLException: KeeperErrorCode = InvalidACL for /f

2017-10-26 18:07 4852 查看
在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)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐