Superset安装使用

1,200 阅读1分钟

安装

安装apache-superset

pip install apache-superset

更新数据库

superset db upgrade

创建admin用户

export FLASK_APP=superset
flask fab create-admin

下载样例数据

superset load_examples

初始化环境

superset init

启动Superset

superset run -h 0.0.0.0 -p 5000

image-20210817222235942

添加自定义数据库

sqlite3为例

image-20210817223443834

image-20210817230150879

若出现ERROR: (sqlalchemy_uri) SQLiteDialect_pysqlite cannot be used as a data source for security reasons.

image-20210817223609914

则修改superset下的config.py,设置PREVENT_UNSAFE_DB_CONNECTIONS = False,然后重启

$ locate config.py|grep superset
.../python-3.7.2/lib/python3.7/site-packages/superset/config.py
​
$ vi .../python-3.7.2/lib/python3.7/site-packages/superset/config.py
​
# Some sqlalchemy connection strings can open Superset to security risks.
# Typically these should not be allowed.
PREVENT_UNSAFE_DB_CONNECTIONS = False
​

\