Apache Superset是一個開源的、現(xiàn)代的、輕量級BI分析工具,能夠?qū)佣喾N數(shù)據(jù)源、擁有豐富的圖表展示形式、支持自定義儀表盤,且擁有友好的用戶界面,十分易用。
在學習數(shù)倉項目的時候,按照教程安裝Superset反復(fù)重復(fù)多次都沒能成狗,最后稍微修改之后得以成功安裝,現(xiàn)記錄下安裝過程
安裝Miniconda
下載Miniconda
下載地址:https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
安裝Miniconda
執(zhí)行以下命令
bash Miniconda3-latest-Linux-x86_64.sh
在安裝的過程中可以指定安裝路徑
如果出現(xiàn)以下字段,則安裝成功
加載環(huán)境變量配置文件
source ~/.bashrc
取消激活base環(huán)境
安裝完成之后,每次打開終端都會激活默認的base環(huán)境,通過以下命令取消激活
conda config --set auto_activate_base false
創(chuàng)建Python3.6環(huán)境
配置國內(nèi)鏡像
(base) [jx@hadoop102 software]$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
(base) [jx@hadoop102 software]$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
(base) [jx@hadoop102 software]$ conda config --set show_channel_urls yes
創(chuàng)建Python3.6環(huán)境
(base) [jx@hadoop102 software]$ conda create --name superset python=3.6
執(zhí)行完畢
激活superset環(huán)境
(base) [jx@hadoop102 software]$ conda activate superset
效果如下
使用該命令可以查看python版本
(superset) [jx@hadoop102 software]$ python --version
退出該環(huán)境可以執(zhí)行如下命令
(superset) [jx@hadoop102 software]$ conda deactivate
Superset部署
以下所有的操作,都要在superset的環(huán)境下進行
安裝依賴
(superset) [jx@hadoop102 software]$ sudo yum install -y gcc gcc-c++ libffi-devel python-devel python-pip python-wheel python-setuptools openssl-devel cyrus-sasl-devel openldap-devel
安裝Superset
安裝setuptools和pip
(superset) [jx@hadoop102 software]$ pip install --upgrade setuptools pip -i https://pypi.douban.com/simple/
安裝Superset
(superset) [jx@hadoop102 software]$ pip install apache-superset -i https://pypi.douban.com/simple/
然后執(zhí)行以下命令(以下兩個命令是因為原教程安裝錯誤而自己修改的,包括上面的Python3.6環(huán)境)
(superset) [jx@hadoop102 software]$ pip install sqlalchemy==1.3.24
(superset) [jx@hadoop102 software]$ pip install dataclasses
初始化Superset數(shù)據(jù)庫
(superset) [jx@hadoop102 software]$ superset db upgrade
創(chuàng)建管理員用戶
(superset) [jx@hadoop102 software]$ export FLASK_APP=superset
(superset) [jx@hadoop102 software]$ superset fab create-admin
以上自行配置即可
Superset初始化
(superset) [jx@hadoop102 software]$ superset init
啟動Superset
安裝gunicorn
(superset) [jx@hadoop102 software]$ pip install gunicorn -i https://pypi.douban.com/simple/
啟動Superset
(superset) [jx@hadoop102 software]$ gunicorn --workers 5 --timeout 120 --bind hadoop102:8787 "superset.app:create_app()" --daemon
登錄Superset
訪問 主機地址+8787 即可
例如我的
http://hadoop102:8787/
使用自己創(chuàng)建的管理員賬號登錄即可
文章來源:http://www.zghlxwxcb.cn/news/detail-466290.html
停止superset
(superset) [jx@hadoop102 software]$ ps -ef | awk '/superset/ && !/awk/{print $2}' | xargs kill -9
ng" alt=“image-20221019131448499” style=“zoom:80%;” />文章來源地址http://www.zghlxwxcb.cn/news/detail-466290.html
停止superset
(superset) [jx@hadoop102 software]$ ps -ef | awk '/superset/ && !/awk/{print $2}' | xargs kill -9
到了這里,關(guān)于Superset的安裝(親測三遍,有效)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!