Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.2.0
-
- Ubuntu 20.04.3 LTS
- Docker Engine - Community Version 20.10.12
- Kubernetes Server v1.21.1, Client v1.22.4
- AMD Ryzen 9 5900HX with Radeon Graphics
-
Patch
Description
The "scm" StatefulSet never starts with a self-built Docker container image.
We can build our custom Docker image by running Maven like:
$ mvn -Pdocker -Ddocker.image=pfnmaru/ozone:1.3.0-SNAPSHOT -DskipTests -Pdist clean package
But we cannot start any StatefulSets under the "kubernetes/examples" directory. For example:
$ cd hadoop-ozone/dist/target/ozone-1.3.0-SNAPSHOT/kubernetes/examples/ozone $ kubectl apply -f config-configmap.yaml configmap/config created $ kubectl apply -f scm-statefulset.yaml statefulset.apps/scm created $ kubectl get pods NAME READY STATUS RESTARTS AGE scm-0 0/1 Init:Error 2 21s $ kubectl get pods NAME READY STATUS RESTARTS AGE scm-0 0/1 Init:CrashLoopBackOff 2 33s $ kubectl logs scm-0 -c init /opt/hadoop/libexec/entrypoint.sh: line 162: exec: ozone: not found
As we can see from the above log, the initial container cannot be succeeded since the "ozone" executable file doesn't exist within its PATH environment variable.
docker inspect command reveals the reason. The PATH environment variable in the container image's metadata looks like this:
"Env": [ "PATH=/opt/hadoop/libexec:/opt/hadoop/bin:/home/maru/.sdkman/candidates/scala/current/bin:/home/maru/.sdkman/candidates/maven/current/bin:/home/maru/.sdkman/candidates/java/current/bin:/home/maru/.goenv/versions/1.17.5/bin:/home/maru/.goenv/shims:/home/maru/.goenv/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/maru/go/1.17.5/bin", "JAVA_HOME=/usr/lib/jvm/jre/", "LD_LIBRARY_PATH=/usr/local/lib", "HADOOP_LOG_DIR=/var/log/hadoop", "HADOOP_CONF_DIR=/etc/hadoop" ],
According to apache/ozone:1.2.0 container image, this should be:
"Env": [ "PATH=/opt/hadoop/libexec:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/hadoop/bin", "JAVA_HOME=/usr/lib/jvm/jre/", "LD_LIBRARY_PATH=/usr/local/lib", "OZONE_LOG_DIR=/var/log/hadoop", "OZONE_CONF_DIR=/etc/hadoop" ],
Not sure about how the official ozone container images are created/released, but I guess they are managed by a separate repository (maybe https://github.com/apache/ozone-docker/blob/latest/Dockerfile ?)
Once I got a HDDS-xxxx number, I would send a PR to fix this issue via GitHub.
Attachments
Issue Links
- links to