【问题标题】:error when trying to live apache:superset on redhat openshift sandbox with gunicorn尝试使用 gunicorn 在 redhat openshift 沙箱上使用 apache:superset 时出错
【发布时间】:2021-07-07 10:17:43
【问题描述】:

尝试使用 gunicorn 在 redhat openshift 沙箱上运行 apache:superset 时出现错误。 我试过 gunicorn 版本 20.1.0

独角兽版: 20.0.4

超集: 版本:0.999.0dev GIT SHA: 74348b96c5a69c1b2d6980c7ec219e4209b2f1db

服务器: 红帽 Openshift 沙盒

服务器日志:

/opt/app-root/lib64/python3.8/site-packages/setuptools/dist.py:472: UserWarning: Normalizing '0.999.0dev' to '0.999.0.dev0'
warnings.warn(
---> Serving application with gunicorn (-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-
VERSION: 0.999.0dev
GIT SHA: 74348b96c5a69c1b2d6980c7ec219e4209b2f1db
-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-
apache-superset) ...
[2021-07-07 09:44:12 +0000] [1] [INFO] Starting gunicorn 20.0.4
[2021-07-07 09:44:12 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
[2021-07-07 09:44:12 +0000] [1] [INFO] Using worker: sync
[2021-07-07 09:44:12 +0000] [40] [INFO] Booting worker with pid: 40
[2021-07-07 09:44:12 +0000] [40] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/opt/app-root/lib64/python3.8/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
worker.init_process()
File "/opt/app-root/lib64/python3.8/site-packages/gunicorn/workers/base.py", line 119, in init_process
self.load_wsgi()
File "/opt/app-root/lib64/python3.8/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
self.wsgi = self.app.wsgi()
File "/opt/app-root/lib64/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/opt/app-root/lib64/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
return self.load_wsgiapp()
File "/opt/app-root/lib64/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
return util.import_app(self.app_uri)
File "/opt/app-root/lib64/python3.8/site-packages/gunicorn/util.py", line 358, in import_app
mod = importlib.import_module(module)
File "/opt/rh/rh-python38/root/usr/lib64/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named '-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==-\nVERSION'

gunicorn 配置:

gunicorn --bind "0.0.0.0:${SUPERSET_PORT}" --access-logfile '-' --error-logfile '-' --workers 1 --worker-class gthread --threads 8 --timeout 60 --limit-request-line 0 --limit-request-field_size 0 "${FLASK_APP}"

【问题讨论】:

  • 您能否提供您在gunicorn 命令中引用的环境变量?

标签: python openshift gunicorn apache-superset


【解决方案1】:

我设法通过以下步骤来解决这个问题

# Deploy application
$ oc new-app --name superset apache/superset:latest -e SUPERSET_PORT=8088 -e SUPERSET_HOME=/data

# Create persistent volume, adjust "--claim-size" as needed
$ oc set volume deployment/superset --add -m /data --claim-name=superset-volume --read-only=false --claim-size="5Gi"

# Set up the Docker image, per https://hub.docker.com/r/apache/superset
$ oc exec deployment/superset -it -- superset fab create-admin \
                        --username admin \
                        --firstname Superset \
                        --lastname Admin \
                        --email admin@superset.com \
                        --password admin
$ oc exec deployment/superset -it -- superset db upgrade
$ oc exec deployment/superset -it -- superset load_examples
$ oc exec deployment/superset -it -- superset init

# Expose superset with an https route
$ oc create route edge --service=superset --insecure-policy=Redirect

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-06-24
    • 2017-12-11
    • 2018-10-30
    • 1970-01-01
    • 1970-01-01
    • 2021-07-22
    • 2013-04-16
    • 2016-08-23
    相关资源
    最近更新 更多