1 安装python3.6
yum install epel-release -y
yum install https://centos7.iuscommunity.org/ius-release.rpm -y
#安装Python3.6
yum install python36u -y
#创建python3连接符 ln -s /bin/python3.6 /bin/python3 #安装pip3 yum install python36u-pip -y #创建pip3链接符 ln -s /bin/pip3.6 /bin/pip3 #创建软链,配置源地址 mkdir ~/.pip echo -e "[global]\nindex-url = https://pypi.tuna.tsinghua.edu.cn/simple" > ~/.pip/pip.conf
2 安装superset
yum clean all
yum makecache
yum update
yum install -y gcc gcc-c++ libxslt-devel libxml2-devel libffi-devel python-devel python36u-pip python-wheel openssl-devel libsasl2-devel openldap-devel mysql-devel python36u-devel
pip3 install --upgrade pip
pip3 install --upgrade prison pip3 install SQLAlchemy==1.2.19 pip3 install pandas==0.23.4
3 配置superset
3.1 创建mysql库
create database superset;
use superset;
alter database superset character set utf8;
3.2 安装superset
pip3 install superset
3.3 修改配置文件
#配置文件位置:
/lib/python3.6/site-packages/superset/config.py #端口 SUPERSET_WEBSERVER_PORT = 9158 #元数据库地址 SQLALCHEMY_DATABASE_URI = 'mysql://hdp:password@bd-prod-master01/superset?charset=utf8' #汉化 BABEL_DEFAULT_LOCALE = 'zh'
3.4 创建admin用户
fabmanager create-admin --app superset
3.5 初始化superset
superset db upgrade
出现错误 ModuleNotFoundError: No module named 'MySQLdb',使用命令解决
pip3 install mysqlclient
3.6 初始化superset
superset init
3.7 启动superset
nohup superset runserver >/dev/null 2>&1 &