1.安装python3
2.安装 虚拟环境
3.sudo yum upgrade python-setuptools
4.sudo yum install gcc gcc-c++ libffi-develpython36u-devel python-pip python-wheel openssl-devel libsasl2-devel openldap-devel
5.在虚拟环境venv中:
#安装superset
pip install superset
如出现问题:1.由于python3与python,导致下载的包不是想要的;2.下载的包不完整
# 初始化数据库
superset db upgrade
# 创建管理员账号
pip3 install flask
export FLASK_APP=superset
flask fab create-admin
如出现Error: Could not locate a Flask application. You did not provide the "FLASK_APP" environment variable, and a "wsgi.py" or "app.py" module was not found in the current directory.:
解决:pip3 install flask
# 载入案例数据
superset load_examples
# 初始化角色和权限
superset init
# 启动superset
superset run -p 8088 --with-threads --reload --debugger
问题:如果启动的地址为:127.0.0.1:8088,那么远程是连接不了的。
解决办法:
superset run -p 8080 -h 0.0.0.0 --with-threads --reload --debugger
如出现MySQLdb问题:
解决:
1.yum install mysql-devel:
如又出现(系统本身自带 MariaDB,我们需要先删除掉系统本身带的,才能正常安装比较新的):
--> 解决依赖关系完成
错误:mariadb101u-libs conflicts with 1:mariadb-libs-5.5.64-1.el7.x86_64
错误:mariadb101u-config conflicts with 1:mariadb-libs-5.5.64-1.el7.x86_64
错误:mariadb101u-common conflicts with 1:mariadb-libs-5.5.64-1.el7.x86_64
您可以尝试添加 --skip-broken 选项来解决该问题
您可以尝试执行:rpm -Va --nofiles --nodigest
解决:
yum remove mariadb-libs -y
2.source env/bin/activate
pip3 install mysqlclient
连接数据库的url规范:
mysql://root:db@123@bigdata-test-7:3306/multi-analysis?charset=utf8
如出现OSError: [Errno 98] Address already in use:
yum install lsof
查询端口占用情况:
lsof -i:5000(端口自定义)
进程结束
kill