You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无法关闭Airflow Webserver求助:Mac+Conda环境下的问题排查

解决Apache Airflow Webserver无法关闭的问题

可能的原因及解决办法

1. 进程已僵死,PS列表缓存未更新

你通过ps aux | grep airflow看到的63441进程大概率已经退出,但系统进程列表缓存没同步更新。换用端口监听工具精准定位存活进程:

lsof -i :8081

找到占用8081端口的进程PID后,执行sudo kill -9 <PID>强制终止。

2. Gunicorn子进程残留未清理

Airflow Webserver依赖Gunicorn运行,可能主进程已终止,但子进程还在后台存活。直接针对Gunicorn进程操作:

  • 查找关联进程:
    ps aux | grep gunicorn
    
  • 批量终止所有Gunicorn进程:
    pkill -9 gunicorn
    

3. Conda环境上下文不一致

因为你在Conda虚拟环境中启动的Airflow,当前终端可能没激活对应环境导致权限异常。先激活环境再操作:

conda activate data-engineering
# 批量终止Airflow Webserver相关进程
pkill -9 -f "airflow-webserver"

4. 优先使用Airflow官方关闭命令

别忘试试Airflow自带的停止命令,这是最规范的方式:

airflow webserver --stop

如果因为之前删了pid文件导致命令失效,手动指定pid文件路径再执行:

airflow webserver --pid /Users/giteshwarmali/Desktop/orchestration/airflow-webserver.pid --stop

终极方案:重启系统

如果以上方法都没用,直接重启Mac,僵死进程会被系统强制清理,之后再重新管理Airflow服务即可。

内容的提问来源于stack exchange,提问作者Giteshwar Mali

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.18 15:31:08