在 Yarn 集群上运行的 Spark 作业 java.io.FileNotFoundException:文件不存在,即使文件在主节点上存在

2023-11-27

我对 Spark 相当陌生。我尝试搜索但找不到合适的解决方案。我已经在两个机器上安装了 hadoop 2.7.2(一个主节点和另一个工作节点)我已经通过以下链接设置了集群http://javadev.org/docs/hadoop/centos/6/installation/multi-node-installation-on-centos-6-non-sucure-mode/我以 root 用户身份运行 hadoop 和 Spark 应用程序来测试集群。

我已在主节点上安装了 Spark,并且 Spark 正在启动,没有任何错误。但是,当我使用 Spark Submit 提交作业时,即使该文件存在于错误中同一位置的主节点中,我也会收到 File Not Found 异常。我正在执行 Spark Submit 命令,请在下面找到日志输出命令。

/bin/spark-submit  --class com.test.Engine  --master yarn --deploy-mode      cluster /app/spark-test.jar


16/04/21 19:16:13 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
16/04/21 19:16:13 INFO RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
16/04/21 19:16:14 INFO Client: Requesting a new application from cluster with 1 NodeManagers
16/04/21 19:16:14 INFO Client: Verifying our application has not requested more than the maximum memory capability of the cluster (8192 MB per container)
16/04/21 19:16:14 INFO Client: Will allocate AM container, with 1408 MB memory including 384 MB overhead
16/04/21 19:16:14 INFO Client: Setting up container launch context for our AM
16/04/21 19:16:14 INFO Client: Setting up the launch environment for our AM container
16/04/21 19:16:14 INFO Client: Preparing resources for our AM container
16/04/21 19:16:14 INFO Client: Source and destination file systems are the same. Not copying file:/mi/spark/lib/spark-assembly-1.6.1-hadoop2.6.0.jar
16/04/21 19:16:14 INFO Client: Source and destination file systems are the same. Not copying file:/app/spark-test.jar
16/04/21 19:16:14 INFO Client: Source and destination file systems are the same. Not copying file:/tmp/spark-120aeddc-0f87-4411-9400-22ba01096249/__spark_conf__5619348744221830008.zip
16/04/21 19:16:14 INFO SecurityManager: Changing view acls to: root
16/04/21 19:16:14 INFO SecurityManager: Changing modify acls to: root
16/04/21 19:16:14 INFO SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users with view permissions: Set(root); users with modify permissions: Set(root)
16/04/21 19:16:15 INFO Client: Submitting application 1 to ResourceManager
16/04/21 19:16:15 INFO YarnClientImpl: Submitted application application_1461246306015_0001
16/04/21 19:16:16 INFO Client: Application report for application_1461246306015_0001 (state: ACCEPTED)
16/04/21 19:16:16 INFO Client: 
     client token: N/A
     diagnostics: N/A
     ApplicationMaster host: N/A
     ApplicationMaster RPC port: -1
     queue: default
     start time: 1461246375622
     final status: UNDEFINEDsparkcluster01.testing.com
     tracking URL: http://sparkcluster01.testing.com:8088/proxy/application_1461246306015_0001/
     user: root
16/04/21 19:16:17 INFO Client: Application report for application_1461246306015_0001 (state: ACCEPTED)
16/04/21 19:16:18 INFO Client: Application report for application_1461246306015_0001 (state: ACCEPTED)
16/04/21 19:16:19 INFO Client: Application report for application_1461246306015_0001 (state: ACCEPTED)
16/04/21 19:16:20 INFO Client: Application report for application_1461246306015_0001 (state: ACCEPTED)
16/04/21 19:16:21 INFO Client: Application report for application_1461246306015_0001 (state: FAILED)
16/04/21 19:16:21 INFO Client: 
     client token: N/A
     diagnostics: Application application_1461246306015_0001 failed 2 times due to AM Container for appattempt_1461246306015_0001_000002 exited with  exitCode: -1000
For more detailed output, check application tracking page:http://sparkcluster01.testing.com:8088/cluster/app/application_1461246306015_0001Then, click on links to logs of each attempt.
Diagnostics: java.io.FileNotFoundException: File file:/app/spark-test.jar does not exist
Failing this attempt. Failing the application.
     ApplicationMaster host: N/A
     ApplicationMaster RPC port: -1
     queue: default
     start time: 1461246375622
     final status: FAILED
     tracking URL: http://sparkcluster01.testing.com:8088/cluster/app/application_1461246306015_0001
     user: root
