文档章节

windows 10安装 superset 集成kylin2.5.0

P
 PeakFang-BOK
发布于 2018/12/18 09:21
字数 1748
阅读 250
收藏 0

Superset 是一个数据探索和可视化平台,设计用来提供直观的,可视化的,交互式的分析体验,专注于数据可视化展现。
Superset 提供了两种分析数据源的方式:
1. 用户可以以单表形式直接查询多种数据源,包括 Presto、Hive、Impala、SparkSQL、MySQL、Postgres、Oracle、Redshift、SQL Server、Druid 、kylin等数据源。
2. 一个 SQL 的 IDE 供高级分析师使用 SQL 查询定义所需要分析的数据集,这种方法使用户在一个查询中实现用 Superset 查询数据源的多表,并立即对查询进行可视化分析。

安装python3.6

此过程简单,下载对应OS版本安装即可。

安装virtualenv

Superset需要安装的组件较多,最好是使用virtualenv独立一套python环境
D:\python\Anaconda3>pip install virtualenv
Collecting virtualenv
  Downloading https://files.pythonhosted.org/packages/7c/17/9b7b6cddfd255388b58c61e25b091047f6814183e1d63741c8df8dcd65a2/virtualenv-16.1.0-py2.py3-none-any.whl (1.9MB)
    100% |████████████████████████████████| 1.9MB 2.2MB/s
Installing collected packages: virtualenv
Successfully installed virtualenv-16.1.0

自定义 D:\python\Anaconda3\myprojects 目录
D:\python\Anaconda3>cd D:\python\Anaconda3\myprojects
初始化
D:\python\Anaconda3\myprojects>virtualenv env
Using base prefix 'd:\\python\\anaconda3'
New python executable in D:\python\Anaconda3\myprojects\env\Scripts\python.exe
Installing setuptools, pip, wheel...
done.

激活,激活后界面命令行有env标识,后续操作也可在env中生效,不会影响整体Python环境。
D:\python\Anaconda3\myprojects>env\Scripts\activate

(env) D:\python\Anaconda3\myprojects>

安装Microsoft visual c++ 14.0
否则会在安装superset过程中报如下错误
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
可从此百度网盘下载,从给的链接微软官方下载安装太麻烦
https://pan.baidu.com/s/1WaBxFghTll6Zofz1DGOZBg
安装后需要重启机器

安装sasl
直接通过pip install sasl安装时如果没有安装Microsoft visual c++ 14.0也会报错
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及操作系统对应版本的.whl包进行安装
http://www.lfd.uci.edu/~gohlke/pythonlibs/#sasl
下载后安装
D:\python\Anaconda3>pip install myprojects\sasl-0.2.1-cp36-cp36m-win_amd64.whl
Processing d:\python\anaconda3\myprojects\sasl-0.2.1-cp36-cp36m-win_amd64.whl
Requirement already satisfied: six in d:\python\anaconda3\lib\site-packages (from sasl==0.2.1) (1.10.0)
Installing collected packages: sasl
Successfully installed sasl-0.2.1

安装superset
(env) D:\python\Anaconda3\myprojects>pip install superset
Collecting superset
......
  Running setup.py install for superset ... done
Successfully installed cchardet-2.1.4 et-xmlfile-1.0.1 ijson-2.3 jdcal-1.4 jsonlines-1.2.0 jsonschema-2.6.0 linear-tsv-1.1.0 openpyxl-2.4.11 pure-sasl-0.5.1 python-geohash-0.8.5 pyyaml-3.13 rfc3986-1.2.0 simplejson-3.16.0 sqlalchemy-utils-0.33.9 sqlparse-0.2.4 superset-0.28.1 tableschema-1.3.0 tabulator-1.19.0 thrift-0.11.0 thrift-sasl-0.3.0 unicodecsv-0.14.1 unidecode-1.0.23 xlrd-1.2.0

创建管理员帐号
(env) D:\python\Anaconda3\myprojects>fabmanager create-admin --app superset
Username [admin]: admin
User first name [admin]: admin
User last name [user]: admin
Email [admin@fab.org]:
Password:
Repeat for confirmation:
Recognized Database Authentications.
Admin User admin created.

初始化数据库 (先进入到virtualEnv的虚拟目录下,Lib\site-packages\superset\bin下)
(env) D:\python\Anaconda3\myprojects>cd D:\python\Anaconda3\myprojects\env\Lib\site-packages\superset\bin

(env) D:\python\Anaconda3\myprojects\env\Lib\site-packages\superset\bin>python superset db upgrade
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
......
INFO  [alembic.runtime.migration] Running upgrade 0c5070e96b57 -> 1a1d627ebd8e, position_json
INFO  [alembic.runtime.migration] Running upgrade 1a1d627ebd8e -> 55e910a74826, add_metadata_column_to_annotation_model.py
 

