接上文:一文说清flink从编码到部署上线
1.查看正在执行的flink
访问地址(参考):http://10.86.97.191:8099/cluster/apps
2.终止任务
yarn application -kill appID
本文为:
yarn application -kill application_1733494458758_0001
出现下面日志,说明终止成功:
查看yarn控制台,状态为“KILLED”。
常用命令:
echo "=============查询所有任务============="
yarn application -list
echo "=============停止待提交的任务============="
yarn application -list | grep "ACCEPTED" | awk '{print $1}' | grep -v 'ApplicationId' | xargs -I {} sh -c 'if [ "{}" != "Total" ]; then yarn application -kill {}; fi'
echo "=============停止正在运行的任务============="
yarn application -list | grep "RUNNING" | awk '{print $1}' | grep -v 'ApplicationId' | xargs -I {} sh -c 'if [ "{}" != "Total" ]; then yarn application -kill {}; fi'