From 71592c7c82ddca7ac8748cb47b7ee987232180e7 Mon Sep 17 00:00:00 2001 From: xianshi3 Date: Tue, 18 Aug 2026 01:56:05 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix(docker):=20=E5=81=A5=E5=BA=B7=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E5=8A=A0=E5=9B=BA,=20=E9=AB=98=E8=B4=9F=E8=BD=BD?= =?UTF-8?q?=E4=B8=8B=E9=98=B2=E8=AF=AF=E5=88=A4=E9=87=8D=E5=90=AF=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 服务器 2 核负载 38+ 时, 3s 超时的 curl 健康检查频繁失败导致 容器被误判 unhealthy 并重启。调整为: - interval 30s → 60s (降低检查频率) - timeout 3s → 10s (高负载下容忍慢响应) - 新增 start-period 90s (Spring Boot 启动期内不判定) --- mes-auth/Dockerfile | 2 +- mes-dashboard/Dockerfile | 2 +- mes-gateway/Dockerfile | 2 +- mes-process/Dockerfile | 2 +- mes-quality/Dockerfile | 2 +- mes-workorder/Dockerfile | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mes-auth/Dockerfile b/mes-auth/Dockerfile index e264780..dcabef9 100644 --- a/mes-auth/Dockerfile +++ b/mes-auth/Dockerfile @@ -32,7 +32,7 @@ chmod +x /app/start.sh EXPOSE 8081 -HEALTHCHECK --interval=30s --timeout=3s --retries=3 \ +HEALTHCHECK --interval=60s --timeout=10s --retries=3 --start-period=90s \ CMD curl -sf http://localhost:8081/actuator/health || exit 1 CMD ["/app/start.sh"] diff --git a/mes-dashboard/Dockerfile b/mes-dashboard/Dockerfile index 0f18a6f..57cc663 100644 --- a/mes-dashboard/Dockerfile +++ b/mes-dashboard/Dockerfile @@ -32,7 +32,7 @@ chmod +x /app/start.sh EXPOSE 8085 -HEALTHCHECK --interval=30s --timeout=3s --retries=3 \ +HEALTHCHECK --interval=60s --timeout=10s --retries=3 --start-period=90s \ CMD curl -sf http://localhost:8085/actuator/health || exit 1 CMD ["/app/start.sh"] diff --git a/mes-gateway/Dockerfile b/mes-gateway/Dockerfile index 89d9da6..623234e 100644 --- a/mes-gateway/Dockerfile +++ b/mes-gateway/Dockerfile @@ -32,7 +32,7 @@ chmod +x /app/start.sh EXPOSE 9090 -HEALTHCHECK --interval=30s --timeout=3s --retries=3 \ +HEALTHCHECK --interval=60s --timeout=10s --retries=3 --start-period=90s \ CMD curl -sf http://localhost:9090/actuator/health || exit 1 CMD ["/app/start.sh"] diff --git a/mes-process/Dockerfile b/mes-process/Dockerfile index 04ae1eb..74c5069 100644 --- a/mes-process/Dockerfile +++ b/mes-process/Dockerfile @@ -32,7 +32,7 @@ chmod +x /app/start.sh EXPOSE 8083 -HEALTHCHECK --interval=30s --timeout=3s --retries=3 \ +HEALTHCHECK --interval=60s --timeout=10s --retries=3 --start-period=90s \ CMD curl -sf http://localhost:8083/actuator/health || exit 1 CMD ["/app/start.sh"] diff --git a/mes-quality/Dockerfile b/mes-quality/Dockerfile index 12418db..e0185a0 100644 --- a/mes-quality/Dockerfile +++ b/mes-quality/Dockerfile @@ -32,7 +32,7 @@ chmod +x /app/start.sh EXPOSE 8084 -HEALTHCHECK --interval=30s --timeout=3s --retries=3 \ +HEALTHCHECK --interval=60s --timeout=10s --retries=3 --start-period=90s \ CMD curl -sf http://localhost:8084/actuator/health || exit 1 CMD ["/app/start.sh"] diff --git a/mes-workorder/Dockerfile b/mes-workorder/Dockerfile index 6a9e853..25b9dbd 100644 --- a/mes-workorder/Dockerfile +++ b/mes-workorder/Dockerfile @@ -32,7 +32,7 @@ chmod +x /app/start.sh EXPOSE 8082 -HEALTHCHECK --interval=30s --timeout=3s --retries=3 \ +HEALTHCHECK --interval=60s --timeout=10s --retries=3 --start-period=90s \ CMD curl -sf http://localhost:8082/actuator/health || exit 1 CMD ["/app/start.sh"] From 01f28d2936f0ac21bf92b7b7fcc84b3e84d0b2dc Mon Sep 17 00:00:00 2001 From: xianshi3 Date: Tue, 18 Aug 2026 02:21:03 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix(compose):=20kafka/zookeeper=20=E5=83=B5?= =?UTF-8?q?=E5=B0=B8=E8=BF=9B=E7=A8=8B=E6=A0=B9=E6=B2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 服务器实测 mes-kafka 1072 个 / mes-zookeeper 137 个僵尸进程: Confluent entrypoint 非 exec 形式, 健康检查脚本频繁 fork 子进程 且无人回收。为两容器加 init: true (dockerd 内置 tini 作 PID 1, 无需下载镜像)。镜像版本保持 7.5.0 不变, 升级可选。 --- docker-compose.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index f30e4cb..9c9ca09 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -49,6 +49,9 @@ services: image: confluentinc/cp-zookeeper:7.5.0 container_name: mes-zookeeper restart: always + # Confluent entrypoint 不 exec 且健康检查脚本频繁 fork,僵尸子进程无人回收 + # (服务器实测 137 个);init: true 注入 tini 作为 PID 1 统一回收 + init: true ports: - "2181:2181" environment: @@ -71,6 +74,8 @@ services: image: confluentinc/cp-kafka:7.5.0 container_name: mes-kafka restart: always + # 同上:僵尸进程累积 (服务器实测 1072 个),tini 作为 PID 1 回收 + init: true depends_on: zookeeper: condition: service_healthy From 6520527b40898d218f2b215f8563775fe6d24d38 Mon Sep 17 00:00:00 2001 From: xianshi3 Date: Mon, 24 Aug 2026 11:28:14 +0800 Subject: [PATCH 3/3] =?UTF-8?q?chore(build):=20=E7=A7=BB=E9=99=A4=E6=9C=AA?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9A=84=20elasticsearch-java=20=E6=AD=BB?= =?UTF-8?q?=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 依赖管理中的 co.elastic.clients:elasticsearch-java 无任何模块引用、 源码无 import、compose 无 ES 容器, 纯属冗余。 --- pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pom.xml b/pom.xml index 986eecd..5bb2199 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,6 @@ 0.12.5 2.0.47 1.35.0 - 8.10.0 4.3.1 5.1.4 2.0.0 @@ -122,11 +121,6 @@ influxdb-client-java ${influxdb-client.version} - - co.elastic.clients - elasticsearch-java - ${elasticsearch-java.version} - org.apache.kafka kafka-clients