Superset 部署

759 阅读2分钟

Superset是什么?

superset是一个现代的、企业级的商业智能web应用程序。它快速、轻量级、直观,并加载了各种选项,使所有技能集的用户都可以轻松地探索和可视化他们的数据,从简单的饼图到高度详细的deck.gl地理空间图。

Superset provides:

  • An intuitive interface for visualizing datasets and crafting interactive dashboards
  • A wide array of beautiful visualizations to showcase your data
  • Code-free visualization builder to extract and present datasets
  • A world-class SQL IDE for preparing data for visualization, including a rich metadata browser
  • A lightweight semantic layer which empowers data analysts to quickly define custom dimensions and metrics
  • Out-of-the-box support for most SQL-speaking databases
  • Seamless, in-memory asynchronous caching and queries
  • An extensible security model that allows configuration of very intricate rules on on who can access which product features and datasets.
  • Integration with major authentication backends (database, OpenID, LDAP, OAuth, REMOTE_USER, etc)
  • The ability to add custom visualization plugins
  • An API for programmatic customization
  • A cloud-native architecture designed from the ground up for scale

目前有几种不同的方式来启动Superset:

  • Download the source from Apache Foundation's website
  • Download the latest Superset version from Pypi here
  • Setup Superset locally with one command using Docker Compose
  • Download the Docker image from Dockerhub
  • Install the latest version of Superset from Github

安装与配置

本文使用ubuntu虚拟机来进行superset环境的部署

在本地搭建superset最快的方案是在Linux或MacOSX计算机上使用Docker和Docker Compose。Superset没有对Windows的官方支持,因此官方提供了一个VM解决方案,可以参考官方文档中该部分内容。

1. 安装Docker Engine和Docker Compose

Install Docker

第一步:查询Docker Engine需要的ubuntu版本以及x86_64(or amd64),armhf,和arm64等

第二步:卸载旧版本的docker

 $ sudo apt-get remove docker docker-engine docker.io containerd runc

第三步:使用已有仓库进行安装

(1)更新apt包并且允许apt使用通过HTTPS使用仓库进行安装
     $ sudo apt-get update
     $ sudo apt-get install \
        apt-transport-https \
        ca-certificates \
        curl \
        gnupg \
        lsb-release
(2)添加Docker’s official GPG key
     $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
(3)使用以下命令设置稳定存储库。要添加nightly或test存储库,请在下面的命令中的单词stable后面添加单词nightly或test(或两者)。
   x86_64/amd64
     $ echo \
       "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ 
       $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
   armhf
     $ echo \
       "deb [arch=armhf signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
       $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
   arm64
     $ echo \
       "deb [arch=arm64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
       $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
       

Install Docker Engine

第一步:更新apt包,安装最新版本的Docker Engine,或者直接到第二步来安装具体的版本

 $ sudo apt-get update
 $ sudo apt-get install docker-ce docker-ce-cli containerd.io

第二步:安装具体的版本

 $ apt-cache madison docker-ce 

Install a specific version using the version string from the second column,for example, 5:18.09.1~3-0~ubuntu-xenial

 $ sudo apt-get install docker-ce=<VERSION_STRING> docker-ce-cli=<VERSION_STRING> containerd.io

验证Docker Engine已经正确安装完成

$ sudo docker run hello-world

Install Compose

运行这个命令来下载Docker Compose最新稳定的版本

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

修改权限

sudo chmod +x /usr/local/bin/docker-compose

Docker安装官方文档docs.docker.com/engine/inst…

2. 克隆Superset's Github repository

在需要安装的路径下

$ git clone https://github.com/apache/superset.git

3. 通过Docker Compose来启动Superset

进入superset(该文件夹为2中仓库clone结果)

$ cd superset
运行下述命令
$ docker-compose -f docker-compose-non-dev.yml up

4. 登陆到Superset

本地superset实例中还包括一个Postgres服务器来存储您的数据,并且已经预加载了Superset附带的一些示例数据集。您现在可以通过web浏览器访问Superset http://localhost:8088 请注意,许多浏览器现在默认为https-如果浏览器是其中之一,请确保它使用http。

使用默认的用户来登陆:

username:admin
password:admin

官方文档:superset.apache.org/docs/intro