Yolean/kubernetes-kafka

zookeeper "datadir-pzoo-0" not found

zhiquan111 opened this issue · 4 comments

When I deploy zookeeper. There's the following error:
persistentvolumeclaim "datadir-pzoo-0" not found
Back-off restarting failed container
I check the volume, datadir-pzoo-0 is OK
持久化存储卷声明:
名称 状态 存储卷 总量 访问模式 存储类 已创建
datadir-pzoo-0 Bound pvc-9e98c644-1499-11e9-b66a-52540025d03a 15Gi ReadWriteOnce slow 59 秒

when I check the init-config log. The following errors exist:

  • '[' -z '' ']'
  • ID_OFFSET=1
  • export ZOOKEEPER_SERVER_ID=1
  • ZOOKEEPER_SERVER_ID=1
  • tee /var/lib/zookeeper/data/myid
  • echo 1
    1
  • sed -i 's/server.1=[a-z0-9.-]*/server.1=0.0.0.0/' /etc/kafka/zookeeper.properties
    sed: couldn't open temporary file /etc/kafka/sedWSc4Uk: Read-only file system

I have changed 50pzoo.yml
volumeClaimTemplates:

  • metadata:
    name: data
    spec:
    accessModes: [ "ReadWriteOnce" ]
    storageClassName: slow
    resources:
    requests:
    storage: 1Gi

persistentvolumeclaim "datadir-pzoo-0" not found

This error seems to be at the kubernetes level, i.e. before the init container starts. Nevertheless you have output from the init container, which is strange. Maybe the first error was transient, because it takes time to provision a volume. You have to check if PersistentVolume and PersistentVolumeClaim is created.

sed: couldn't open temporary file /etc/kafka/sedWSc4Uk: Read-only file system

This would happen in older releases of this repo with new k8s versions.

I update the package to the newest. Then the problem disappear.
Thanks