31z4 / zookeeper-docker

Docker image packaging for Apache Zookeeper
MIT License
285 stars 243 forks source link

Chown Operation not permitted #136

Open xgengsjc2021 opened 2 years ago

xgengsjc2021 commented 2 years ago

Before you file an issue here, please keep in mind that your issue may be not related to the image itself. Please make sure that it is, otherwise report the issue upstream.

I am using this official image to build zookeeper cluster but failed with some permission issue.

image: "docker.io/zookeeper:3.8.0"
+ chown -Rv zookeeper /var/lib/zookeeper/data /var/lib/zookeeper/datalog /logs /conf
chown: changing ownership of '/var/lib/zookeeper/data/myid': Operation not permitted
chown: changing ownership of '/var/lib/zookeeper/data': Operation not permitted
failed to change ownership of '/var/lib/zookeeper/data/myid' from 1017 to zookeeper
failed to change ownership of '/var/lib/zookeeper/data' from 1017 to zookeeper
chown: changing ownership of '/var/lib/zookeeper/datalog': Operation not permitted
failed to change ownership of '/var/lib/zookeeper/datalog' from 1017 to zookeeper

Expected behavior

All 3 replicas of zookeeper pods should be up and running

Actual behavior

All 3 pods are CrashLoopBackOff and keep restart

NAME          READY   STATUS             RESTARTS         AGE
zookeeper-0   0/1     CrashLoopBackOff   19 (3m43s ago)   75m
zookeeper-1   0/1     CrashLoopBackOff   19 (3m28s ago)   75m
zookeeper-2   0/1     CrashLoopBackOff   6 (3m33s ago)    9m16s

Steps to reproduce the behavior

I followed up this https://github.com/Altinity/clickhouse-operator/blob/master/deploy/zookeeper/advanced/05-stateful-set-persistent-volume.yaml just applied this yaml file in my AWS EKS cluster. From this yaml file, you can see, they added a series of commands during the container installation. One of them is,

chown -Rv zookeeper "$ZOO_DATA_DIR" "$ZOO_DATA_LOG_DIR" "$ZOO_LOG_DIR" "$ZOO_CONF_DIR" &&
zkServer.sh start-foreground

Details of commands, can be found in the link above.

System configuration

Please include as much relevant information as possible.

AWS EKS