我有一个运行windows的EC2实例。它通过splunk提供react应用程序。我希望aws服务器在EC2实例通过systemd使用以下.service文件重新启动时自动启动
[Unit]
Description="gunicorn server for rayaan "
[Service]
WorkingDirectory=/home/ubuntu/webClient
Type=simple
ExecStart=/usr/local/bin/gunicorn --worker-class gthread -k gevent --worker-connections 1000 --workers 10 --threads 20 --log-level DEBUG --bind 0.0.0.0:7777 application:application
[Install]
WantedBy=multi-user.target
然后我运行这些来检查它是否有效
systemctl daemon-reload
systemctl start rayaanWebCli
systemctl status rayaanWebCli
状态输出:
rayaanWebCli.service - "gunicorn server for rayaan "
Loaded: loaded (/lib/systemd/system/rayaanWebCli.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2019-12-09 13:31:54 UTC; 15min ago
Process: 1776 ExecStart=/usr/local/bin/gunicorn --worker-class gthread -k gevent --worker-connections 1000 --workers 10 --threads 20 --log-level DEBUG --bind 0.0.0.0:7777 application:applicatio
Main PID: 1776 (code=exited, status=1/FAILURE)
Dec 09 13:31:54 ip-172-31-8-1 gunicorn[1776]: File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 135, in load_class
Dec 09 13:31:54 ip-172-31-8-1 gunicorn[1776]: mod = import_module('.'.join(components))
Dec 09 13:31:54 ip-172-31-8-1 gunicorn[1776]: File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
Dec 09 13:31:54 ip-172-31-8-1 gunicorn[1776]: __import__(name)
Dec 09 13:31:54 ip-172-31-8-1 gunicorn[1776]: File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 22, in <module>
Dec 09 13:31:54 ip-172-31-8-1 gunicorn[1776]: raise RuntimeError("You need gevent installed to use this worker.")
Dec 09 13:31:54 ip-172-31-8-1 gunicorn[1776]: RuntimeError: You need gevent installed to use this worker.
Dec 09 13:31:54 ip-172-31-8-1 gunicorn[1776]: ]
Dec 09 13:31:54 ip-172-31-8-1 systemd[1]: rayaanWebCli.service: Main process exited, code=exited, status=1/FAILURE
Dec 09 13:31:54 ip-172-31-8-1 systemd[1]: rayaanWebCli.service: Failed with result 'exit-code'.
lines 1-16/16 (END)
要解决此问题,您需要安装gevent python包。 您可以使用下面的命令
pip install gevent
相关问题 更多 >
编程相关推荐