通过jps查看没有启动ResourceManager, 按照下面的路径查看日志
usr/local/Cellar/hadoop/3.2.1/libexec/logs/xxxresourcemanagerxxx.log 通过vscode打开
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.<init>(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的方式,写--all
xxx这种方式我试了也不成功,所以直接还是安装jdk8就好了. (安装参考:mac实现不同版本jdk切换)
由于上面方式可以实现不同jdk切换, 但是还是会自动跳转到jdk11, 所以还是要修改hadoop-env.sh, 使用指定版本的jdkexport JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home
配置文件的位置如下
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。