安装自带实例
(env) D:\python\Anaconda3\myprojects\env\Lib\site-packages\superset\bin>python superset load_examples
Loading examples into <SQLA engine=sqlite:///C:\Users\huafeng.fang\.superset\superset.db>
Creating default CSS templates
Loading energy related dataset
Creating table [wb_health_population] reference
2018-12-17 13:49:24,861:INFO:root:Creating database reference
2018-12-17 13:49:24,924:INFO:root:Database.get_sqla_engine(). Masked URL: sqlite:///C:\Users\huafeng.fang\.superset\superset.db
Loading [World Bank's Health Nutrition and Population Stats]
Creating table [wb_health_population] reference
2018-12-17 13:55:07,350:INFO:root:Creating database reference
Creating slices
Creating a World's Health Bank dashboard
Loading [Birth names]
Done loading table!
--------------------------------------------------------------------------------
Creating table [birth_names] reference
2018-12-17 13:55:09,191:INFO:root:Creating database reference
Creating some slices
Creating a dashboard
Loading [Random time series data]
Done loading table!
--------------------------------------------------------------------------------
Creating table [random_time_series] reference
2018-12-17 13:55:10,083:INFO:root:Creating database reference
Creating a slice
Loading [Random long/lat data]
Done loading table!
--------------------------------------------------------------------------------
Creating table reference
2018-12-17 13:55:22,340:INFO:root:Creating database reference
Creating a slice
Loading [Country Map data]
Done loading table!
--------------------------------------------------------------------------------
Creating table reference
2018-12-17 13:55:22,504:INFO:root:Creating database reference
Creating a slice
Loading [Multiformat time series]
Done loading table!
--------------------------------------------------------------------------------
Creating table [multiformat_time_series] reference
2018-12-17 13:55:22,676:INFO:root:Creating database reference
Creating Heatmap charts
Loading [Paris GeoJson]
Creating table paris_iris_mapping reference
2018-12-17 13:55:24,438:INFO:root:Creating database reference
Loading [San Francisco population polygons]
Creating table sf_population_polygons reference
2018-12-17 13:55:24,569:INFO:root:Creating database reference
Loading [Flights data]
2018-12-17 13:55:27,395:INFO:root:Creating database reference
Done loading table!
Loading [BART lines]
Creating table bart_lines reference
2018-12-17 13:55:27,528:INFO:root:Creating database reference
Loading [Multi Line]
Creating table [wb_health_population] reference
2018-12-17 13:55:35,318:INFO:root:Creating database reference
Creating slices
Creating a World's Health Bank dashboard
Done loading table!
--------------------------------------------------------------------------------
Creating table [birth_names] reference
2018-12-17 13:55:36,941:INFO:root:Creating database reference
Creating some slices
Creating a dashboard
Loading [Misc Charts] dashboard
Creating the dashboard
Loading DECK.gl demo
Loading deck.gl dashboard
Creating Scatterplot slice
Creating Screen Grid slice
Creating Hex slice
Creating Grid slice
Creating Polygon slice
Creating Arc slice
Creating Path slice
Creating a dashboard

初始化角色和权限
(env) D:\python\Anaconda3\myprojects\env\Lib\site-packages\superset\bin>python superset init
2018-12-17 13:56:27,513:INFO:root:Creating database reference
2018-12-17 13:56:27,513:INFO:root:Syncing role definition
2018-12-17 13:56:27,622:INFO:root:Syncing Admin perms
2018-12-17 13:56:27,733:INFO:root:Syncing Alpha perms
2018-12-17 13:56:28,115:INFO:root:Syncing Gamma perms
2018-12-17 13:56:28,473:INFO:root:Syncing granter perms
2018-12-17 13:56:28,778:INFO:root:Syncing sql_lab perms
2018-12-17 13:56:29,142:INFO:root:Fetching a set of all perms to lookup which ones are missing
2018-12-17 13:56:29,212:INFO:root:Creating missing datasource permissions.
2018-12-17 13:56:29,212:INFO:root:Creating missing database permissions.
2018-12-17 13:56:29,259:INFO:root:Creating missing metrics permissions
2018-12-17 13:56:29,274:INFO:root:Cleaning faulty perms

初始化角色和权限
(env) D:\python\Anaconda3\myprojects\env\Lib\site-packages\superset\bin>python superset init
2018-12-17 13:56:27,513:INFO:root:Creating database reference
2018-12-17 13:56:27,513:INFO:root:Syncing role definition
2018-12-17 13:56:27,622:INFO:root:Syncing Admin perms
2018-12-17 13:56:27,733:INFO:root:Syncing Alpha perms
2018-12-17 13:56:28,115:INFO:root:Syncing Gamma perms
2018-12-17 13:56:28,473:INFO:root:Syncing granter perms
2018-12-17 13:56:28,778:INFO:root:Syncing sql_lab perms
2018-12-17 13:56:29,142:INFO:root:Fetching a set of all perms to lookup which ones are missing
2018-12-17 13:56:29,212:INFO:root:Creating missing datasource permissions.
2018-12-17 13:56:29,212:INFO:root:Creating missing database permissions.
2018-12-17 13:56:29,259:INFO:root:Creating missing metrics permissions
2018-12-17 13:56:29,274:INFO:root:Cleaning faulty perms

启动服务,端口 8088, 使用 -p 更改端口号
(env) D:\python\Anaconda3\myprojects\env\Lib\site-packages\superset\bin>python superset runserver -d
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Starting Superset server in DEBUG mode
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

2018-12-17 13:57:02,821:INFO:werkzeug: * Restarting with stat
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Starting Superset server in DEBUG mode
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

2018-12-17 13:57:05,340:WARNING:werkzeug: * Debugger is active!
2018-12-17 13:57:05,340:INFO:werkzeug: * Debugger PIN: 483-986-611
2018-12-17 13:57:05,356:INFO:werkzeug: * Running on http://0.0.0.0:8088/ (Press CTRL+C to quit)

配置的用户密码登录

与kylin集成

安装kylinpy
(env) D:\python\Anaconda3\myprojects>pip install --upgrade kylinpy
Collecting kylinpy
Requirement already satisfied, skipping upgrade: click<7,>=6.7 in d:\python\anaconda3\myprojects\env\lib\site-packages (from kylinpy) (6.7)
Installing collected packages: kylinpy
Successfully installed kylinpy-2.1.2

否则创建kylin数据源使会提示
sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:kylin
2018-12-17 14:18:39,516:INFO:werkzeug:127.0.0.1 - - [17/Dec/2018 14:18:39] "POST /superset/testconn HTTP/1.1" 500 -

安装后重启superset,测试数据源添加成功

添加数据表

在SQL编辑器中执行SQL

 

 

© 著作权归作者所有

P
粉丝 7
博文 134
码字总数 336718
作品 0
西安
架构师
私信 提问
windows server 2008 安装python BI程序 superset

环境要求 windows server 2008 R2 Enterprise x64 python2.7.13 virtualenv 安装python 安装vc++ 14 安装MicrosoftVCTools2017 (注意安装这个,不然安装superset的时候会报错) 安装python2.7......

随你疯
2018/08/31
181
0
(转)给大数据分析师的一双大礼:Apache Kylin和Superset

$ pip install superset# 创建初始超级用户: admin/admin$ fabmanager create-admin --app superset --username admin --password admin --firstname admin --lastname admin --email admin@......

seapeak007
2018/05/08
0
0
Apache Kylin和Superset(Caravel)集成

本文转自Apache Kylin公众号apachekylin. Superset 是一个数据探索和可视化平台,设计用来提供直观的,可视化的,交互式的分析体验。 Superset 提供了两种分析数据源的方式: 1. 用户可以以单...

hblt-j
2018/07/09
300
5
基于docker安装superset

superset简介 曾用名Caravel, Panoramix, 是由Airbnb(知名在线房屋短租公司)开源的数据分析与可视化平台, 该工具主要特点是可自助分析, 自定义仪表盘, 分析结果可视化(导出), 用户/角色权...

li木水
2018/08/19
0
0
superset开源可视化BI工具部署

前言: superset是airbnb开源的一款BI产品,支持多种数据库连接,拥有丰富的图表类型,其部署方便,制作看板迅速,能够款速方便的实现数据分析和可视化,是个人和小企业自助BI的不错选择。s...

bz_z
2018/10/15
0
0

没有更多内容

加载失败,请刷新页面

加载更多

视频如何加水印?

很多视频制作者的视频都被他人盗用过,为了防止自己的劳动成果被他人窃取,给视频加水印对于视频制作者来说,是一件非常重要的事情。那么下面分享一个手机给视频加水印的方法,一起来看看吧!...

白米稀饭2019
16分钟前
2
0
004-Envelop-基于Blockstack的文件传输dapp

本篇文章主要介绍基于Blockstack的文件传输工具; ####A-链接地址 官网地址:https://envelop.app/ Github地址:https://github.com/envelop-app ####B-特性: 1: Share private files easil...

Riverzhou
19分钟前
5
0
SpringCloud——声明式调用Feign

Feign声明式调用 一、Feign简介 使用Ribbon和RestTemplate消费服务的时候,有一个最麻烦的点在于,每次都要拼接URL,组织参数,所以有了Feign声明式调用,Feign的首要目标是将Java HTTP客户端...

devils_os
25分钟前
5
0
《JAVA核心知识》学习笔记 (22. 数据结构)

22.1.1. 栈(stack) 栈( stack)是限制插入和删除只能在一个位置上进行的表,该位置是表的末端,叫做栈顶 (top)。它是后进先出(LIFO)的。对栈的基本操作只有 push(进栈)和 pop(出栈...

Shingfi
30分钟前
5
0
你对AJAX认知有多少(1)?

AJAX(一) AJAX技术对于前段或者后端工程师来说,都是必不可缺的 那我们这几期都来细细品味一下AJAX的相关知识,直接上干货喽~ 1、什么是AJAX,为什么要使用Ajax(请谈一下你对Ajax的认识) 什么...

理性思考
38分钟前
12
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部