Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Big data-Rapid location of pid process numbers in hadoop

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report