注意事项:在安装superset时必须在非root用户下安装,但是这个用户要有管理员权限
在执行superset db upgrade时会报错,具体错误解决方法请参考:报错看这个
Miniconda下载:过两天上传
centos镜像下载:过两天上传
bash Miniconda3-latest-Linux-x86_64.sh # 注意安装路径选择, init conda config --set auto_activate_base false # 不自动开启 conda # 常用命令 conda create -n superset python=3.9 # 创建环境superset conda activate superset # 切换到 superset 环境 python -V # 检查环境 # conda 国内镜像 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依赖安装:yum install gcc gcc-c++ libffi-devel python-devel python-pip python-wheel python-setuptools openssl-devel cyrus-sasl-devel openldap-devel pip install --upgrade setuptools pip -i https://pypi.douban.com/simple 安装superset: pip install apache-superset -i https://pypi.douban.com/simple # pip install apache-superset --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple(上面安装显示网络错误时用这个) 初始化数据库 superset db upgrade export FLASK_APP=superset 创建管理员用户 superset fab create-admin 初始化superset superset init安装启动工具
pip install gunicorn -i https://pypi.douban.com/simple # 启动 --timeout worker进程超时时间,超时会自动重启 gunicorn --workers 5 --timeout 120 --bind 0.0.0.0:8787 "superset.app:create_app()" --daemon(上面的ip换成自己虚拟机的ip) # 停止 进程中找出 superset 且不包含 awk 的,第2列即 pid 传入 kill ps -ef | awk '/superset/ && !/awk/{print $2}' | xargs kill -9