试用了5款BI分析工具,终于找到了上手最快的那一个!
superset安装及简单使用
四款热门数据可视化BI产品调研
# 安装Miniconda
[atguigu@hadoop102 lib]$ bash Miniconda3-latest-Linux-x86_64.sh
# 进入 conda base 环境
conda activate base
# 退出 conda base 环境
conda deactivate
# 编辑 conda 环境变量
vim ~/.bashrc
# 禁止激活默认base环境
conda config --set auto_activate_base false
conda 镜像杂谈
创建环境:conda create -n env_name
查看所有环境:conda info --envs
删除一个环境:conda remove -n env_name --all
# 配置conda国内镜像
[atguigu@hadoop102 software]$ conda activate base
(base) [atguigu@hadoop102 software]$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
(base) [atguigu@hadoop102 software]$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
(base) [atguigu@hadoop102 software]$ conda config --set show_channel_urls yes
尚硅谷大数据数仓项目superset db upgrade三个报错解答
安装superset
# 创建Python3.8环境
(base) [atguigu@hadoop102 software]$ conda create --name superset python=3.8
# 激活superset环境
(base) [atguigu@hadoop102 software]$ conda activate superset
# 安装依赖、更新依赖
(superset) [atguigu@hadoop102 software]$ sudo yum install -y gcc gcc-c++ libffi-devel python-devel python-pip python-wheel python-setuptools openssl-devel cyrus-sasl-devel openldap-devel
(superset) [atguigu@hadoop102 software]$ pip install --upgrade setuptools pip -i https://pypi.douban.com/simple/
# 安装Supetset
(superset) [atguigu@hadoop102 software]$ pip install apache-superset -i https://pypi.douban.com/simple/
# 初始化Supetset数据库
(superset) [atguigu@hadoop102 software]$ superset db upgrade
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/opt/module/miniconda3/envs/superset/lib/python3.8/site-packages/markupsafe/__init__.py)
# soft_unicode在高版本被移除,使用如下版本可以
(superset) [atguigu@hadoop102 software]$ python -m pip install markupsafe==2.0.1
# 创建管理员用户
(superset) [atguigu@hadoop102 software]$ export FLASK_APP=superset
(superset) [atguigu@hadoop102 software]$ superset fab create-admin
2022-05-16 21:34:22,686:INFO:superset.utils.screenshots:No PIL installation found
# 解决报错
(superset) [atguigu@hadoop102 software]$ pip install pillow
# Superset初始化
(superset) [atguigu@hadoop102 ~]$ superset init
启动superset
# 安装gunicorn(类似TomCat)
(superset) [atguigu@hadoop102 software]$ pip install gunicorn -i https://pypi.douban.com/simple/
# 开启5个进程,并设置进程超时自动重启阈值,绑定Superset访问地址,后台运行
(superset) [atguigu@hadoop102 software]$ gunicorn --workers 5 --timeout 120 --bind hadoop102:8787 "superset.app:create_app()" --daemon
# 停掉gunicorn进程
(superset) [atguigu@hadoop102 software]$ ps -ef | awk '/superset/ && !/awk/{print }' | xargs kill -9
使用jieky登录Superset:http://hadoop102:8787
[atguigu@hadoop102 bin]$ cat superset.sh
#!/bin/bash
superset_status(){
result=`ps -ef | awk '/gunicorn/ && !/awk/{print }' | wc -l`
if [[ $result -eq 0 ]]; then
return 0
else
return 1
fi
}
superset_start(){
source ~/.bashrc
superset_status >/dev/null 2>&1
if [[ $? -eq 0 ]]; then
conda activate superset ; gunicorn --workers 5 --timeout 120 --bind hadoop102:8787 --daemon 'superset.app:create_app()'
else
echo "superset正在运行"
fi
}
superset_stop(){
superset_status >/dev/null 2>&1
if [[ $? -eq 0 ]]; then
echo "superset未在运行"
else
ps -ef | awk '/gunicorn/ && !/awk/{print }' | xargs kill -9
fi
}
case in
start )
echo "启动Superset"
superset_start
;;
stop )
echo "停止Superset"
superset_stop
;;
restart )
echo "重启Superset"
superset_stop
superset_start
;;
status )
superset_status >/dev/null 2>&1
if [[ $? -eq 0 ]]; then
echo "superset未在运行"
else
echo "superset正在运行"
fi
esac
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)