Linux下安装Superset实践

一、安装

安装虚拟环境,避免影响本机python环境
conda create --name super  python=3.6
source activate super

$yum install gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel libsasl2-devel openldap-devel

 

$pip install flask wtforms_json flask_appbuilder
$pip install wtforms_json flask_compress celery flask_migrate flask_talisman flask_caching sqlparse bleach markdown numpy parsedatetime pathlib2 simplejson humanize geohash polyline geopy cryptography backoff msgpack pyarrow contextlib2 croniter retry selenium isodate

pip install pytest-runner 如果这个安装不上就用其他pip数据源

报错:Could not find a version that satisfies the requirement pytest (from versions: )
No matching distribution found for pytest-runner

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pytest-runner (使用清华数据源安装)

其他包,要特别注意版本号的组件

pip install pandas==0.23.4
pip install --upgrade werkzeug==0.16.1
pip install flask-jwt-extended==3.18.1
pip install flask==0.12.5
pip install sqlalchemy==1.2.18
pip install superset==0.28.1
使用清华数据源安装:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple superset==0.28.1
最后安装superset,注意superset的版本要选择0.28.1,版本选择不对会在后边报:
auth_type.get(_appbuilder.sm.auth_type, "No Auth method")的异常;

二、创建管理员用户名和密码

fabmanager create-admin --app superset

如果创建管理员账号提交报错 Was unable to import superset Error: cannot import name '_maybe_box_datetimelike' ,那则是因为pandas版本的原因,我们通过pip命令卸载掉较新的版本安装正确的版本就好

#卸载
pip uninstall pandas
#安装
pip install pandas==0.23.4

 

$fabmanager create-admin --app superset
fabmanager is going to be deprecated in 2.2.X, you can use the same commands on the improved 'flask fab <command>'
Username [admin]: admin
User first name [admin]: admin
User last name [user]: user      
Email [admin@fab.org]: user
Password:  密码
Repeat for confirmation:  密码
Recognized Database Authentications.
Admin User admin created.

问题:在执行到fabmanager create-admin --app superset时,提示:-bash:fabmanager not found
解决方式:
(1)安装requests包
先安装requests,执行:

pip install requests -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com/

(2)安装flask-appbuilder,执行命令:

pip install flask-appbuilder -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com/

安装完成之后就可以使用fabmanager命令了。

三、初始化Superset (以下几步没有明显报错就行)

superset db upgrade

四、装载初始化样例数据

superset load_examples

五、创建默认角色和权限

superset init

六、启动Superset

superset runserver -d -p 5000 (注意最新的superset-0.30.1版本没有runserver这个命令)
nohup superset runserver -p 5000 &(后台运行,注意最新的superset-0.30.1版本没有runserver这个命令)

七、连接数据库需要安装:
 

yum install mysql-devel

pip install mysqlclient
pip install pymssql
pip install pyhive

hive与superset集成,superset连接hive出现
root:Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: No worthy mechs found'

yum install cyrus-sasl-plain  cyrus-sasl-devel  cyrus-sasl-gssapi

退出后,重新启动superset成功

八、https方式启动服务(有证书方式)

1.superset版本为2.8.1安装后用http访问都可以,启动脚本为:
 

gunicorn -w 4 --timeout 100 -b 10.80.22.18:80 --limit-request-line 0 --limit-request-field_size 0 --forwarded-allow-ips="" superset:app

2.我的解决方式就是:把gunicore开的http服务变成https服务,启动命令为:
 

gunicorn -w 2 --timeout 100 -b 10.80.22.18:443 --certfile=server.pom --keyfile=server.key --limit-request-line 0 --limit-request-field_size 0 --forwarded-allow-ips="" superset:app

安装参考:
超级给力 https://zhuanlan.zhihu.com/p/111295100
https://blog.csdn.net/qq_41623990/article/details/81203841
https://www.cnblogs.com/luweilehei/p/10645457.html
数据源问题解决:https://blog.csdn.net/t8116189520/article/details/90717498
官网:http://superset.apache.org/tutorials.html
https方式:https://blog.csdn.net/Alongpo/article/details/87882172

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值