分析
進入logs檔案夾,檢視日志
cat hadoop-chuan-resourcemanager-hadoop103.log
發現錯誤:
Caused by: java.lang.reflect.InaccessibleObjectException: 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 @1cf89471
截圖如下:
解決
[root@hadoop103 hadoop-3.2.4]# cd etc/hadoop/
vim yarn-env.sh
添加:
export YARN_RESOURCEMANAGER_OPTS="--add-opens java.base/java.lang=ALL-UNNAMED"
export YARN_NODEMANAGER_OPTS="--add-opens java.base/java.lang=ALL-UNNAMED"
如下: