hadoop配置-配置伪分布无法启动ResourceManager

通过jps查看没有启动ResourceManager, 按照下面的路径查看日志

usr/local/Cellar/hadoop/3.2.1/libexec/logs/xxxresourcemanagerxxx.log 通过vscode打开
hadoop配置-配置伪分布无法启动ResourceManager_第1张图片

FATAL org.apache.hadoop.yarn.server.resourcemanager.ResourceManager: Error starting ResourceManager

org.apache.hadoop.yarn.webapp.WebAppException: Error starting http server

at org.apache.hadoop.yarn.webapp.WebApps$Builder.start(WebApps.java:443)

at org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.startWepApp(ResourceManager.java:1231)

at org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.serviceStart(ResourceManager.java:1340)

at org.apache.hadoop.service.AbstractService.start(AbstractService.java:194)

at org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.main(ResourceManager.java:1535)

Caused by: java.io.IOException: Unable to initialize WebAppContext

at org.apache.hadoop.http.HttpServer2.start(HttpServer2.java:1177)

at org.apache.hadoop.yarn.webapp.WebApps$Builder.start(WebApps.java:439)

... 4 more

Caused by: com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error injecting constructor, java.lang.NoClassDefFoundError: javax/activation/DataSource
at org.apache.hadoop.yarn.server.resourcemanager.webapp.JAXBContextResolver.(JAXBContextResolver.java:41)

at org.apache.hadoop.yarn.server.resourcemanager.webapp.RMWebApp.setup(RMWebApp.java:54)

while locating org.apache.hadoop.yarn.server.resourcemanager.webapp.JAXBContextResolver
1 error

网上查一下, 是jdk版本导致, 我是用的jdk11, 说是jdk9之后就要怎么怎么处理.
网上给的通过修改hadoop-env.sh的方式,写--allxxx这种方式我试了也不成功,所以直接还是安装jdk8就好了. (安装参考:mac实现不同版本jdk切换)

由于上面方式可以实现不同jdk切换, 但是还是会自动跳转到jdk11, 所以还是要修改hadoop-env.sh, 使用指定版本的jdk
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home
image.png

配置文件的位置如下
hadoop配置-配置伪分布无法启动ResourceManager_第2张图片

你可能感兴趣的:(hadoop)