我在kubertes中有一个ignite(grid -community) statfulset集群。我从下面的docker (cmd运行jmx导出器)成功创建了映像:
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
和in description:
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是向上的,点燃java是向下的,当我在点燃容器上手动启动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 java
start.sh - 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
日志中什么都没有,有人能帮助为什么会发生这种情况吗?
我创建了一个startall.sh脚本,它运行了ignite进程和jm脚本,如下所示:
#!/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" ]