本地演示 快速部署Superset
docker pull apache/superset
docker run -d -p 8080:8088 --name superset apache/superset
docker exec -it superset superset fab create-admin \
--username admin \
--firstname Superset \
--lastname Admin \
--email [email protected] \
--password admin
docker exec -it superset superset db upgrade
docker exec -it superset superset load_examples
docker exec -it superset superset init
设置用户名和密码(docker exec -it 容器ID fabmanager create-admin –app superset)
初始化数据库(docker exec -it 容器ID superset db upgrade)
superset初始化(docker exec -it 容器ID superset init)
开启superset服务(docker exec -it 容器ID superset runserver)
docker exec -it superset superset fab create-admin
-- superset:0.37.2
docker run -d -p 8089:8088 --name bi2 amancevice/superset:0.37.2
docker exec -it bi2 superset db upgrade
docker exec -it bi2 superset fab create-admin
docker exec -it bi2 superset init
docker exec -it bi2 superset load_examples
docker run -d -p 8089:8088 --name bi amancevice/superset:2.1.0
docker exec -it bi superset db upgrade
docker exec -it bi superset fab create-admin
docker exec -it bi superset init
docker exec -it bi superset load_examples
容器日志排查:docker logs bi
A Default SECRET_KEY was detected, please use superset_config.py to override it.
/usr/local/lib/python3.8
vi superset_config.py
# Superset specific config
# SS 相关的配置
# 行数限制 5000 行
ROW_LIMIT = 5000
# 网站服务器端口 8088
#SUPERSET_WEBSERVER_PORT = 8088
# Flask App Builder configuration
# Your App secret key will be used for securely signing the session cookie
# and encrypting sensitive information on the database
# Make sure you are changing this key for your deployment with a strong key.
# You can generate a strong key using `openssl rand -base64 42`
# Flask 应用构建器配置
# 应用密钥用来保护会话 cookie 的安全签名
# 并且用来加密数据库中的敏感信息
# 请确保在你的部署环境选择一个强密钥
# 可以使用命令 openssl rand -base64 42 来生成一个强密钥
SECRET_KEY = 'YOUR_OWN_RANDOM_GENERATED_SECRET_KEY'
# The SQLAlchemy connection string to your database backend
# This connection defines the path to the database that stores your
# superset metadata (slices, connections, tables, dashboards, ...).
# Note that the connection information to connect to the datasources
# you want to explore are managed directly in the web UI
# SQLAlchemy 数据库连接信息
# 这个连接信息定义了 SS 元数据库的路径(切片、连接、表、数据面板等等)
# 注意:需要探索的数据源连接及数据库连接直接通过网页界面进行管理
#SQLALCHEMY_DATABASE_URI = 'sqlite:path/to/superset.db'
# Flask-WTF flag for CSRF
# 跨域请求攻击标识
WTF_CSRF_ENABLED = True
# Add endpoints that need to be exempt from CSRF protection
# CSRF 白名单
WTF_CSRF_EXEMPT_LIST = []
# A CSRF token that expires in 1 year
# CSFR 令牌过期时间 1 年
WTF_CSRF_TIME_LIMIT = 60 * 60 * 24 * 365
# Set this API key to enable Mapbox visualizations
# 接口密钥用来启用 Mapbox 可视化
MAPBOX_API_KEY = ''
# 可以使用命令 openssl rand -base64 42 来生成一个强密钥
docker cp superset_config.py bi://usr/local/lib/python3.8
conda create -n python37 python=3.7
activate python37
第二步骤:
pip install cryptography
pip install --upgrade setuptools pip
pip install superset
pip install superset -i https://mirrors.aliyun.com/pypi/simple/
fabmanager create-admin --app superset
可能报错解决方案:
pip uninstall pandas
pip instlal pandas==0.23.4
Python superset db upgrade
可能报错解决方案:
pip install sqlalchemy==1.2.18
python superset load_examples
python superset init
python superset runserver -d
http://localhost:8088/login/
参考文档:https://blog.csdn.net/sinat_29297223/article/details/89363726