环境篇:Superset
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/
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/
1.4 初始化superset数据库
superset db upgrade
1.5 创建管理员用户
export FLASK_APP=superset
superset fab create-admin
1.6 初始化
superset init
1.7 安装gunicorn
pip install gunicorn -i http://mirrors.aliyun.com/pypi/simple/
1.8 启动停止
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 添加数据源
3.2 制作仪表盘