superset 报表

教程 犀牛 ⋅ 于 2021-06-17 22:52:27 ⋅ 2066 阅读

环境准备

  • 安装Python3

    cd /opt
    wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz

file

  • 解压&编译&安装

    tar -zxvf Python-3.6.0.tgz
    cd Python-3.6.0
    ./configure --prefix=/usr/local/python
    make && make install
  • 配置环境变量

    export PYTHON_HOME=/usr/local/python
    export PATH=$PATH:$PYTHON_HOME/bin

    使能:source /etc/profile

file

  • 配置Python2与Python3共存

    mv /usr/bin/python /usr/bin/python2
    ln -s /usr/local/python/bin/python3.6 /usr/bin/python
    ln -s /usr/local/python/bin/pip3 /usr/bin/pip

file

  # 因为yum要依赖Python2 所以我们需要将这两个文件的表头修改为#! /usr/bin/python2
  vi /usr/bin/yum
  vi /usr/libexec/urlgrabber-ext-down

验证Python3

  python -V

file

  • 安装依赖包

    yum upgrade python-setuptools
    yum install -y gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel cyrus-sasl-devel openldap-devel
    pip install --upgrade pip
    pip install cryptography

miniconda安装

  • 下载安装

    cd /opt
    wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
    sh Miniconda3-latest-Linux-x86_64.sh

file

file

  • 加载环境变量

    source ~/.bashrc

file

  • 取消base自动激活

    conda config --set auto_activate_base false
  • 配置国内镜像

    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    conda config --set show_channel_urls yes
  • 创建Python3.6的superset环境

    conda create --name superset python=3.6

file

  • 激活superset环境

    # 激活指定环境
    conda activate superset
    # 取消激活命令如下
    conda deactivate

file

安装superset

  • 环境依赖

    yum install -y python-setuptools
    yum install -y gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel cyrus-sasl-devel openldap-devel
    pip install --upgrade setuptools pip -i https://pypi.douban.com/simple/
    pip install cryptography

file

  • 安装superset

    pip install superset

file

  • 更新pip

    pip install --upgrade pip
  • superset依赖包安装

    # 自己上传
    pip install -r superset_packages
  • 初始化superset元库

    superset db upgrade

file

  • 创建管理员用户

    export FLASK_APP=superset
    flask fab create-admin

file

  • superset 初始化

    superset init

file

  • 安装kylinpy

    pip install kylinpy

file

启动superset

  • 启动命令

    nohup superset run -p 7676 -h worker-2 --with-threads > /dev/null 2>&1 &
  • 页面访问

    http://worker-2:7676

file

配置kylin数据库

file

file

Database:kylin

SQLAlchemy URI:kylin://ADMIN:KYLIN@worker-3:7070/learn_kylin?version=v1

或者

SQLAlchemy URI:kylin://ADMIN:KYLIN@worker-3:7070/default?project=learn_kylin

下面的选项可以全部选择,schema选项为必选项

file

版权声明:原创作品,允许转载,转载时务必以超链接的形式表明出处和作者信息。否则将追究法律责任。来自海汼部落-犀牛,http://hainiubl.com/topics/75724
本帖由 青牛 于 1年前 解除加精
成为第一个点赞的人吧 :bowtie:
回复数量: 0
    暂无评论~~
    • 请注意单词拼写,以及中英文排版,参考此页
    • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`, 更多语法请见这里 Markdown 语法
    • 支持表情,可用Emoji的自动补全, 在输入的时候只需要 ":" 就可以自动提示了 :metal: :point_right: 表情列表 :star: :sparkles:
    • 上传图片, 支持拖拽和剪切板黏贴上传, 格式限制 - jpg, png, gif,教程
    • 发布框支持本地存储功能,会在内容变更时保存,「提交」按钮点击时清空
    Ctrl+Enter