Kafka 3 默认 state.dir 的 AccessDeniedException
当我们在 Windows 10 上运行 Kafka 时,每 5 秒就会出现以下错误。
无法将全局存储的偏移检查点文件写入 C:/tmp/kafka-streams/user/global/.checkpoint:{}。如果操作系统清理了位于(默认)${java.io.tmpdir}/kafka-streams 目录中的 state.dir,则可能会发生这种情况。更改 state.dir 的位置可能会解决该问题。
java.nio.file.AccessDeniedException:C:/tmp/kafka-streams/user/global
这是我们的 Gradle。在撰写本文时,这将默认导入 3.0 版本。
api 'org.apache.kafka:kafka-streams'
api 'org.apache.kafka:kafka-clients'
我已经检查了文件夹权限,它似乎对 kafka-streams 子文件夹是只读的。即使我改变它,它也会变回只读。
环境
JDK 17.0.2
Kafka 3.0
Windows 10
The following error would appear every 5 seconds when we have Kafka running on Windows 10.
Failed to write offset checkpoint file to C:/tmp/kafka-streams/user/global/.checkpoint for global stores: {}. This may occur if OS cleaned the state.dir in case when it is located in the (default) ${java.io.tmpdir}/kafka-streams directory. Changing the location of state.dir may resolve the problem.
java.nio.file.AccessDeniedException: C:/tmp/kafka-streams/user/global
Here is our Gradle. At the time of writing, this will import the 3.0 version by default.
api 'org.apache.kafka:kafka-streams'
api 'org.apache.kafka:kafka-clients'
I have checked the folder permissions and it seems be to read-only for the kafka-streams
subfolders. Even if I change that, it'd go back to read-only.
Environment
JDK 17.0.2
Kafka 3.0
Windows 10
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当我将 Kafka 版本升级到 3.1.0 时,警告立即消失。我无法弄清楚原因是什么。
The warnings disappeared immediately when I bumped the Kafka version to
3.1.0
. I couldn't figure out what the cause was.