搭建Superset数据分析与可视化平台

一、功能概述:

  1. 丰富的数据可视化集
  2. 易于使用的界面,用于探索和可视化数据
  3. 创建和共享仪表板
  4. 与主要身份验证提供程序集成的企业级身份验证(通过Flask AppBuilder进行数据库,OpenID,LDAP,OAuth和REMOTE_USER)
  5. 可扩展的高粒度安全/权限模型,允许谁可以访问各个功能和数据集的复杂规则
  6. 一个简单的语义层,允许用户通过定义哪些字段应显示在哪个下拉列表以及哪些聚合和功能度量标准可供用户使用来控制数据源在UI中的显示方式
  7. 通过SQLAlchemy与大多数讲SQL的RDBMS集成
  8. 与Druid.io深度整合

二、基于pip在Cenos7下安装(已经解决)

首先参考此博客安装Python3.6 http://www.cnblogs.com/kimyeee/p/7250560.html

1、yum install gcc libffi-devel python-devel python-pip python-wheel openssl-devel libsasl2-devel openldap-devel
2、yum -y install python-pip

出现  No package python-pip available 错误
解决方法:
yum -y install epel-release
yum install python-pip

3、pip install virtualenv
4.、virtualenv venv
 
5、. ./venv/bin/activate
此时root用户前会出现(venv) [root@cdh2 ~]# ,若想退出则输入 deactivate
6、pip3 install superset

下载结束,如果出现  error: command 'gcc' failed with exit status 1
解决方法:
 yum install gcc-c++
#  fabmanager create-admin --app superset
Username [admin]: admin
User first name [admin]: admin
User last name [user]: a
Email [[email protected]]: a
Password: 
Repeat for confirmation:
7、superset db upgrade
8、superset load_examples
9、superset init
10、superset runserver
superset runserver -p 8088 &
参考 https://blog.csdn.net/vkingnew/article/details/86509608
打开浏览器输入:http://localhost:8088 进入管理页面
(venv) [root@cdh2 ~]# pip install mysqlclient
Mysql的数据库依赖
vim /usr/local/python3/lib/python3.7/site-packages/superset/config.py

在这里插入图片描述

问题:
如果遇到Was unable to import superset Error: cannot import name '_maybe_box_datetimelike'错误则需要
pip uninstall pandas
pip install pandas==0.23.4

问题:
在这里插入图片描述
办法:pip install SQLAlchemy==1.2.18

https://segmentfault.com/q/1010000018619138

[root@hdp003 ~]# . ./venv/bin/activate
(venv) [root@hdp003 ~]# superset runserver
2019-05-22 05:21:30,852:INFO:root:The Gunicorn 'superset runserver' command is deprecated. Please use the 'gunicorn' command instead.
Starting server with command: 
gunicorn -w 2 --timeout 60 -b  0.0.0.0:8088 --limit-request-line 0 --limit-request-field_size 0 superset:app

