In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Regular management and monitoring, need to do shell programming, kill or restart the process directly. We need to quickly locate the pid number of each process.
Pid is stored in the / tmp directory by default
Pid content is the process number.
Ps-ef | PID AMagi Bjorc may be killed by mistake when it appears in grep hadoop.
[hadoop@hadoop000 sbin] $cat hadoop-daemon.sh | grep pid
# HADOOPPIDDIR The pid files are stored. / tmp by default.
Pid=$HADOOP_PID_DIR/hadoop-$HADOOP_IDENT_STRING-$command.pid
If [- f $pid]; then
If kill-0 cat $pid > / dev/null 2 > & 1; then
Echo $command running as process cat $pid. Stop it first.
Echo $! > $pid
If [- f $pid]; then
TARGET_PID=cat $pid
Rm-f $pid
In the official sh script, it also reads the contents of the pid file as the process kill object
The number we directly compare to the pid file is our process pid.
[hadoop@hadoop01 tmp] $ls * .pid
Hadoop-hadoop-datanode.pid yarn-hadoop-nodemanager.pid
Hadoop-hadoop-namenode.pid yarn-hadoop-resourcemanager.pid
Hadoop-hadoop-secondarynamenode.pid yarn-hdfs-resourcemanager.pid
[hadoop@hadoop01 tmp] $
[hadoop@hadoop01 tmp] $cat hadoop-hadoop-datanode.pid
8990
[hadoop@hadoop01 tmp] $jps
12060 Jps
9193 SecondaryNameNode
9566 NodeManager
8990 DataNode
9450 ResourceManager
Kill-0 cat / tmp/hadoop-hadoop-datanode.pid-shell commonly used kill pid mode`
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.