Linux中Superset的安裝與使用


Linux中Superset的安裝與使用

安裝(碰到很多問題)

1.先安裝Python(Superset是基於Python開發的)
(百度Linux安裝Python)
2.安裝容器(為了不污染Linux的環境)和密碼驗證工具
yum upgrade python-setuptools(升級Python組件)
yum install gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel cyrus-sasl-devel openldap-devel
pip install cryptography
安裝容器
pip3 install virtualenv
3.新建容器superset,在新建的容器中安裝Python依賴和Superset
python3 -m venv superset
進入容器
. superset/bin/activate
安裝superset
pip install superset
4.安裝眾多的Python依賴包
在github上下載這個文件
wget https://github.com/Warding/InternetRecords/blob/master/%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8/superset_requirements.txt
根據文件安裝依賴(文件必須確認能夠找到)
pip install -r superset_requirements.txt
安裝mysql便於后面superset連接mysql數據庫
pip install pymysql
初始化db環境
superset db upgrade
賬戶設定
export FLASK_APP=superset
創建superset賬戶,以便在后期啟動之后登錄
flask fab create-admin(這里可能會報錯,找不到某個命令,使用pip install command對那個命令進行安裝)
下載樣例數據(這里有可能下載報錯,不影響后面的操作)
superset load_examples
superset環境初始化
superset init
啟動superset(分為兩種啟動方式,后台啟動和直接啟動)
superset run -p 8088 --with-threads --reload --debugger(默認為localhost)
superset run -h 192.168.000.000 -p 8088 --with-threads --reload --debugger(可以設置ip進行遠程訪問)
nohup superset runserver -p 500(后台運行,注意最新的superset-0.30.1版本沒有runserver這個命令)
6.登錄superset
http://192.168.000.000:8088/
7.關閉后台superset
kill -??? pid

安裝過程中碰到的問題

使用

1.建立數據庫連接
輸入連接名稱
輸入連接數據庫地址
(通常情況使用:mysql://account:password@127.0.0.1:3306/dbtest?charset=utf8 是ok的
)(
特殊情況:mysql+pymysql://account:password@127.0.0.1:3306/dbtest?charset=utf8

image
2.進行數據庫查詢
image
3.進行圖表的設計(Explore)
image

https://www.cnblogs.com/shixingchensky/p/13225848.html 借鑒很多內容,為了加深印象所以自己敲了一遍


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM