superset安装

it2025-10-16  7

安装前的准备

安装前需要准备miniconda环境。

https://docs.conda.io/en/latest/miniconda.html

下载Linux版本的Miniconda安装文件。

上传到opt目录下运行:

[root@ck1 opt]# bash Miniconda3-latest-Linux-x86_64.sh

在安装中会询问

Do you accept the license terms?[yes|no] [no] >>> 这里是问是否要对conda初始化,输入yes即可 最后出现这段话表示安装成功 conda config --set auto_activate_base false Thank you for installing Miniconda3!

然后,minconda会在.bashrc中插入一段代码:

# >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$('/opt/module/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" if [ $? -eq 0 ]; then eval "$__conda_setup" else if [ -f "/opt/module/miniconda3/etc/profile.d/conda.sh" ]; then . "/opt/module/miniconda3/etc/profile.d/conda.sh" else export PATH="/opt/module/miniconda3/bin:$PATH" fi fi unset __conda_setup # <<< conda initialize <<< 大致用途就是给自己配个环境变量

但是从现在开始进入系统的话,会自动进入Miniconda默认的虚拟环境bash,这个时候就需要在虚拟环境内运行:

[root@ck1 opt]# conda config --set auto_activate_base false

配置虚拟环境

创建环境:conda create -n env_name

查看环境:conda info --envs

删除环境:conda remove -n env_name --all

创建一个superset环境

[root@ck1 opt]# conda create -n superset python=3.6

进入环境

[root@ck1 opt]# conda activate superset

退出环境

(superset)[root@ck1 opt]# conda deactivate

然后安装一些环境:

(superset)[root@ck1 opt]# yum install -y python-setuptools (superset)[root@ck1 opt]# yum install -y gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel cyrus-scsl-devel openldap-devel

正式安装

安装superset,先更新下pip

(superset)[root@ck1 opt]# pip install --upgrade setuptools pip

安装superset

(superset)[root@ck1 opt]# pip install apache-superset

初始化superset数据库

(superset)[root@ck1 opt]# superset db upgrade

superset默认用的是sqllite数据库

superset是用的flask作为web框架,所以需要创建管理员用户。

(superset)[root@ck1 opt]# export FLASK_APP=superset (superset)[root@ck1 opt]# flask fab create-admin Username [admin]: 输入管理员名称 默认为admin User first name [admin]: 回车或输入姓氏 User last name [user]: 回车或输入名字 Email [admin@fab.org]: 回车或输入名字 Password: 密码 Repeat for confirmation:重复输入密码

superset初始化

(superset)[root@ck1 opt]# superset init

superset启动

superset run -h 0.0.0.0 -p 8787

最新回复(0)