Problem Description
After using sbin/start-yarn.sh
start yarn, and then use jps
to view the process, it is found that only Notemanager is started, but resourcemanager is not started.
The code looks like this:
[hadoop@hadoop-01 hadoop]$ sbin/start-yarn.sh
starting yarn daemons
starting resourcemanager, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.10.0/logs/yarn-hadoop-resourcemanager-hadoop-01.out
hadoop-01: starting nodemanager, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.10.0/logs/yarn-hadoop-nodemanager-hadoop-01.out
hadoop-02: starting nodemanager, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.10.0/logs/yarn-hadoop-nodemanager-hadoop-02.out
hadoop-03: starting nodemanager, logging to /home/hadoop/app/hadoop-2.6.0-cdh5.10.0/logs/yarn-hadoop-nodemanager-hadoop-03.out
[hadoop@hadoop-01 hadoop]$ jps
15824 Jps
2241 QuorumPeerMain
13461 NameNode
14054 DFSZKFailoverController
13575 DataNode
13771 JournalNode
15691 NodeManager
Cause Analysis:
Check the log file first. The location of the log file for starting resourcemanager is shown in the red box in the figure below. Change the suffix .out to .log to get the log file.
#查看日志
cat /home/hadoop/app/hadoop-2.6.0-cdh5.10.0/logs/yarn-hadoop-resourcemanager-hadoop-01.log
The reason for the error found in the log is: yarn.resourcemanager.zk-address is not set, the problem should be that yarn.resourcemanager.zk-address is not found in the configuration file of yarn
solution:
Open the yarn configuration file yarn-site.xml, and find the configuration section as shown in the figure below:
Change hadoop.zk.address
to yarn.resourcemanager.zk-address
and then restart yarn, and find that the resourcemanager process already exists.