官方设置文档链接:
设置过程遇到的问题记录
1. 镜像要安装对应的selenium webdriver,使用firefox或者chrome
Using Firefox
FROM apache/superset:1.0.1
USER root
RUN apt-get update && \
apt-get install --no-install-recommends -y firefox-esr
ENV GECKODRIVER_VERSION=0.29.0
RUN wget -q https://github.com/mozilla/geckodriver/releases/download/v${GECKODRIVER_VERSION}/geckodriver-v${GECKODRIVER_VERSION}-linux64.tar.gz && \
tar -x geckodriver -zf geckodriver-v${GECKODRIVER_VERSION}-linux64.tar.gz -O > /usr/bin/geckodriver && \
chmod 755 /usr/bin/geckodriver && \
rm geckodriver-v${GECKODRIVER_VERSION}-linux64.tar.gz
RUN pip install --no-cache gevent psycopg2 redis
USER superset
Using Chrome
FROM apache/superset:1.0.1
USER root
RUN apt-get update && \
wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
apt-get install -y --no-install-recommends ./google-chrome-stable_current_amd64.deb && \
rm -f google-chrome-stable_current_amd64.deb
RUN export CHROMEDRIVER_VERSION=$(curl --silent https://chromedriver.storage.googleapis.com/LATEST_RELEASE_88) && \
wget -q https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip && \
unzip chromedriver_linux64.zip -d /usr/bin && \
chmod 755 /usr/bin/chromedriver && \
rm -f chromedriver_linux64.zip
RUN pip install --no-cache gevent psycopg2 redis
USER superset
Don't forget to set
WEBDRIVER_TYPE
andWEBDRIVER_OPTION_ARGS
in your config if you use Chrome.
2. SMTP服务器注意服务的端口以及对应的端口是否启用,比如阿里云邮箱的端口就不一样
3. ALERT_REPORTS_NOTIFICATION_DRY_RUN 参数没用设置为false的话,默认不会发送真实的邮件,只会生成发送记录
4. 部署时需要启用celeryBeat,比如k8s需要supersetCeleryBeat.enabled = true
5. worker节点的启动命令:
celery worker --app=superset.tasks.celery_app:app -Ofair -l INFO
6. beat节点的启动命令
celery beat --app=superset.tasks.celery_app:app --pidfile /tmp/celerybeat.pid -l INFO
7. WEBDRIVER_BASEURL是截图生成时的地址,WEBDRIVER_BASEURL_USER_FRIENDLY是邮件中的内容给的链接的地址,需要注意区分
# This is for internal use, you can keep http
WEBDRIVER_BASEURL="http://superset:8088"
# This is the link sent to the recipient, change to your domain eg. https://superset.mydomain.com
WEBDRIVER_BASEURL_USER_FRIENDLY="http://localhost:8088"
8. 截图的中文显示问题,原因是容器内默认没有中文字体,可以安装字体(比如 宋体)解决
解决:
下载字体: 「simsun.ttf」https://www.aliyundrive.com/s/FjBvMoCKVtX 点击链接保存,或者复制本段内容,打开「阿里云盘」APP ,无需下载极速在线查看,视频原画倍速播放。
安装/复制字体到容器内:
COPY simsun.ttf /usr/share/fonts/ttf-dejavu/simsun.ttf
9. 时区问题,界面上设置的时间和实际执行时间不一致,执行时间按照UTC格式。
解决方案,在superset的1.3.x版本增加了定时设置的时区,可以解决这个问题。
github issue: feat: add timezones to report cron by eschutho · Pull Request #15849 · apache/superset (github.com)