本文用的Windows wsl ubuntu18系统
1、更新ubuntu
sudo apt update
2、安装好python3,pip3
sudo apt install python3-pip
pip3 install --upgrade pip
3、安装airflow
export AIRFLOW_HOME=~/airflow
pip3 install apache-airflow
上面安装时候有提醒没有添加到环境变量,安装提醒操作
echo 'export PATH=/home/loong/.local/bin:$PATH' >>~/.bashrc
source ~/.bashrc
4、初始化airflow
airflow db init
报错:sqlalchemy.exc.DatabaseError: (sqlite3.DatabaseError) database disk image is malformed
**可以去~/airflow 下删除airflow.db 后再airflow db init
在~/airflow 下airflow.cfg 设置web用户和密码
参考:https://www.cnblogs.com/braveym/p/12671874.html
a、找到对应位置添加如下:
[webserver]
security = Flask AppBuilder
secure_mode = True
rbac=True
b、重置
airflow db reset
c、设置账号与密码
airflow users create --lastname user --firstname admin --username admin --email admin_user@mail.com --role Admin --password admin
5、启动airflow
airflow scheduler
airflow webserver
登录web查看(输入前面的账号密码): http://localhost:8080/home
|