superset在win10/centos7系统安装

win10安装superset步骤:

使用pip安装,前题是安装好python3.6环境

1.安装命令:

pip install "markdown<3.0.0" -i https://pypi.tuna.tsinghua.edu.cn/simple superset

1.首先指定markdown的版本小于3.0.0,默认安装大于3,在创建用户时会报错;
2.-i 指定使用清华pip源下载superset
3.安装过程中会出现“Running setup.py bdist_wheel for python-geohash ... error;error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools” 在安装python-geohash时报错,处理方法:
下载python-geohash的whl文件 pip install xxx.whl安装。
	网址:https://www.lfd.uci.edu/~gohlke/pythonlibs/
	文件:python_geohash‑0.8.5‑cp36‑cp36m‑win_amd64.whl

2.创建管理员账号:

fabmanager create-admin --app superset  

如下: C:\Users\admin>fabmanager create-admin --app superset
Username [admin]: xieyabin
User first name [admin]: yabin
User last name [user]: xie
Email [admin@fab.org]: xybpmm@163.com
Password:
Repeat for confirmation:
提示一下:创建成功
Recognized Database Authentications.
Admin User xieyabin created.

3.初始化数据库:(一下操作在superset\bin目录下开启shell终端命令)

python superset db upgrade

4.加载数据:(一下操作在superset\bin目录下开启shell终端命令)

python superset load_examples

5.初始化角色和权限:

python superset init

6.启动服务,端口号8088,使用-p更改端口号

python superset runserver -d
然后使用浏览器,打开localhost:8088即可看到登录页面,使用创建的用户名和密码登录使用。

7.配置文件在C:\Users\admin\AppData\Local\Programs\Python\Python36\Lib\site-packages\superset文件夹下的conf.py

centos7 安装superset步骤及问题处理

前题安装好python3.x版本及pip3 安装super

1.安装命令:

pip3 install "markdown<3.0.0" -i https://pypi.tuna.tsinghua.edu.cn/simple superset

安装过程中问题处理:
	1.首先指定markdown的版本小于3.0.0,默认安装大于3,在创建用户时会报错;
	2.-i 指定使用清华pip源下载superset
	3.安装过程中 sasl 安装会报错缺少依赖sasl.h的问题,需要安装依赖文件:
		yum install cyrus-sasl-lib.x86_64
		yum install cyrus-sasl-devel.x86_64
		yum install libgsasl-devel.x86_64
		yum install saslwrapper-devel.x86_64
		一般拉说前面三句基本能解决问题,第四句留着实在没办法时用。

2.创建管理员账号:

fabmanager create-admin --app superset  

如下: C:\Users\admin>fabmanager create-admin --app superset
Username [admin]: xieyabin
User first name [admin]: yabin
User last name [user]: xie
Email [admin@fab.org]: xybpmm@163.com
Password:
Repeat for confirmation:
提示一下:创建成功
Recognized Database Authentications.
Admin User xieyabin created.

3.初始化数据库:

superset db upgrade

4.加载数据:

superset load_examples

5.初始化角色和权限:

superset init

6.启动服务,端口号8088,使用-p更改端口号

superset runserver -d
然后使用浏览器,打开localhost:8088即可看到登录页面,使用创建的用户名和密码登录使用。

7.配置文件所在的路径为:

/usr/local/lib/python3.6/site-packages/superset/config.py

8.基础教程:http://superset.apache.org/tutorial.html

嵌入后台应用

  1. 修改配置文件
    修改superset中的config.py配置文件,将PUBLIC_ROLE_LIKE_GAMMA改为True。

    # Grant public role the same set of permissions as for the GAMMA role.
    # This is useful if one wants to enable anonymous users to view
    # dashboards. Explicit grant on specific datasets is still required.
    PUBLIC_ROLE_LIKE_GAMMA = True
    注释意思:
    授予公共角色与GAMMA角色相同的权限集。
    如果想让匿名用户查看,可以设置这里,在仪表盘对特定数据集的授权显示,也在这里设置。
    

2.去掉X-Frame-Options限制
避免iframe跨站访问问题:

# If you need to allow iframes from other domains (and are
# aware of the risks), you can disable this header:
HTTP_HEADERS = {}

3.添加用户数据库权限:
系统安全–>角色列表–>public权限修改添加:

	can explore on Superset为导出图表 
	can explore json on Superset为导出图表json 
	all database access on all_database_access访问所有数据库权限,也可以设置单个 

4.地图不显示问题:
需要先注册网站:https://www.mapbox.com/account/ 获得appkey,在conf文件配置:

MAPBOX_API_KEY = os.environ.get('MAPBOX_API_KEY', 'pk.eyJ1IjoieGlleWFiaW4iLCJhIjoiY2pubGIzMjB1MWo3eTNxbXplem9jMDdvbyJ9.f2GzXdX24LbUdG-B_hOY1A')
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值