Exception in thread "main" org.ap/app/spark-test.jarache.spark.SparkException: Application application_1461246306015_0001 finished with failed status
    at org.apache.spark.deploy.yarn.Client.run(Client.scala:1034)
    at org.apache.spark.deploy.yarn.Client$.main(Client.scala:1081)
    at org.apache.spark.deploy.yarn.Client.main(Client.scala)
    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.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:731)
    at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:181)
    at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:206)
    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:121)
    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)

  

我什至尝试通过将应用程序放置在 HDFS 上并在 Spark Submit 命令中给出 HDFS 路径来在 HDFS 文件系统上运行 Spark。即使如此,它也会在某些 Spark Conf 文件上抛出 File Not Found Exception。我正在执行下面的 Spark Submit 命令,请找到该命令下面的日志输出。

 ./bin/spark-submit  --class com.test.Engine  --master yarn --deploy-mode cluster hdfs://sparkcluster01.testing.com:9000/beacon/job/spark-test.jar


16/04/21 18:11:45 INFO RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
16/04/21 18:11:46 INFO Client: Requesting a new application from cluster with 1 NodeManagers
16/04/21 18:11:46 INFO Client: Verifying our application has not requested more than the maximum memory capability of the cluster (8192 MB per container)
16/04/21 18:11:46 INFO Client: Will allocate AM container, with 1408 MB memory including 384 MB overhead
16/04/21 18:11:46 INFO Client: Setting up container launch context for our AM
16/04/21 18:11:46 INFO Client: Setting up the launch environment for our AM container
16/04/21 18:11:46 INFO Client: Preparing resources for our AM container
16/04/21 18:11:46 INFO Client: Source and destination file systems are the same. Not copying file:/mi/spark/lib/spark-assembly-1.6.1-hadoop2.6.0.jar
16/04/21 18:11:47 INFO Client: Uploading resource hdfs://sparkcluster01.testing.com:9000/beacon/job/spark-test.jar -> file:/root/.sparkStaging/application_1461234217994_0017/spark-test.jar
16/04/21 18:11:49 INFO Client: Source and destination file systems are the same. Not copying file:/tmp/spark-f4eef3ac-2add-42f8-a204-be7959c26f21/__spark_conf__6818051470272245610.zip
16/04/21 18:11:50 INFO SecurityManager: Changing view acls to: root
16/04/21 18:11:50 INFO SecurityManager: Changing modify acls to: root
16/04/21 18:11:50 INFO SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users with view permissions: Set(root); users with modify permissions: Set(root)
16/04/21 18:11:50 INFO Client: Submitting application 17 to ResourceManager
16/04/21 18:11:50 INFO YarnClientImpl: Submitted application application_1461234217994_0017
16/04/21 18:11:51 INFO Client: Application report for application_1461234217994_0017 (state: ACCEPTED)
16/04/21 18:11:51 INFO Client: 
     client token: N/A
     diagnostics: N/A
     ApplicationMaster host: N/A
     ApplicationMaster RPC port: -1
     queue: default
     start time: 1461242510849
     final status: UNDEFINED
     tracking URL: http://sparkcluster01.testing.com:8088/proxy/application_1461234217994_0017/
     user: root
16/04/21 18:11:52 INFO Client: Application report for application_1461234217994_0017 (state: ACCEPTED)
16/04/21 18:11:53 INFO Client: Application report for application_1461234217994_0017 (state: ACCEPTED)
16/04/21 18:11:54 INFO Client: Application report for application_1461234217994_0017 (state: FAILED)
16/04/21 18:11:54 INFO Client: 
     client token: N/A
     diagnostics: Application application_1461234217994_0017 failed 2 times due to AM Container for appattempt_1461234217994_0017_000002 exited with  exitCode: -1000
