superset安装教程(转载)

原视频:https://www.bilibili.com/video/BV1ia4y1s7yM
原文档:https://www.jianshu.com/p/7392afceeefc

视频比文档多一步安装依赖
superset安装教程(转载)_第1张图片
superset安装教程(转载)_第2张图片

视频比文档多一条命令python -m pip install --upgrade pip(安装和更新pip)
superset安装教程(转载)_第3张图片
superset安装教程(转载)_第4张图片
1、安装python3以上版本

cd /usr/local/src

下载文件

yum install wget

wgethttps://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz(这里我已经提前下载,所以直接上传)

解压

tar -zxvf Python-3.6.0.tgz

进入解压目录

cd Python-3.6.0

编译安装包

./configure --prefix=/usr/local/python

make && make install

添加环境变量

echo PATH=’/usr/local/python/bin/:$PATH’ >> /etc/profile

source /etc/profile

检查是否成功,执行下面代码

python3.6

修改系统默认的Python路径,因为在终端中输入Python命令时默认是指向 Python2.7.5

mv /usr/bin/python /usr/bin/python-2.7.5

建立新的软连接,指向Python-3.6.0

ln -s /usr/local/python/bin/python3.6 /usr/bin/python

因为yum是依赖python的,所以这里我们修改了默认的python,就要修改yum,让其运行指向旧的版本:

vi /usr/bin/yum

将第一行中的“#!/usr/bin/python” 修改为“#!/usr/bin/python-2.7.5”,保存即可

vi /usr/libexec/urlgrabber-ext-down(同上)

打开一个新的终端,通过python命令进入python环境,可以看到已经指向了我们新安装的python3.6.0:

python

Python 3.6.0 (default, Dec 12 2018, 03:40:52)

