环境篇:Superset

环境篇:Superset-LMLPHP

环境篇:Superset-LMLPHP

http://superset.apache.org/

1 搭建

1.1 更新yum组件

yum install -y python-setuptools
yum install -y gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel cyrus-sasl-devel openldap-devel

1.2 安装 setuptools和pip

pip install --upgrade setuptools pip -i http://mirrors.aliyun.com/pypi/simple/
  • 报错

环境篇:Superset-LMLPHP

  • 需要配置默认镜像源创建或修改配置文件
mkdir /root/.pip
vim /root/.pip/pip.conf
#>>>
[global]
index-url=http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
#<<<

1.3 安装superset

pip install apache-superset -i http://mirrors.aliyun.com/pypi/simple/

环境篇:Superset-LMLPHP

1.4 初始化superset数据库

superset db upgrade

1.5 创建管理员用户

export FLASK_APP=superset
superset fab create-admin

环境篇:Superset-LMLPHP

1.6 初始化

superset init

1.7 安装gunicorn

pip install gunicorn -i http://mirrors.aliyun.com/pypi/simple/

1.8 启动停止

  • 启动(注意python3.6)
gunicorn -w 5 --timeout 120 -b  10.28.13.85:8888 "superset.app:create_app()" --daemon
  • 停止
ps -ef | awk '/gunicorn/ && !/awk/{print $2}' | xargs kill -9

2 对接数据源

2.1 对接mysql

conda install mysqlclient
pip install mysqlclient -i http://mirrors.aliyun.com/pypi/simple/

3 使用demo

3.1 添加数据源

  • 添加数据库

环境篇:Superset-LMLPHP

环境篇:Superset-LMLPHP

  • 添加表

环境篇:Superset-LMLPHP

环境篇:Superset-LMLPHP

3.2 制作仪表盘

  • 创建仪表盘

环境篇:Superset-LMLPHP

环境篇:Superset-LMLPHP

  • 创建图

环境篇:Superset-LMLPHP

环境篇:Superset-LMLPHP

环境篇:Superset-LMLPHP

环境篇:Superset-LMLPHP

05-12 17:24