【问题标题】:Error deploying the apache:superset image on Kubernetes在 Kubernetes 上部署 apache:superset 映像时出错
【发布时间】:2021-07-22 09:19:26
【问题描述】:

我正在尝试在 Kubernetes 上部署最新的 docker 镜像 apache:superset。当我部署 YAAML 时,出现以下错误:

[2021-04-29 01:34:10 +0000] [8] [INFO] Starting gunicorn 20.0.4
[2021-04-29 01:34:10 +0000] [8] [INFO] Listening at: http://0.0.0.0:8088 (8)
[2021-04-29 01:34:10 +0000] [8] [INFO] Using worker: gthread
[2021-04-29 01:34:10 +0000] [11] [INFO] Booting worker with pid: 11
logging was configured successfully
2021-04-29 01:34:12,332:INFO:superset.utils.logging_configurator:logging was configured successfully
2021-04-29 01:34:12,340:INFO:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>
100.106.25.194 - - [29/Apr/2021:01:34:20 +0000] "GET / HTTP/1.1" 302 243 "-" "kube-probe/1.18"
/usr/local/lib/python3.7/site-packages/flask_caching/__init__.py:192: UserWarning: Flask-Caching: CACHE_TYPE is set to null, caching is effectively disabled.
  "Flask-Caching: CACHE_TYPE is set to null, "
2021-04-29 01:34:20,145:WARNING:root:Class 'werkzeug.local.LocalProxy' is not mapped
2021-04-29 01:34:20,147:ERROR:root:DBEventLogger failed to log event(s)
2021-04-29 01:34:20,147:ERROR:root:(sqlite3.OperationalError) no such table: logs
[SQL: INSERT INTO logs (action, slice_id, json, dttm, duration_ms, referrer) VALUES (?, ?, ?, ?, ?, ?)]
[parameters: ('welcome', 0, '{"path": "/superset/welcome/", "object_ref": "Superset.welcome"}', '2021-04-29 01:34:20.147331', 0, 'http://100.106.25.213:8088/')]
(Background on this error at: http://sqlalche.me/e/13/e3q8)
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
    cursor, statement, parameters, context
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: no such table: logs

它似乎正在尝试连接到默认 SQLLite。我试图在 config.py 中提供 postgres 凭据,但无法修改图像中的文件。我的 Docker 文件中有以下命令:

USER root
COPY updated_config.py /app/superset/config.py
USER superset

该命令运行正常,但没有更新文件。如何更新 config.py。我也尝试在 YAML 中使用 Config Map,但这也给出了错误:

"ModuleNotFoundError: No module named 'superset.app'" 

请提出建议。谢谢

【问题讨论】:

    标签: python-3.x kubernetes apache-superset superset


    【解决方案1】:
    1. 您分享的错误应该只在我们没有运行superset db upgrade时发生。
    2. 您不应替换完整的默认配置文件。而是使用 export SUPERSET_CONFIG_PATH 创建新文件并添加必要的变量。

    这里是 Dockerfile

    FROM apache/superset
    USER root
    
    USER superset
    EXPOSE 8088
    
    RUN superset fab create-admin \
                   --username admin \
                   --firstname Superset \
                   --lastname Admin \
                   --email admin@superset.com \
                   --password admin
    
    COPY updated_config.py /app/config.py
    RUN export SUPERSET_CONFIG_PATH=/app/config.py
    RUN superset db upgrade
    
    RUN superset init
    

    由于您已经在使用 kubernetes,我建议您通过 helm chart 安装 superset。

    【讨论】:

      猜你喜欢
      • 2019-01-15
      • 1970-01-01
      • 1970-01-01
      • 2018-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-25
      相关资源
      最近更新 更多