• CentOS7.2安装Airflow


    1 安装pip

    yum -y install epel-release
    yum install python-pip

    2 更新pip

    pip install --upgrade pip
    pip install --upgrade setuptools

    3 安装各种开发库

    yum install python-devel
    yum install libevent-devel
    yum install mysql-devel
    

    4 安装Airflow

    在此之前需要设定临时环境变量

    export SLUGIFY_USES_TEXT_UNIDECODE=yes
    pip install apache-airflow

    遇到第一个问题

    ERROR: Cannot uninstall 'enum34'. It is a distutils installed project and 
    thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

    解决 

     pip install --ignore-installed enum34  

    然后再重新执行命令

    遇到第二个问题

    ERROR: Cannot uninstall 'requests'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

    解决

    pip install --ignore-installed apache-airflow
    

    5 初始化数据库 并 启动

    airflow initdb
    airflow webserver -p 8080
    

    8 防止密码明文存储

    pip install cryptography
    

    9 替换数据库为mysql

    pip install apache-airflow[mysql]
    

      

    10 创建mysql用户

    create database airflow;
    create user 'testairflow'@'%' identified by '123123';
    GRANT all privileges on airflow.* TO 'testairflow'@'%'  IDENTIFIED BY '123123';
    FLUSH PRIVILEGES;
    

      

    11 修改Airflow配置文件,指向mysql用户

      

    ~/airflow/airflow.cfg 文件修改:sql_alchemy_conn = mysql://ct:152108@localhost/airflow
    

      

    12 mysql配置更新

    vim /etc/my.cnf
    explicit_defaults_for_timestamp=1   // 添加此行
    systemctl restart mysqld
    airflow initdb
    

      

    13 重启Airflow

    airflow webserver -p 8080
    

      

      

      

      

      

      

  • 相关阅读:
    铬族元素
    Linux下安装虚拟环境
    Flask之路由系统
    Flask之CSRF
    【原创】关于Azure Storage Simulator 不能启动的问题
    今天终于搞清楚了正则表达式
    模型权重的保存与加载 回调函数的使用
    卷积神经网络结构
    滑动窗口与R-CNN
    模型权重记录与恢复
  • 原文地址:https://www.cnblogs.com/QuestionsZhang/p/11110665.html
Copyright © 2020-2023  润新知