[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux

Type “help”, “copyright”, “credits” or “license” for more information.

2、安装容器和密码验证工具,建议直接按照以下指令顺序执行就好

yum upgrade python-setuptools

yum install gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel cyrus-sasl-devel openldap-devel

pip install cryptography

pip install virtualenv

3、新建一个容器空间进行操作(网上一堆的教程都是将superset安装在容器之中,可能是为了环境隔离吧,因为中间需要使用的第三方依赖库还是很多的,避免影响了原始业务系统环境吧)

python3 -m venv venv – 新建一个名为venv的容器空间,同时也会新建在当前目录下新建一个venv的文件夹,请提前切换好工作文件夹

. venv/bin/activate – 进入venv的容器环境

pip install superset – 容器环境下安装superset

以下是重点,最多坑的地方,因为superset的运行依赖很多第三方库代码,所以安装python的依赖包并保证完整性很费事,有人整理了一个文档将这些依赖包进行汇总,下载此文档后,在本地按照文件安装依赖包就好

wgethttps://github.com/Warding/InternetRecords/blob/master/%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8/superset_requirements.txt(这里我已经提前下载,所以直接上传)

pip install --upgrade pip

pip install -r superset_requirements.txt – 安装依赖包

superset db upgrade – 初始化db环境

export FLASK_APP=superset --账户设定

flask fab create-admin --创建账户按提示输入账密就好

superset load_examples --下载样例数据,可不执行

superset init --superset环境初始化

superset run -p 8088 -h 192.168.236.167 --with-threads – superset 启动(这里面我指定了端口和IP,分别是-p 和 -h 参数,建议指定成自己的服务器IP和某个端口,网页访问的时候,还需要将这个端口对外开放,不然你本地登录网页访问会无法成功

4、使用 输入上面的IP和端口对应的网址就行http://192.168.2.1:8088/,登录后输入刚刚建立的账密就好

《superset_requirements.txt》

This file is autogenerated by pip-compile

To update, run:

pip-compile --output-file=requirements.txt setup.py

alembic==1.3.2 # via flask-migrate

amqp==2.5.2 # via kombu

apispec[yaml]==1.3.3 # via flask-appbuilder

attrs==19.3.0 # via jsonschema

babel==2.8.0 # via flask-babel

backoff==1.10.0 # via apache-superset (setup.py)

billiard==3.6.3.0 # via celery

bleach==3.1.0 # via apache-superset (setup.py)

celery==4.4.1 # via apache-superset (setup.py)

cffi==1.13.2 # via cryptography

click==7.1.1 # via apache-superset (setup.py), flask, flask-appbuilder

colorama==0.4.3 # via apache-superset (setup.py), flask-appbuilder

contextlib2==0.6.0.post1 # via apache-superset (setup.py)

croniter==0.3.31 # via apache-superset (setup.py)

cryptography==2.8 # via apache-superset (setup.py)

decorator==4.4.1 # via retry

defusedxml==0.6.0 # via python3-openid

flask-appbuilder==2.2.4 # via apache-superset (setup.py)

flask-babel==1.0.0 # via flask-appbuilder

flask-caching==1.8.0 # via apache-superset (setup.py)

flask-compress==1.4.0 # via apache-superset (setup.py)

flask-jwt-extended==3.24.1 # via flask-appbuilder

flask-login==0.4.1 # via flask-appbuilder

flask-migrate==2.5.2 # via apache-superset (setup.py)

flask-openid==1.2.5 # via flask-appbuilder

flask-sqlalchemy==2.4.1 # via flask-appbuilder, flask-migrate

flask-talisman==0.7.0 # via apache-superset (setup.py)

flask-wtf==0.14.2 # via apache-superset (setup.py), flask-appbuilder

flask==1.1.1 # via apache-superset (setup.py), flask-appbuilder, flask-babel, flask-caching, flask-compress, flask-jwt-extended, flask-login, flask-migrate, flask-openid, flask-sqlalchemy, flask-wtf

geographiclib==1.50 # via geopy

geopy==1.20.0 # via apache-superset (setup.py)

gunicorn==20.0.4 # via apache-superset (setup.py)

humanize==0.5.1 # via apache-superset (setup.py)

importlib-metadata==1.4.0 # via jsonschema, kombu

isodate==0.6.0 # via apache-superset (setup.py)

itsdangerous==1.1.0 # via flask

jinja2==2.10.3 # via flask, flask-babel

jsonschema==3.2.0 # via flask-appbuilder

kombu==4.6.8 # via celery

mako==1.1.1 # via alembic

markdown==3.1.1 # via apache-superset (setup.py)

markupsafe==1.1.1 # via jinja2, mako

marshmallow-enum==1.5.1 # via flask-appbuilder

marshmallow-sqlalchemy==0.21.0 # via flask-appbuilder

marshmallow==2.19.5 # via flask-appbuilder, marshmallow-enum, marshmallow-sqlalchemy

more-itertools==8.1.0 # via zipp

msgpack==0.6.2 # via apache-superset (setup.py)

numpy==1.18.1 # via pandas, pyarrow

pandas==0.25.3 # via apache-superset (setup.py)

parsedatetime==2.5 # via apache-superset (setup.py)

pathlib2==2.3.5 # via apache-superset (setup.py)

polyline==1.4.0 # via apache-superset (setup.py)

prison==0.1.2 # via flask-appbuilder

py==1.8.1 # via retry

pyarrow==0.16.0 # via apache-superset (setup.py)

pycparser==2.19 # via cffi

pyjwt==1.7.1 # via flask-appbuilder, flask-jwt-extended

pyrsistent==0.15.7 # via jsonschema

python-dateutil==2.8.1 # via alembic, apache-superset (setup.py), croniter, flask-appbuilder, pandas

python-dotenv==0.10.5 # via apache-superset (setup.py)

python-editor==1.0.4 # via alembic

python-geohash==0.8.5 # via apache-superset (setup.py)

python3-openid==3.1.0 # via flask-openid

pytz==2019.3 # via babel, celery, flask-babel, pandas

pyyaml==5.3 # via apache-superset (setup.py), apispec

retry==0.9.2 # via apache-superset (setup.py)

selenium==3.141.0 # via apache-superset (setup.py)

simplejson==3.17.0 # via apache-superset (setup.py)

six==1.14.0 # via bleach, cryptography, flask-jwt-extended, flask-talisman, isodate, jsonschema, pathlib2, polyline, prison, pyarrow, pyrsistent, python-dateutil, sqlalchemy-utils, wtforms-json

sqlalchemy-utils==0.36.1 # via apache-superset (setup.py), flask-appbuilder

sqlalchemy==1.3.12 # via alembic, apache-superset (setup.py), flask-sqlalchemy, marshmallow-sqlalchemy, sqlalchemy-utils

sqlparse==0.3.0 # via apache-superset (setup.py)

urllib3==1.25.8 # via selenium

vine==1.3.0 # via amqp, celery

webencodings==0.5.1 # via bleach

werkzeug==0.16.0 # via flask, flask-jwt-extended

wtforms-json==0.3.3 # via apache-superset (setup.py)

wtforms==2.2.1 # via flask-wtf, wtforms-json

zipp==2.0.0 # via importlib-metadata

The following packages are considered to be unsafe in a requirements file:

setuptools

你可能感兴趣的:(superset安装教程(转载))