1. 停止脚本

  1. #!/bin/bash
  2. ps -ef | grep -Ei '(airflow webserver)' | awk '{print $2}' | xargs -i kill {}
  3. ps -ef | grep -Ei '(airflow-webserver)' | awk '{print $2}' | xargs -i kill {}
  4. ps -ef | grep -Ei '(airflow scheduler)' | awk '{print $2}' | xargs -i kill {}
  5. ps -ef | grep -Ei '(airflow-scheduler)' | awk '{print $2}' | xargs -i kill {}
  6. ps -ef | grep -Ei '(airflow serves-logs)' | awk '{print $2}' | xargs -i kill {}

2. 启动脚本

  1. #!/bin/bash
  2. nohup airflow webserver >> airflow.log &
  3. nohup airflow scheduler >> airflow.log &
  4. # Celery 方式需要启动
  5. nohup airflow celery flower >> airflow.log &
  6. nohup airflow celery worker >> airflow.log &