For more detailed output, check application tracking page:http://sparkcluster01.testing.com:8088/cluster/app/application_1461234217994_0017Then, click on links to logs of each attempt.
Diagnostics: File file:/tmp/spark-f4eef3ac-2add-42f8-a204-be7959c26f21/__spark_conf__6818051470272245610.zip does not exist
java.io.FileNotFoundException: File file:/tmp/spark-f4eef3ac-2add-42f8-a204-be7959c26f21/__spark_conf__6818051470272245610.zip does not exist
    at org.apache.hadoop.fs.RawLocalFileSystem.deprecatedGetFileStatus(RawLocalFileSystem.java:609)
    at org.apache.hadoop.fs.RawLocalFileSystem.getFileLinkStatusInternal(RawLocalFileSystem.java:822)
    at org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:599)
    at org.apache.hadoop.fs.FilterFileSystem.getFileStatus(FilterFileSystem.java:421)
    at org.apache.hadoop.yarn.util.FSDownload.copy(FSDownload.java:253)
    at org.apache.hadoop.yarn.util.FSDownload.access$000(FSDownload.java:63)
    at org.apache.hadoop.yarn.util.FSDownload$2.run(FSDownload.java:361)
    at org.apache.hadoop.yarn.util.FSDownload$2.run(FSDownload.java:359)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:422)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
    at org.apache.hadoop.yarn.util.FSDownload.call(FSDownload.java:358)
    at org.apache.hadoop.yarn.util.FSDownload.call(FSDownload.java:62)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Failing this attempt. Failing the application.
     ApplicationMaster host: N/A
     ApplicationMaster RPC port: -1
     queue: default
     start time: 1461242510849
     final status: FAILED
     tracking URL: http://sparkcluster01.testing.com:8088/cluster/app/application_1461234217994_0017
     user: root
Exception in thread "main" org.apache.spark.SparkException: Application application_1461234217994_0017 finished with failed status
    at org.apache.spark.deploy.yarn.Client.run(Client.scala:1034)
    at org.apache.spark.deploy.yarn.Client$.main(Client.scala:1081)
    at org.apache.spark.deploy.yarn.Client.main(Client.scala)
    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.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:731)
    at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:181)
    at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:206)
    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:121)
    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
16/04/21 18:11:55 INFO ShutdownHookManager: Shutdown hook called
16/04/21 18:11:55 INFO ShutdownHookManager: Deleting directory /tmp/spark-f4eef3ac-2add-42f8-a204-be7959c26f21
  

Spark 配置未指向正确的 hadoop 配置目录。 2.7.2 的 hadoop 配置位于文件路径 hadoop 2.7.2./etc/hadoop/ 而不是 /root/hadoop2.7.2/conf。当我在spark-env.sh下指向HADOOP_CONF_DIR=/root/hadoop2.7.2/etc/hadoop/时,spark提交开始工作并且文件未找到异常消失了。早些时候它指向 /root/hadoop2.7.2/conf (它不存在)。如果 Spark 没有指向正确的 hadoop 配置目录,则可能会导致类似的错误。我认为这可能是 Spark 中的一个错误,它应该优雅地处理它,而不是抛出模棱两可的错误消息。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在 Yarn 集群上运行的 Spark 作业 java.io.FileNotFoundException:文件不存在,即使文件在主节点上存在 的相关文章

