docker - Docker 中的主管不起作用
问题描述
supervisor
我对in有问题docker
。我使用supervisor
来启动 4 个脚本.sh
:datagrid.sh
、ml.sh
和.startmap.sh
dirwatcher.sh
当我打开容器时,导航到脚本目录并尝试手动启动脚本,一切正常,脚本全部启动,但它们不会在启动时间启动。我认为问题出在主管身上。谢谢你。
错误:
2018-08-08 12:28:08,512 INFO spawned: 'datagrid' with pid 171
2018-08-08 12:28:08,514 INFO spawned: 'dirwatcher' with pid 172
2018-08-08 12:28:08,517 INFO spawned: 'startmap' with pid 173
2018-08-08 12:28:08,519 INFO spawned: 'ml' with pid 175
2018-08-08 12:28:08,520 INFO exited: datagrid (exit status 0; not expected)
2018-08-08 12:28:08,520 INFO exited: dirwatcher (exit status 0; not expected)
2018-08-08 12:28:08,520 INFO exited: startmap (exit status 0; not expected)
2018-08-08 12:28:08,520 INFO exited: ml (exit status 0; not expected)
2018-08-08 12:28:08,527 INFO gave up: datagrid entered FATAL state, too many start retries too quickly
2018-08-08 12:28:08,532 INFO gave up: ml entered FATAL state, too many start retries too quickly
2018-08-08 12:28:08,537 INFO gave up: startmap entered FATAL state, too many start retries too quickly
2018-08-08 12:28:08,539 INFO gave up: dirwatcher entered FATAL state, too many start retries too quickly
我的supervisord.conf
文件:
[supervisord]
nodaemon=false
[program:datagrid]
command=sh /EscomledML/MLScripts/escomled_data_grid.sh start -D
[program:dirwatcher]
command=sh /EscomledML/MLScripts/escomled_dirwatcher.sh start -D
[program:startmap]
command=sh /EscomledML/MLScripts/escomled_startmap.sh start -D
[program:ml]
command=sh /EscomledML/MLScripts/escomled_ml.sh start -D
我在容器中使用 alpine linux。
解决方案
这里的问题很少
以下声明:
[主管] nodaemon=false
这使得 Supervisord 作为守护进程运行,并且容器需要一个主进程。
尝试将其更改为
[supervisord]
nodaemon=true
此配置使 Supervisord 本身作为前台进程运行,这将使容器保持正常运行。
- 从日志“520 INFO 退出:数据网格(退出状态 0;不期望)”
Supervisord 无法将 0 识别为有效的退出代码并正在退出进程。将以下内容添加到所有进程的 conf 中。这将告诉 Supervisord 仅在退出代码不为 0 时尝试重新启动进程
[program:datagrid]
command=sh /EscomledML/MLScripts/escomled_data_grid.sh start -D
autorestart=unexpected
exitcodes=0
推荐阅读
- reactjs - 如何在我的 eventHandler 中访问 React 状态?
- r - 如何从 R 中的分布中的移位(右或左无关紧要)生成随机变量?
- pandas - 分段错误:本地计算机失败 (16gb) 但 AWS EC2 工作 (1gb)
- dialogflow-es - Botium 对话流 SET_DIALOGFLOW_QUERYPARAMS 不起作用
- datetime - 在 Tableau Report 中创建过滤器以在时区之间切换
- javascript - React Native Maps MapView.fitToCoordinates 在测试时崩溃应用程序(Expo)
- ios - 具有不同错误的`flatMap`发布者
- c++ - How do you randomly generate a number from an array and then use that number in a switch statement in C++?
- flutter - 将图像上传到 firebase 并显示为资产
- sql - 使用自定义 SQL 查询将 Tableau 连接到 Teradata