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

  

  

  

  

  

  

猜你喜欢

转载自www.cnblogs.com/QuestionsZhang/p/11110665.html