[2019-05-22 05:21:31 -0700] [47732] [INFO] Starting gunicorn 19.9.0
[2019-05-22 05:21:31 -0700] [47732] [ERROR] Connection in use: ('0.0.0.0', 8088)
[2019-05-22 05:21:31 -0700] [47732] [ERROR] Retrying in 1 second.
[2019-05-22 05:21:32 -0700] [47732] [ERROR] Connection in use: ('0.0.0.0', 8088)
[2019-05-22 05:21:32 -0700] [47732] [ERROR] Retrying in 1 second.
[2019-05-22 05:21:33 -0700] [47732] [ERROR] Connection in use: ('0.0.0.0', 8088)
[2019-05-22 05:21:33 -0700] [47732] [ERROR] Retrying in 1 second.
[2019-05-22 05:21:34 -0700] [47732] [ERROR] Connection in use: ('0.0.0.0', 8088)
[2019-05-22 05:21:34 -0700] [47732] [ERROR] Retrying in 1 second.
[2019-05-22 05:21:35 -0700] [47732] [ERROR] Connection in use: ('0.0.0.0', 8088)
[2019-05-22 05:21:35 -0700] [47732] [ERROR] Retrying in 1 second.
[2019-05-22 05:21:36 -0700] [47732] [ERROR] Can't connect to ('0.0.0.0', 8088)
(venv) [root@hdp003 ~]# ps -ef | grep 8088
root      16445      1  0 02:54 ?        00:00:11 /usr/local/python3/bin/python3.7 //usr/local/python3/bin/superset runserver -p 8088
root      16467  16445  0 02:55 ?        00:00:04 /usr/local/python3/bin/python3.7 //usr/local/python3/bin/gunicorn -w 2 --timeout 60 -b 0.0.0.0:8088 --limit-request-line 0 --limit-request-field_size 0 superset:app
root      16470  16467  0 02:55 ?        00:00:14 /usr/local/python3/bin/python3.7 //usr/local/python3/bin/gunicorn -w 2 --timeout 60 -b 0.0.0.0:8088 --limit-request-line 0 --limit-request-field_size 0 superset:app
root      16472  16467  0 02:55 ?        00:00:14 /usr/local/python3/bin/python3.7 //usr/local/python3/bin/gunicorn -w 2 --timeout 60 -b 0.0.0.0:8088 --limit-request-line 0 --limit-request-field_size 0 superset:app
root      48195  47356  0 05:22 pts/0    00:00:00 grep --color=auto 8088
(venv) [root@hdp003 ~]# kill -9 16467
(venv) [root@hdp003 ~]# kill -9 16445
-bash: kill: (16445) - No such process
(venv) [root@hdp003 ~]# ps -ef | grep 8088
root      48333  47356  0 05:23 pts/0    00:00:00 grep --color=auto 8088
(venv) [root@hdp003 ~]# superset runserver -p 8088 &
[1] 48439
(venv) [root@hdp003 ~]# 2019-05-22 05:24:17,334:INFO:root:The Gunicorn 'superset runserver' command is deprecated. Please use the 'gunicorn' command instead.
Starting server with command: 
gunicorn -w 2 --timeout 60 -b  0.0.0.0:8088 --limit-request-line 0 --limit-request-field_size 0 superset:app

[2019-05-22 05:24:18 -0700] [48459] [INFO] Starting gunicorn 19.9.0
[2019-05-22 05:24:18 -0700] [48459] [INFO] Listening at: http://0.0.0.0:8088 (48459)
[2019-05-22 05:24:18 -0700] [48459] [INFO] Using worker: sync
[2019-05-22 05:24:18 -0700] [48462] [INFO] Booting worker with pid: 48462
[2019-05-22 05:24:18 -0700] [48463] [INFO] Booting worker with pid: 48463

升级python3.7.1
参考文章
https://www.cnblogs.com/yard/p/10083843.html
https://blog.csdn.net/qq_41623990/article/details/81203841
https://www.jianshu.com/p/d1d3946a426f
https://blog.csdn.net/jato333/article/details/82976767
注意pip3设置软连接

三、基于docker安装superset(已成功)

yum -y install docker  安装docker
docker version   检查版本
sudo systemctl start docker   运行docker
docker pull docker.io/amancevice/superset   拉取镜像,卡住了报错换国内镜像,仍报错看下面解决办法

参考文章 https://www.jianshu.com/p/1c9b9c0a3142
一步到位。

停止与开启superset服务:

**列出在运行的容器**
docker ps
**找到运行superset的容器ID,停止**
docker stop 1cc3cee5462e
**列出运行过的容器的ID,找到运行superset的容器ID**
docker ps -a
**开启superset服务**
docker start 1cc3cee5462e

四、官网地址:http://superset.apache.org/index.html

superset接入mysql和Impala数据源
https://daizj.iteye.com/blog/2363186

https://www.cnblogs.com/xiaowenshu/p/10239834.html
https://www.jianshu.com/p/8fd2edd3f56b

问题:

在这里插入图片描述
如果文件改为国内镜像的话,将修改完的/etc/docker/daemon.json改为后缀为.conf

vim /etc/sysconfig/docker
false后面加  --registry-mirror=http://f2d6cb40.m.daocloud.io
注意,要在''里面

vim/ etc/docker/daemon.conf
{"registry-mirrors":["https://docker.mirrors.ustc.edu.cn"] }
发布了118 篇原创文章 · 获赞 26 · 访问量 6万+

猜你喜欢

转载自blog.csdn.net/qq_43147136/article/details/88823076