简体   繁体   English

使用 Docker 图像在 Kube.netes 中部署服务时卡在“使用 pid: 7 启动工作程序”,这里似乎有什么问题?

[英]Stuck on "Booting worker with pid: 7" while deploying a service in Kubernetes using Docker image, What seems to be the problem here?

So basically i am trying to deploy a service in Kube.netes cluster using a DockerFile, after so many attempts i am still stuck with the same error message Booting worker with pid: 7 on loop, without any exit code ie所以基本上我正在尝试使用 DockerFile 在 Kube.netes 集群中部署服务,经过这么多次尝试我仍然遇到相同的错误消息Booting worker with pid: 7 on loop,没有任何退出代码即

[2023-01-11 09:22:48 +0000] [1] [INFO] Starting gunicorn 20.1.0
[2023-01-11 09:22:48 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
[2023-01-11 09:22:48 +0000] [1] [INFO] Using worker: gthread
[2023-01-11 09:22:48 +0000] [7] [INFO] Booting worker with pid: 7

here is my Docker image:这是我的 Docker 图片:

FROM python:3.10-slim

ENV PYTHONUNBUFFERED True

ENV APP_HOME /app
WORKDIR $APP_HOME
COPY . ./

RUN pip install --no-cache-dir -r requirements.txt

CMD exec gunicorn --bind 0.0.0.0:8080 --workers 1 --threads 8 --timeout 0 main:app

I am really not getting where am i wrong, any leads would be super helpful..!!我真的不知道我哪里错了,任何线索都会非常有帮助..!!

Try below possible Solutions:尝试以下可能的解决方案:

I)Memory Issue:一)内存问题:

1)Try adding more resources (requests & limits) under the container - may need more memory. 1)尝试在容器下添加更多资源(请求和限制)——可能需要更多 memory。

2)Try to increase the available amount of RAM that the docker container, Please see SO for more info and also Clear the Cache : log in the console of the backend container, then issue the command bench --site SITE_NAME clear-cache . 2)尝试增加 docker 容器的可用 RAM 量,请参阅SO了解更多信息并Clear the Cache :登录backend容器的控制台,然后发出命令bench --site SITE_NAME clear-cache

II)From Gunicorn side: II)从 Gunicorn 方面:

1) AsyncIO Workers : The worker gthread is a threaded worker. 1) AsyncIO Workers worker gthread是一个线程化的worker。 It accepts connections in the main loop, accepted connections are added to the thread pool as a connection job.它在主循环中接受连接,接受的连接作为连接作业添加到线程池中。 On keepalive connections are put back in the loop waiting for an event.在 keepalive 上,连接被放回循环中等待事件。 If no event happens after the keep alive timeout, the connection is closed.如果在保持活动超时后没有事件发生,连接将关闭。

2) To use the inotify reloader, you must have the inotify package installed. 2) To use the inotify reloader, you must have the inotify package installed. Please check Gunicorn settings debugging for more information.请检查Gunicorn 设置调试以获取更多信息。

3)Create a Gunicorn config file using configmap and mount it to the web pod. 3)使用configmap创建一个Gunicorn配置文件并将其挂载到web pod。 Make sure bind is passed via config file, not through args .确保bind是通过配置文件传递的,而不是通过args传递的。 Please go through the Write Kube.netes manifests for python flask app for more information.请 go 通过为 python flask 应用编写 Kube.netes 清单以获取更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将 docker 镜像部署到云运行时如何解决“容器启动失败错误” - How to resolve "container failed to start error" while deploying a docker image to cloud run Cloud composer 使用 Kube.netesPodOperator 在 Kube.netes pod 中运行 Docker 图像 - Cloud composer running Docker image inside Kubernetes pod using KubernetesPodOperator 坚持看似简单的 SQL dense_rank 任务 - Stuck on what seems like a simple SQL dense_rank task Golang - 创建 docker 图像的问题 - Golang - problem with creating docker image 使用 docker 为图像撰写时没有为 aws 提供凭据 - No Credentials Provided for aws while using docker compose for a image 使用 Kube.netesPodOperator 错误从 Airflow 在 GKE / Kube.netes 上部署 DBT pod - Deploying DBT pod on GKE / Kubernetes from Airflow using KubernetesPodOperator Error 牧场主卡在等待注册 Kube.netes - rancher stuck Waiting to register with Kubernetes 使用 ES 模块系统部署 Firebase function 和 TypeScript 时出现问题 - Problem deploying Firebase function with TypeScript using ES Module system 在 Google Cloud Run 中部署多阶段 Docker 映像 - Deploying multi-stage Docker image in Google Cloud Run 部署为 Docker 图像时如何运行多个 lambda 函数? - How to run multiple lambda functions when deploying as a Docker image?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM