环境准备
-
安装Python3
cd /opt wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
-
解压&编译&安装
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
-
配置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
# 因为yum要依赖Python2 所以我们需要将这两个文件的表头修改为#! /usr/bin/python2
vi /usr/bin/yum
vi /usr/libexec/urlgrabber-ext-down
验证Python3
python -V
-
安装依赖包
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
-
加载环境变量
source ~/.bashrc
-
取消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
-
激活superset环境
# 激活指定环境 conda activate superset # 取消激活命令如下 conda deactivate
安装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
-
安装superset
pip install superset
-
更新pip
pip install --upgrade pip
-
superset依赖包安装
# 自己上传 pip install -r superset_packages
-
初始化superset元库
superset db upgrade
-
创建管理员用户
export FLASK_APP=superset flask fab create-admin
-
superset 初始化
superset init
-
安装kylinpy
pip install kylinpy
启动superset
-
启动命令
nohup superset run -p 7676 -h worker-2 --with-threads > /dev/null 2>&1 &
-
页面访问
http://worker-2:7676
配置kylin数据库
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选项为必选项
海汼部落原创文章,原文链接:http://www.hainiubl.com/topics/75724