• spark2 报错:Lineage directory /var/log/spark2/lineage doesn‘t exist or is not writable. 解决方法


    异常原文:

    20/08/06 14:29:43 ERROR spark.SparkContext: Error initializing SparkContext.
    org.apache.spark.SparkException: Exception when registering SparkListener
    	at org.apache.spark.SparkContext.setupAndStartListenerBus(SparkContext.scala:2364)
    	at org.apache.spark.SparkContext.<init>(SparkContext.scala:553)
    	at org.apache.spark.api.java.JavaSparkContext.<init>(JavaSparkContext.scala:58)
    	at com.gm.csv.test.Demo6.main(Demo6.java:31)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.apache.spark.deploy.yarn.ApplicationMaster$$anon$2.run(ApplicationMaster.scala:688)
    Caused by: java.io.FileNotFoundException: Lineage directory /var/log/spark2/lineage doesn't exist or is not writable.
    	at com.cloudera.spark.lineage.LineageWriter$.checkLineageConfig(LineageWriter.scala:158)
    	at com.cloudera.spark.lineage.NavigatorAppListener.<init>(ClouderaNavigatorListener.scala:30)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    	at org.apache.spark.util.Utils$$anonfun$loadExtensions$1.apply(Utils.scala:2740)
    	at org.apache.spark.util.Utils$$anonfun$loadExtensions$1.apply(Utils.scala:2732)
    	at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
    	at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
    	at scala.collection.mutable.ArraySeq.foreach(ArraySeq.scala:74)
    	at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:241)
    	at scala.collection.AbstractTraversable.flatMap(Traversable.scala:104)
    	at org.apache.spark.util.Utils$.loadExtensions(Utils.scala:2732)
    	at org.apache.spark.SparkContext$$anonfun$setupAndStartListenerBus$1.apply(SparkContext.scala:2353)
    	at org.apache.spark.SparkContext$$anonfun$setupAndStartListenerBus$1.apply(SparkContext.scala:2352)
    	at scala.Option.foreach(Option.scala:257)
    	at org.apache.spark.SparkContext.setupAndStartListenerBus(SparkContext.scala:2352)
    	... 8 more
    20/08/06 14:29:43 INFO spark.SparkContext: SparkContext already stopped.
    org.apache.spark.SparkException: Exception when registering SparkListener
    	at org.apache.spark.SparkContext.setupAndStartListenerBus(SparkContext.scala:2364)
    	at org.apache.spark.SparkContext.<init>(SparkContext.scala:553)
    	at org.apache.spark.api.java.JavaSparkContext.<init>(JavaSparkContext.scala:58)
    	at com.gm.csv.test.Demo6.main(Demo6.java:31)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.apache.spark.deploy.yarn.ApplicationMaster$$anon$2.run(ApplicationMaster.scala:688)
    Caused by: java.io.FileNotFoundException: Lineage directory /var/log/spark2/lineage doesn't exist or is not writable.
    	at com.cloudera.spark.lineage.LineageWriter$.checkLineageConfig(LineageWriter.scala:158)
    	at com.cloudera.spark.lineage.NavigatorAppListener.<init>(ClouderaNavigatorListener.scala:30)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    	at org.apache.spark.util.Utils$$anonfun$loadExtensions$1.apply(Utils.scala:2740)
    	at org.apache.spark.util.Utils$$anonfun$loadExtensions$1.apply(Utils.scala:2732)
    	at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
    	at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
    	at scala.collection.mutable.ArraySeq.foreach(ArraySeq.scala:74)
    	at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:241)
    	at scala.collection.AbstractTraversable.flatMap(Traversable.scala:104)
    	at org.apache.spark.util.Utils$.loadExtensions(Utils.scala:2732)
    	at org.apache.spark.SparkContext$$anonfun$setupAndStartListenerBus$1.apply(SparkContext.scala:2353)
    	at org.apache.spark.SparkContext$$anonfun$setupAndStartListenerBus$1.apply(SparkContext.scala:2352)
    	at scala.Option.foreach(Option.scala:257)
    	at org.apache.spark.SparkContext.setupAndStartListenerBus(SparkContext.scala:2352)
    	... 8 more
    20/08/06 14:29:43 INFO yarn.ApplicationMaster: Final app status: FAILED, exitCode: 13
    
    ....
    

    解决方法:

    验证spark集群各节点中是否存在/var/log/spark2/lineage目录。
    若不存在则需在集群各节点创建目录并修改文件所有者

    mkdir -p /var/log/spark2/lineage
    chown yarn:yarn /var/log/spark2/lineage
    
  • 相关阅读:
    Memcached 内存分配机制介绍
    PHP与Memcached服务器交互的分布式实现源码分析
    yii 操作cookie
    Python urllib2递归抓取某个网站下图片
    mysql 知识 show status
    要读的书培根说:历史使人明智,诗词使人巧慧,算学使人精密,哲理使人深刻,伦理学人庄重,逻辑修辞使人善辩。
    思考的技术懒于求知的人没有生存空间
    相约星期二记录
    谁是最重要的人
    Netstat命令详解
  • 原文地址:https://www.cnblogs.com/gmhappy/p/13457011.html
Copyright © 2020-2023  润新知