随机推荐

  • 为什么 UIWebView 不应该放在 UIScrollView 中?

    问题 有谁知道在 iOS 上避免滚动视图内的 Web 视图的技术原因 假设您愿意禁用网络视图本身的滚动 如果你看在 Apple 文档中的 UIWebView 他们指出 重要的 您不应将 UIWebView 或 UITableView 对象嵌
  • 具有 AES 和 rsaEncryption 的 EnvelopedCMS(PKCS#1 v1.5 填充而不是 v2 (OAEP) 填充)可能吗?

    我曾经使用过 NET 来实现加密目的 到目前为止 我将 3DES Oid 1 2 840 113549 3 7 与 rsaEncryption Oid 1 2 840 113549 1 1 1 RSAES PKCS1 v1 5 结合使用 虽
  • 使用 PHP 在 JSON 中创建空对象的最佳方法?

    要创建一个空的 JSON 对象 我通常使用 json encode object null 将 null 强制转换为对象是可行的 但是还有其他更好的方法和 或此解决方案有任何问题吗 推荐方法 json decode 将返回一个stdClas
  • 在 Python 中设置乘积

    A product of n copies of a set S is denoted Sn For example 0 1 3 is the set of all 3 bit sequences 0 1 3 0 0 0 0 0 1 0 1
  • Python:如何在请求中使用 Chrome cookie

    我正在寻找一种从 Chrome 浏览器 默认 获取 cookie 的方法 并通过请求使用它 我当然已经四处搜寻 并发现了例如这个 如何使用Python从网络浏览器获取cookie 但这不再起作用了 因为 Chrome 不断更新 他们在答案中
  • 为什么action第二次运行时没有触发Effect?

    Effect Effect loadDocsEffect this actions pipe ofType myActionTypes LoadDocs mergeMap action gt this myService getDocs m
  • VB.NET 到 C# - my.computer.getfiles()

    此 VB NET 代码的等效 C 代码是什么 My Computer FileSystem GetFiles My 类是 VB NET 特定的 您可以使用 System IO Directory 类的静态方法 例如目录 GetFiles
  • 限制弹性盒项目的高度[重复]

    这个问题在这里已经有答案了 我有一个包含 2 个项目的弹性盒 方向 行 第二项的文字内容很长 我希望第二个项目与第一个项目一样高 并且有一个滚动条 这可能吗 wrap display flex item 1 height 100px bac
  • 在 Ruby 块中使用“return”

    我正在尝试使用 Ruby 1 9 1 作为嵌入式脚本语言 以便在 Ruby 块中编写 最终用户 代码 这样做的一个问题是 我希望用户能够在块中使用 return 关键字 这样他们就不必担心隐式返回值 考虑到这一点 我希望能够做这样的事情 d
  • 正在寻找 Delphi 7 代码来检测程序是否以管理员权限启动?

    我在寻找working 明显地 德尔福7代码所以我可以检查是否我的程序是以管理员权限启动的 提前致谢 重要更新 到目前为止 查看了答案中的代码后 我意识到我的问题可能不太清楚 或者至少不完整 我想知道我的 Delphi 7 程序是否以 以管
  • Symfony/Doctrine - createQueryBuilder orderBy

    我有一个具有财产 预算 的 团队 实体 我只想打印团队属性 并且希望预算最大的团队出现在第一位置 第二位置 第三位置 DESC 但使用这段代码 它不起作用 我不明白为什么 索引动作 控制器 em this gt getDoctrine gt
  • 如何从 cv::Mat 转换为 CvArr?

    我花了很多时间搜索如何从 cv Mat 或 CvMat 转换为 CvArr 但没有任何收获 请帮助我 谢谢 Mat img imread C MyPic jpg CV LOAD IMAGE GRAYSCALE IplImage tmp im
  • 如何在opengl中绘制y轴或x轴的圆柱体

    我只想用opengl画一个圆柱体 我找到了很多样本 但它们都在 z 轴上绘制了圆柱体 我希望它们位于 x 或 y 轴上 我怎样才能做到这一点 下面的代码是在 z 方向绘制圆柱体的代码 我不想要它 GLUquadricObj quadrati
  • 检查 url 是否被缓存 webview android

    我使用 webview 加载 html 页面和 url 我只想在互联网可用或 url 内容由 Web 视图缓存时加载 url 如何检查 url 是否已缓存而不必创建自己的 缓存在某些外部路径上 WebSettings ws wv getSe
  • UART ISR Tx Rx 架构

    我让事情变得复杂了吗 我正在构建我的代码 以便通过 UART 从 8051 micro 与外围设备进行通信 外设响应主机的命令 一次只能响应一个命令 这是一个简单的发送和接收协议 tx1 rx1 tx2 rx2 tx3 rx3 每个 TX
  • xcode - “尝试使用已删除的函数” - 这是什么意思?

    我正在 Xcode 4 2 中编写 C 库 我的一个类将无法编译并出现此错误 尝试使用已删除的函数 没有具体说明它正在谈论什么功能 我不想在这里发布类代码 但是有人知道这个错误意味着什么吗 我对线程 C 11 也有类似的消息 事实证明 我向
  • SQL 中的动态 Like 语句

    我已经绞尽脑汁思考如何做到这一点有一段时间了 我知道这个网站上的一些天才会找到答案 基本上我正在尝试这样做 SELECT column FROM table WHERE table column LIKE string1 OR table
  • 使用接口作为分部视图的模型类型+数据注释

    我遇到的情况是 复杂的局部视图需要根据局部视图的使用位置进行不同的字段验证 我认为我可以通过使分部视图采用接口作为模型类型并基于该接口实现两个不同的 ViewModel 来解决这个问题 两个 ViewModel 中的数据注释会不同 然后 我
  • 删除如何处理指针常量性?

    我正在读这个问题删除常量指针并想了解更多关于delete行为 现在 根据我的理解 delete expression分两步进行 调用析构函数 然后释放内存 通常通过调用free 通过调用操作符删除 operator delete接受一个vo
  • 在 Yarn 集群上运行的 Spark 作业 java.io.FileNotFoundException:文件不存在,即使文件在主节点上存在

    我对 Spark 相当陌生 我尝试搜索但找不到合适的解决方案 我已经在两个机器上安装了 hadoop 2 7 2 一个主节点和另一个工作节点 我已经通过以下链接设置了集群http javadev org docs hadoop centos