用supervisorctl 启动一个py文件,报错!
虚拟机装了supervisord,然后用python写了一个监控的脚本:jobmonitor,正常启动方式:python jobmonitor 没有任何错误,但是用:supervisorctl start jobmonitor启动就报错!显示:[root@INFOGOV ~]# supervisorctl start jobmonitor
jobmonitor: ERROR (abnormal termination)
/etc/supervisord.conf.d/jobmonitor.conf:
[program:jobmonitor]
command = python /deployment/monitor/jobmonitor.py
autostart = true
autorestart = true
redirect_stderr=true
#user = appusr
stdout_logfile=/data/log4engine/console_jobmonitor.log
stdout_logfile_maxbytes=50MB
environment=NLS_LANG="AMERICAN_AMERICA.UTF8"
日志记录的错误:
Traceback (most recent call last):
File "/deployment/monitor/jobmonitor.py", line 10, in <module>
import pymongo
ImportError: No module named pymongo
Traceback (most recent call last):
File "/deployment/monitor/jobmonitor.py", line 10, in <module>
import pymongo
ImportError: No module named pymongo
Traceback (most recent call last):
File "/deployment/monitor/jobmonitor.py", line 10, in <module>
import pymongo
ImportError: No module named pymongo
jobmonitor.py的第10行代码就是一句:import pymongo 而已
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果你的
pymongo
是安装在virtualenv
下的话,你得用virtualenv
下的python运行jobmonitor.py
,如图:环境没有pymongo包 监控之前 需要保证python文件中需要的包在环境中存在