Skip to main content

Hadoop reported an error when starting yarn: Cannot set priority of resourcemanager process xxxxx

I just started working on Hadoop today. After starting namenode and hadoop, I started to start yarn. The result was an error: Cannot set priority of resourcemanager process 93826

1.png

it means: Unable to set the priority of the resourcemanager process (probably).

Then I started Google. Some people on stackOverflow said that ssh password-free login was not set up, and some said it was a firewall problem. They all passed. There was no problem with the ssh password-free login setting, and the firewall was not turned on at all. There are also many people who yarn-site.xml have problems with their configuration files. I stared at them for a long time and there was no problem.

So I checked the log, and the log prompt is:

Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @2c1a7075

I couldn't see anything, but I could vaguely see that it was an error reported by Java (nonsense), and then I started Baidu. Many of these problems were errors that occurred when switching Java versions. Java8 should not have this problem, so I gave up decisively. .

I searched on Baidu for a long time and saw someone saying that due to the special nature of Mac, it needs to be configured $HADOOP_HOME/libexec/hadoop-config.sh and added to the Java home directory. I opened it and saw that there was a home directory in the file, but when I compared it with the previous configuration JAVA_HOME, I found that it was different. Then I JAVA_HOME changed it.

When I started yarn again, I still got an error. I suddenly remembered that I had just opened it and looked start-yarn.sh at it. It seemed to contain hadoop-config.sh the same content, JAVA_HOME and it seemed wrong. So I opened it and looked at it, and it turned out to be wrong, so I started to modify start-yarn.shthe JAVA_HOME value.

After making the changes, I saved it and found that it was a read-only file. I changed the file permissions, modified JAVA_HOME, saved it, and then restarted yarn. Finally I got it!

Modify permissions command: chmod 777 file name.
For detailed instructions on the command, please refer to Google.

So the final solution is actually to open the startup sh file , make JAVA_HOME corrections, and then run sh again.

2.png