美文网首页
centos安装superset笔记

centos安装superset笔记

作者: 小T数据站 | 来源:发表于2021-11-05 14:43 被阅读0次
  • 上传minicond到服务器

  • 安装miniconda

    <pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="" cid="n6" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit;">bash 安装包名</pre>

  • conda环境管理常用命令(虚拟环境)

    • 创建环境: conda create -n superset python=3.7

    • 查看所有环境:conda info --envs

    • 删除一个环境:conda remove -n env_name --all 或者 conda env remove --name your_env_name

    • 激活superset环境:conda activate superset

    • //设置conda镜像源a 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 //环境准备 sudo yum install -y gcc gcc-c++ libffi-devel python-devel python-pip python-wheel python-setuptools openssl-devel syrus-sasl-devel openldap-devel

      pip install --upgrade setuptools pip -i https://pypi.douban.com/simple/

    • 安装superset

      pip install apache-superset -i https://pypi.douban.com/simple/

      初始化数据库

      superset db upgrade

      创建管理员用户

      export FLASK_APP=superset superset fab create-admin superset init

      安装gunicorn

      pip install gunicorn -i https://pypi.douban.com/simple/

      启动

      gunicorn --workers 5 --timeout 500 --bind 127.0.0.1:8088 "superset.app:create_app()" --daemon 说明:

      --workers:指定进程个数

      --timeout:worker进程超时时间,超时会自动重启

      --bind的参数,如果是本地,改成0.0.0.0:你的端口号

      --daemon:后台运行

    • 关闭superset

      ps -ef | awk '/superset/ && !/awk/{print $2}' | xargs kill -9

    • 启停脚本:vim superset.sh

        superset_status(){
         result=`ps -ef | awk '/gunicorn/ && !/awk/{print $2}' | 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 500 --bind 127.0.0.1:8088 --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 $2}' | xargs kill -9
         fi
        }
        
        case $1 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

conda config --set auto_activate_base false

sudo yum install -y gcc gcc-c++ libffi-devel openssl-devel openldap-devel

127.0.0.1:8088

gunicorn --workers 5 --timeout 500 --bind 127.0.0.1:8088 "superset.app:create_app()" --daemon

ps -ef | awk '/superset/ && !/awk/{print $2}' | xargs kill -9

alter table advertising_type change type_name type_name varchar(20) character set utf8 not null

yum search python | grep -i devel

相关文章

网友评论

      本文标题:centos安装superset笔记

      本文链接:https://www.haomeiwen.com/subject/vpdrzltx.html