Hadoop3 yarn无法启动 (resourceManager/nodeManager)

jps上找不到 resourceManager 和 nodeManger的进程, 查询日志发现以下错误信息

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
	at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025)
	at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
	at com.sun.jersey.guice.spi.container.GuiceComponentProviderFactory$GuiceInstantiatedComponentProvider.getInstance(GuiceComponentProviderFactory.java:345)

我的Java版本是 jdk12, 貌似自从jdk9以后?java9默认禁用访问许多javax.?*?API。更换jdk8即可。
还有一种解决方案?https://issues.apache.org/jira/browse/HADOOP-14978,
修改$HADOOP_HOME/etc/hadoop/yarn-env.sh

export YARN_RESOURCEMANAGER_OPTS="–add-modules=ALL-SYSTEM"
export YARN_NODEMANAGER_OPTS="–add-modules=ALL-SYSTEM"

你可能感兴趣的:(问题记录)