【问题标题】:Not installed error when starting cake server from unicorn从独角兽启动蛋糕服务器时未安装错误
【发布时间】:2020-04-02 15:20:41
【问题描述】:

我有一个运行 windows 的 EC2 实例。它通过 splunk 提供一个反应应用程序。我希望 AWS 服务器在 EC2 实例使用以下 .service 文件通过 systemd 重新启动时自动启动。

[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)

【问题讨论】:

  • 如果您手动运行,您是否遇到同样的问题?
  • 没有正常从根目录运行它工作正常

标签: python flask gunicorn gevent


【解决方案1】:

要解决这个问题,你需要安装 gevent python 包。 您可以使用以下命令。

pip install gevent

【讨论】:

    猜你喜欢
    • 2011-08-08
    • 1970-01-01
    • 2013-07-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多