flink获取taskmanager的pstree信息
使用pstree –p 进程号 的方式能够获取taskmanager的pstree信息,这个地方提供一个收集脚本。内容如下:
#!/bin/bash searchPID() { local pids=`ps -ef | grep taskmanager | grep -v grep | grep -v "bash -c" | grep -v taskmanagerSearch.sh | awk '{print $2}'`; time=$(date "+%Y-%m-%d %H:%M:%S") echo "checktime is --------------------- $time" >> /var/log/Bigdata/taskManagerTree.log for i in $pids do local treeNum=$(pstree -p $i | wc -l) echo "$i 's pstree num is $treeNum" >> /var/log/Bigdata/taskManagerTree.log done } searchPID |
功能为:获取节点上所有taskmanager pstree的数量,打印结果如下: