FileNotFoundException: .../logs/userlogs/application_/container_(Is a directory)

hackeruncle發表於2016-07-20

1.場景: 跑hive job時,夯住

2.錯誤: 檢視RM Web
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/hadoop/hadoop-2.7.2/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoop-2.7.2/tmp/nm-local-dir/usercache/root/appcache/application_1468583637020_0006/filecache/10/job.jar/job.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: /hadoop/hadoop-2.7.2/logs/userlogs/application_1468583637020_0006/container_e58_1468583637020_0006_01_000001 (Is a directory)
 at java.io.FileOutputStream.open(Native Method)
 at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
 at java.io.FileOutputStream.<init>(FileOutputStream.java:142)
 at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
 at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
 at org.apache.hadoop.yarn.ContainerLogAppender.activateOptions(ContainerLogAppender.java:55)
 at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
 at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)
 at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
 at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:842)
 at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768)
 at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:648)
 at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:514)
 at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:580)
 at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526)
 at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
 at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:64)
 at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:285)
 at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156)
 at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
 at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:657)
 at org.apache.hadoop.service.AbstractService.<clinit>(AbstractService.java:43)
Jul 19, 2016 7:32:00 PM com.sun.jersey.guice.spi.container.GuiceComponentProviderFactory register
INFO: Registering org.apache.hadoop.mapreduce.v2.app.webapp.JAXBContextResolver as a provider class
Jul 19, 2016 7:32:00 PM com.sun.jersey.guice.spi.container.GuiceComponentProviderFactory register
INFO: Registering org.apache.hadoop.yarn.webapp.GenericExceptionHandler as a provider class
Jul 19, 2016 7:32:00 PM com.sun.jersey.guice.spi.container.GuiceComponentProviderFactory register
INFO: Registering org.apache.hadoop.mapreduce.v2.app.webapp.AMWebServices as a root resource class
Jul 19, 2016 7:32:00 PM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.9 09/02/2011 11:17 AM'
Jul 19, 2016 7:32:00 PM com.sun.jersey.guice.spi.container.GuiceComponentProviderFactory getComponentProvider
INFO: Binding org.apache.hadoop.mapreduce.v2.app.webapp.JAXBContextResolver to GuiceManagedComponentProvider with the scope "Singleton"
Jul 19, 2016 7:32:01 PM com.sun.jersey.guice.spi.container.GuiceComponentProviderFactory getComponentProvider
INFO: Binding org.apache.hadoop.yarn.webapp.GenericExceptionHandler to GuiceManagedComponentProvider with the scope "Singleton"
Jul 19, 2016 7:32:01 PM com.sun.jersey.guice.spi.container.GuiceComponentProviderFactory getComponentProvider
INFO: Binding org.apache.hadoop.mapreduce.v2.app.webapp.AMWebServices to GuiceManagedComponentProvider with the scope "PerRequest"


3.分析:
1>.wordcount測試MR
2>.調優yarn引數


4.解決方法:

點選(此處)摺疊或開啟

  1. <property>
  2.     <name>yarn.nodemanager.resource.memory-mb</name>
  3.     <value>8192</value>
  4.      <discription>當前節點nodemanager程式分配記憶體大小</discription>
  5. </property>
  6. <property>
  7.     <name>yarn.scheduler.minimum-allocation-mb</name>
  8.     <value>1024</value>
  9.     <discription>單個任務可申請最少記憶體,預設1024MB</discription>
  10.  </property>
  11.   
  12. <property>
  13.     <name>yarn.scheduler.maximum-allocation-mb</name>
  14.     <value>8192</value>
  15.     <discription>單個任務可申請最大記憶體,預設8192MB</discription>
  16. </property>
  17. <property>
  18.     <name>yarn.nodemanager.resource.cpu-vcores</name>
  19.     <value>4</value>
  20. </property>


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30089851/viewspace-2122283/,如需轉載,請註明出處,否則將追究法律責任。

相關文章