标签:Hadoop
1.认识pid:PID全称是Process Identification。
PID是进程的代号,每个进程有唯一的PID编号。它是进程运行时系统随机分配的,并不代表专门的进程。在运行时PID是不会改变标识符的,但是你终止程序后再运行PID标识符就会被系统回收,就可能会被继续分配给新运行的程序。
[hadoop@hadoop000 ~]$ mkdir -p /opt/software/hadoop-2.8.1/pids
[hadoop@hadoop000 ~]$ jps
10512 ResourceManager
8018 Jps
10004 SecondaryNameNode
9655 NameNode
9806 DataNode
10623 NodeManager
[hadoop@hadoop000 ~]$ cd /opt/software/hadoop-2.8.1/sbin/
[hadoop@hadoop000 sbin]$ ./stop-dfs.sh
[hadoop@hadoop000 sbin]$ ./stop-yarn.sh
[hadoop@hadoop000 sbin]$ vi hadoop-daemon.sh
HADOOP_PID_DIR=/opt/software/hadoop-2.8.1/pids
[hadoop@hadoop000 sbin]$ vi yarn-daemon.sh
YARN_PID_DIR=/opt/software/hadoop-2.8.1/pids
[hadoop@hadoop000 sbin]$ ./start-dfs.sh
[hadoop@hadoop000 sbin]$ ./start-yarn.sh
[hadoop@hadoop000 sbin]$ jps
9201 SecondaryNameNode
9425 ResourceManager
9540 NodeManager
9828 Jps
8852 NameNode
8973 DataNode
#发现pid存储在新的位置
[hadoop@hadoop000 sbin]$ cd /opt/software/hadoop-2.8.1/pids/
[hadoop@hadoop000 pids]$ ll
total 20
-rw-rw-r-- 1 hadoop hadoop 5 May 22 20:14 hadoop-hadoop-datanode.pid
-rw-rw-r-- 1 hadoop hadoop 5 May 22 20:14 hadoop-hadoop-namenode.pid
-rw-rw-r-- 1 hadoop hadoop 5 May 22 20:14 hadoop-hadoop-secondarynamenode.pid
-rw-rw-r-- 1 hadoop hadoop 5 May 22 20:15 yarn-hadoop-nodemanager.pid
-rw-rw-r-- 1 hadoop hadoop 5 May 22 20:15 yarn-hadoop-resourcemanager.pid
Linux系统下pid与pid文件及Hadoop更改pid文件存储位置
标签:Hadoop
原文地址:http://blog.51cto.com/10814168/2119228