離線安裝airflow


 

下載airflow及其依賴

pip download -d /root/tmp  apache-airflow

pip install --no-index --find-links=/root/tmp     apache_airflow-2.1.0-py3-none-any.whl

 

 

下載python mysql連接組件

pip download -d /root/connector/  mysql-connector-python

pip install --no-index --find-links=/root/connector    mysql_connector_python-8.0.25-cp36-cp36m-manylinux1_x86_64.whl

 

#創建數據庫

create user 'airflow'@'localhost' identified by 'Pas5W@rd';

grant all privileges on airflow.* to 'airflow'@'localhost';

flush privileges;

set explicit_defaults_for_timestamp = 1;

 

 

#cd 到要安裝的目錄如/app/airflow設置airflow_home變量,然后初始化數據庫.

#這樣airflow的目錄不會跑到/root/airflow下面

export  AIRFLOW_HOME="$(pwd)"

airflow db init

 

 

 

vim airflow.cfg 將數據庫由sqlite 改為mysql

 

 

#啟動

airflow webserver &

airflow scheduler &

 

 

#創建用戶

airflow users create \
--email admin@abc.com \
--firstname sam \
--lastname wang \
--username admin
--password Pas5W@rd \
--role Admin

 

 

打開瀏覽器訪問

 

 

 

參考鏈接:

https://zhuanlan.zhihu.com/p/36043468

https://www.cnblogs.com/lyhtbc/p/airflow-spark-schedule.html

https://stackoverflow.com/questions/53024891/modulenotfounderror-no-module-named-mysqldb

https://stackoverflow.com/questions/59777432/how-change-the-home-folder-of-an-installation-using-enviromental-variables


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM