Superset安装指南

Superset安装教程

可以先安装docker–>安装docker compose–>安装superset

文章目录

  • Superset安装教程
    • 可以先安装docker-->安装docker compose-->安装superset
    • 在 Ubuntu 20.04 上安装 Docker
    • 以非 Root 用户身份执行 Docker
    • 验证Docker安装过程
    • 在 Ubuntu 中安装 Docker Compose
        • 使用 Pip 安装 Docker Compose
    • 安装Superset
      • 前期准备
      • Apache Superset安装:
      • Apache Superset启动:

在 Ubuntu 20.04 上安装 Docker

  • 首先,更新软件包索引,并且安装必要的依赖软件,来添加一个新的 HTTPS 软件源:

    sudo apt update
    sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
    
  • 使用下面的 curl 导入源仓库的 GPG key:

    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    
  • 将 Docker APT 软件源添加到你的系统:

    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    
  • 现在,Docker 软件源被启用了,你可以安装软件源中任何可用的 Docker 版本。

    安装 Docker 最新版本,运行下面的命令。

    sudo apt update
    sudo apt install docker-ce docker-ce-cli containerd.io
    
  • 一旦安装完成,Docker 服务将会自动启动。你可以输入下面的命令,验证它:

    sudo systemctl status docker
    
    • 若安装成功则显示以下内容:

      ● docker.service - Docker Application Container Engine
      
           Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset>
      
           Active: active (running) since Tue 2023-04-11 19:13:47 CST; 30s ago
      

以非 Root 用户身份执行 Docker

默认情况下,只有 root 或者 有 sudo 权限的用户可以执行 Docker 命令。

想要以非 root 用户执行 Docker 命令,你需要将你的用户添加到 Docker 用户组,该用户组在 Docker CE 软件包安装过程中被创建。想要这么做,输入:

sudo usermod -aG docker $USER

$USER是一个环境变量,代表当前用户名。

登出,并且重新登录,以便用户组会员信息刷新。

验证Docker安装过程

想要验证 Docker 是否已经成功被安装,你可以执行docker命令,前面不需要加`sudo, 我们将会运行一个测试容器:

docker container run hello-world

如果本地没有该镜像,这个命令将会下载测试镜像,在容器中运行它,打印出 “Hello from Docker”,并且退出。

输出看起来应该像这样:

Unable to find image 'hello-world:latest' locally

latest: Pulling from library/hello-world

2db29710123e: Pull complete 

Digest: sha256:ffb13da98453e0f04d33a6eee5bb8e46ee50d08ebe17735fc0779d0349e889e9

Status: Downloaded newer image for hello-world:latest



Hello from Docker!

This message shows that your installation appears to be working correctly.



To generate this message, Docker took the following steps:

 1. The Docker client contacted the Docker daemon.

 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.

    (amd64)

 3. The Docker daemon created a new container from that image which runs the

    executable that produces the output you are currently reading.

 4. The Docker daemon streamed that output to the Docker client, which sent it

    to your terminal.



To try something more ambitious, you can run an Ubuntu container with:

 $ docker run -it ubuntu bash



Share images, automate workflows, and more with a free Docker ID:

 https://hub.docker.com/



For more examples and ideas, visit:

 https://docs.docker.com/get-started/

这个容器将会在打印消息后停止运行,因为它没有任何长期运行的进程。

默认情况下,Docker 从 Docker Hub 拉取镜像。它是一个云端服务,主要用来储存 公有和私有源中的 Docker 镜像。

在 Ubuntu 中安装 Docker Compose

使用 Pip 安装 Docker Compose

有很多方法,这里是使用 Pip 安装 Docker Compose

  • 安装pip

    sudo apt install python3-pip
    
  • 安装 Pip 后,运行以下命令安装 Docker Compose。

    pip install docker-compose
    

    安装好会出现以下内容:

    Successfully installed attrs-22.2.0 charset-normalizer-3.1.0 docker-6.0.1 docker-compose-1.29.2 dockerpty-0.4.1 docopt-0.6.2 jsonschema-3.2.0 packaging-23.0 pyrsistent-0.19.3 python-dotenv-0.21.1 requests-2.28.2 texttable-1.6.7 websocket-client-0.59.0
    
  • 安装 Docker Compose 后,使用下列命令检查版本:

    snap info docker
    

    会出现以下内容:

    name:      docker
    
    summary:   Docker container runtime
    
    publisher: Canonical✓
    
    store-url: https://snapcraft.io/docker
    
    contact:   https://github.com/docker-snap/docker-snap/issues?q=
    
    license:   Apache-2.0 AND GPL-2.0 AND MIT
    

安装Superset

前期准备

依赖安装:

sudo apt-get install build-essential libssl-dev libffi-dev python3-dev python3-pip libsasl2-dev libldap2-dev

虚拟环境安装:

sudo apt-get install python3-venv
pip3 install virtualenv

会出现以下内容:

Successfully installed distlib-0.3.6 filelock-3.11.0 platformdirs-3.2.0 virtualenv-20.21.0

创建虚拟环境:

python3 -m venv venv

进入虚拟环境:

. venv/bin/activate

出现以下内容代表成功进入虚拟环境:

(venv) hadoop1@hadoop-VirtualBox:/usr/local/bin$

Apache Superset安装:

pip3 install pillow

完成显示:

Collecting pillow

  Using cached Pillow-9.5.0-cp310-cp310-manylinux_2_28_x86_64.whl (3.4 MB)

Installing collected packages: pillow

Successfully installed pillow-9.5.0
pip3 install apache-superset
pip3 uninstall PyJWT (默认会安装最新版本,但是Apache Spuerset依赖的版本要小于2.0)
pip3 install PyJWT==1.7.1

Apache Superset启动:

superset db upgrade
export FLASK_APP=superset
superset fab create-admin
superset init
superset runserver -h 0.0.0.0 -p 8001

uninstall PyJWT (默认会安装最新版本,但是Apache Spuerset依赖的版本要小于2.0)
pip3 install PyJWT==1.7.1

superset db upgrade
export FLASK_APP=superset
superset fab create-admin
superset init
superset runserver -h 0.0.0.0 -p 8001

你可能感兴趣的:(docker,linux,运维)