superset部署在centos踩坑记录

设置用户

test   ALL=(ALL:ALL) NOPASSWD:ALL

设置test用户组的所有用户权限

%test   ALL=(ALL:ALL) NOPASSWD:ALL

设置test用户可以sudo执行的命令列表

test   ALL=(ALL:ALL) NOPASSWD:/sbin/shutdown,/usr/bin/reboot

改变miniconda权限

chgrp -R anaconda /root/miniconda3

chmod 770 -R /root/miniconda3

chmod g+s /root/miniconda3

chmod -R g+s /root/miniconda3

#(root)
chmod g-w /root/miniconda3/envs

source /root/miniconda3/bin/activate

conda create -n supersettest python=3.9


export PATH=/root/miniconda3/bin:$PATH


基于源码部署的基本流程,用到的命令

  • minconda搭载虚拟环境

    conda create --name superset2 python=3.6
    
  • 缺失的包正确版本

    pip install Flask-SQLAlchemy==2.5.1
    pip install SQLAlchemy-Utils==0.36.8
    
  • 开放端口和访问

    firewall-cmd --permanent --add-port=8787/tcp
    firewall-cmd --query-port=8787/tcp
    systemctl stop firewalld
    
    
    
    
    gunicorn --workers 5 --timeout 120 --bind datacluster02:8787  "superset.app:create_app()" --daemon
    
    
    superset run -h 192.168.49.12 -p 8787 --with-threads --reload --debugger
    
  • 本地与服务器进行映射,通过本地浏览器访问superset

    ssh -p 服务器端口 服务器用户名@服务器IP地址 -L 本地IP:本地端口:服务器IP地址:superset端口
    
    ssh -L superset端口:本地IP:本地端口 -p 服务器端口 服务器用户名@服务器IP地址
    
    访问地址:
    192.168.49.12:8787/login
    
  • 连接本地数据库

    修改superset的config文件
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:HJXhjx123456@192.168.13.66:3306/haqtest?charset=utf8'
    
    开放本地mysql远程连接权限
    
    重启superset并初始化
    superset db upgrade 
    
    
    
    

参考的文章

  • centos部署方法(不使用docker:

    https://blog.youkuaiyun.com/yang2717/article/details/122363927
    https://www.yuque.com/fengxiansimida/vlbqhi/so9q5op0ubt5wlxu?#

  • 防火墙

    https://blog.youkuaiyun.com/fx9590/article/details/121971120

  • 遇到的问题

    https://blog.51cto.com/u_15064655/4210360https://blog.51cto.com/u_15064655/4210360

    [https://blog.youkuaiyun.com/weixin_45682261/article/details/123228183
    https://blog.youkuaiyun.com/qq_45796486/article/details/128606168](https://blog.youkuaiyun.com/weixin_45682261/article/details/123228183
    https://blog.youkuaiyun.com/qq_45796486/article/details/128606168)

  • 连接本地数据库

    https://zhuanlan.zhihu.com/p/79087325?from_voters_page=true

    https://www.likecs.com/show-203348627.html

### 安装和配置 Apache Superset #### 准备环境 对于CentOS 7,确保Python版本兼容。当前安装的Superset为2.0.0版本,并且使用的Python版本是3.9.16[^3]。 为了准备环境,先更新系统并安装必要的依赖项: ```bash sudo yum update -y sudo yum groupinstall "Development Tools" -y ``` 接着安装一些额外的支持库: ```bash sudo yum install epel-release python-pip gcc postgresql-devel libffi-devel redhat-rpm-config openssl-devel -y ``` #### Python 环境设置 考虑到特定版本的需求,在此之前建议创建一个新的虚拟环境中运行Apache Superset: ```bash python3 -m venv my_superset_env source my_superset_env/bin/activate pip install --upgrade pip setuptools wheel ``` #### 安装 Apache Superset 通过指定清华镜像源加速安装过程: ```bash pip install apache-superset -i https://pypi.tuna.tsinghua.edu.cn/simple [^1] ``` 初始化数据库以及应用权限模型: ```bash superset db upgrade superset fab create-admin superset init ``` 上述命令会引导完成管理员账户建立和其他初始设定工作。 #### 启动服务 启动Web服务器与后台作业处理器: ```bash gunicorn -w 4 -k gevent --timeout 120 -b 0.0.0.0:8088 "superset.app:create_app()" nohup celery -A superset.celery_app:app worker --pool=prefork -O fair & ``` 这将使Superset可以在本地网络接口上的端口8088提供服务。 #### 配置文件调整 如果希望更改默认存储位置或其他参数,可以通过编辑`~/.superset/superset_config.py`来进行自定义配置[^5]。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值