因为superset是用Python语言写的,而且只支持3.0版本以上,而2.0和3.0 Python差异很大,很多地方不能兼容,所以需要利用conda的特性,建立一个跟2.0版本不冲突的environment
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
当出现这个提示表示可以更改安装路径
安装完成后配置一下环境变量
conda config --set auto_activate_base false
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main conda config --set show_channel_urls yes
conda create --name superset python=3.6
这里如果报错 CondaHTTPError: HTTP 000 CONNECTION FAILED for url
这时是防火墙的问题,需要关闭防火墙
conda config --set ssl_verify false
创建环境:conda create -n env_name
查看所有环境:conda info --envs
删除一个环境:conda remove -n env_name --all
激活环境:conda activate env_name
退出当前环境:conda deactivate
python
sudo yum install -y python-setuptools
sudo yum install -y gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel cyrus-sasl-devel openldap-devel
pip install --upgrade setuptools pip -i https://pypi.douban.com/simple/
参数分析 --upgrade 如果未安装则安装,如果安装则更新
--i 指定镜像
pip: python的包管理工具!仅仅为python提供服务!pip的功能没有conda强!
superset db upgrade
export FLASK_APP=superset
flask fab create-admin
直接回车就是默认配置
superset init
pip install gunicorn -i https://pypi.douban.com/simple/
gunicorn是一个Python Web Server,可以和java中的TomCat类比
gunicorn --workers 5 --timeout 120 --bind hadoop102:8787 superset:app --daemon
--workers:指定进程个数
--timeout:worker进程超时时间,超时会自动重启
--bind:绑定本机地址,即为Superset访问地址
--daemon:后台运行,如果处于调试阶段建议不加
这里我报错Was unable to import superset Error: No module named superset
说明superset 没有安装成功,需要确认环境是否正确
ps -ef | awk ‘/gunicorn/ && !/awk/{print $2}‘ | xargs kill -9
登录http://hadoop102:8787,并输入之前设置的用户密码
https://blog.csdn.net/qq_41623990/article/details/81203841
原文:https://www.cnblogs.com/yangxusun9/p/12693427.html