zoukankan      html  css  js  c++  java
  • airflow脚本

    airflow-1脚本:
    */2 * * * * /bin/sh /hongfeng/script/rsynce_airflow_log.sh >/dev/null 2>&1
    */4 * * * * /bin/sh /hongfeng/script/monitor_scheduler.sh >/dev/null 2>&1

    1/ log的rsync_airflow_log.sh
    rsync -azuq -e ssh root@10.52.51.8:/root/airflow/logs/ /root/airflow/logs/ --exclude 'scheduler' --exclude 'scheduler_failover' --exclude 'dag_processor_manager'
    rsync -azuq -e ssh root@10.52.17.70:/root/airflow/logs/ /root/airflow/logs/ --exclude 'scheduler' --exclude 'scheduler_failover' --exclude 'dag_processor_manager'
    rsync -azuq -e ssh root@10.52.139.191:/root/airflow/logs/ /root/airflow/logs/ --exclude 'scheduler' --exclude 'scheduler_failover' --exclude 'dag_processor_manager'

    2/ monitor_scheduler.sh
    #! /bin/sh

    date=$(date +%Y-%m-%d-%H:%M)

    file_path=/root/airflow/scheduler.log
    check_time=150
    file_old_stat="`stat ${file_path}|grep Size`"
    sleep ${check_time}
    file_new_stat="`stat ${file_path}|grep Size`"
    if [[ `echo ${file_old_stat}` == `echo ${file_new_stat}` ]]; then
    . /data/venv/bin/activate && supervisorctl restart airflow_scheduler && deactivate
    echo "#${date},scheduler service restarted" >>/tmp/test/scheduler_hung.log
    fi

    3/ status_check.sh
    ansible airflow -m shell -a '. /data/venv/bin/activate && supervisorctl status'

    4/ deploy_git_airflow.sh
    ansible airflow -m shell -a 'cd /root/airflow/dags && git pull'
    5/ 企业微信报警(G:文档开发python)
    */2 * * * * (. /data/venv/bin/activate && python /root/airflow/airflow_health_monitor.py && deactivate) >> /root/airflow/airflow_health.log 2>&1 &

  • 相关阅读:
    Android游戏音效实现
    对Android体系结构的理解--后续会补充
    实现软件版本新特性的具体步奏
    搜索栏的自定义
    有关导航栏的相关认识
    自定义tabBar中的注意事项
    多控制器的管理
    ios中创建控制器的几种方式
    利用高德地图官方提供的API实现模拟定位的功能
    IOS中利用NSKeyedArchiver进行数据的归档和恢复
  • 原文地址:https://www.cnblogs.com/hongfeng2019/p/12191966.html
Copyright © 2011-2022 走看看