我在kuberntes中有一个ignite(Gridgain Community)状态集集群。我从下面的docker创建了sucssfuly镜像( cmd运行jmx exporter):
FROM gridgain/community:8.8.1-slim
USER root
RUN mkdir -p /opt/jmx_exporter/
COPY ./jmx/* /opt/jmx_exporter/
RUN chmod 700 /opt/jmx_exporter/start.sh
CMD ["/bin/sh", "/opt/jmx_exporter/start.sh"]但是当我从这个图像开始图表时,pod正在运行,但还没有准备好:
NAME READY STATUS RESTARTS AGE
online-db-0 0/1 Running 3 4m2s在describe中:
Normal Started 51s kubelet, samppc01srv01kbr002.novalocal Started container online-db
Warning Unhealthy 12s (x3 over 32s) kubelet, samppc01srv01kbr002.novalocal Liveness probe failed: Get http://10.233.109.23:8080/ignite?cmd=version: dial tcp 10.233.109.23:8080: connect: connection refused
Normal Killing 12s kubelet, samppc01srv01kbr002.novalocal Container online-db failed liveness probe, will be restarted
Warning Unhealthy 9s (x3 over 29s) kubelet, samppc01srv01kbr002.novalocal Readiness probe failed: Get http://<IP>/ignite?cmd=probe: dial tcp <ip>:8080: connect: connection refused当我检查pod时,我看到只有jmx在打开,ignite java在关闭,当我在ignite容器上手动启动jmx时,它起作用了:
bash-4.4# ps -ef | grep java
6 root 0:01 java -Djava.net.preferIPv4Stack=true -jar /opt/jmx_exporter/jmx_prometheus_httpserver-0.12.0-jar-with-dependencies.jar 5556 /opt/jmx_exporter/config.yml
26 root 0:00 grep javastart.sh - the java_script
!/bin/sh
if [ -z "$SERVICE_PORT" ]; then
SERVICE_PORT=5556
fi
if [ -z "$JVM_OPTS" ]; then
JVM_OPTS="-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=5555"
fi
if [ -z "$CONFIG_YML" ]; then
CONFIG_YML=/opt/jmx_exporter/config.yml
fi
VERSION=0.12.0
java $JVM_OPTS -jar /opt/jmx_exporter/jmx_prometheus_httpserver-$VERSION-jar-with-dependencies.jar $SERVICE_PORT $CONFIG_YML日志里什么都没有,有没有人能帮助解释为什么会发生这种情况?
发布于 2021-01-27 17:58:33
我创建了一个同时运行ignite进程和jm脚本的startall.sh脚本,如下所示:
#!/bin/sh
set -m
/opt/jmx_exporter/start.sh &
/bin/sh -c ${IGNITE_HOME}/run.sh然后编辑我的dockefile,只运行包装器脚本:
FROM gridgain/community:8.8.1-slim
USER root
RUN mkdir -p /opt/jmx_exporter/
COPY ./jmx/* /opt/jmx_exporter/
RUN chmod 700 /opt/jmx_exporter/start.sh
CMD ["/bin/sh", "/opt/jmx_exporter/startall.sh" ]https://stackoverflow.com/questions/65891378
复制相似问题