记录CDH Spark2的spark2-submit的一个No such file or directory问题

简介: 运行: 在测试的CDH Spark2, 运行spark streaming, 命令如下: 点击(此处)折叠或打开 spark2-submit \ --class com.
运行:
在测试的CDH Spark2, 运行spark streaming,
命令如下:

点击(此处)折叠或打开

  1. spark2-submit \
  2. --class com.telenav.dataplatform.demo.realtimecases.WeatherAlerts \
  3. --master yarn --deploy-mode cluster \
  4. /usr/local/sparkProject/realtimeCases-0.0.1-SNAPSHOT.jar


错误:

点击(此处)折叠或打开

  1. 17/03/02 21:01:56 INFO cluster.YarnClusterScheduler: Adding task set 0.0 with 1 tasks
  2. 17/03/02 21:01:56 WARN net.ScriptBasedMapping: Exception running /etc/spark2/conf.cloudera.spark2_on_yarn/yarn-conf/topology.py 172.16.102.64
  3. java.io.IOException: Cannot run program "/etc/spark2/conf.cloudera.spark2_on_yarn/yarn-conf/topology.py" (in directory "/yarn/nm/usercache/spark/appcache/application_1488459089260_0003/container_1488459089260_0003_01_000001"): error=2, No such file or directory
  4.     at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
  5.     at org.apache.hadoop.util.Shell.runCommand(Shell.java:548)
  6.     at org.apache.hadoop.util.Shell.run(Shell.java:504)
  7.     at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:786)
  8.     at org.apache.hadoop.net.ScriptBasedMapping$RawScriptBasedMapping.runResolveCommand(ScriptBasedMapping.java:251)
  9.     at org.apache.hadoop.net.ScriptBasedMapping$RawScriptBasedMapping.resolve(ScriptBasedMapping.java:188)
  10.     at org.apache.hadoop.net.CachedDNSToSwitchMapping.resolve(CachedDNSToSwitchMapping.java:119)
  11.     at org.apache.hadoop.yarn.util.RackResolver.coreResolve(RackResolver.java:101)
  12.     at org.apache.hadoop.yarn.util.RackResolver.resolve(RackResolver.java:81)
  13.     at org.apache.spark.scheduler.cluster.YarnScheduler.getRackForHost(YarnScheduler.scala:37)
  14.     at org.apache.spark.scheduler.TaskSetManager$$anonfun$org$apache$spark$scheduler$TaskSetManager$$addPendingTask$1.apply(TaskSetManager.scala:201)
  15.     at org.apache.spark.scheduler.TaskSetManager$$anonfun$org$apache$spark$scheduler$TaskSetManager$$addPendingTask$1.apply(TaskSetManager.scala:182)
  16.     at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
  17.     at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
  18.     at org.apache.spark.scheduler.TaskSetManager.org$apache$spark$scheduler$TaskSetManager$$addPendingTask(TaskSetManager.scala:182)
  19.     at org.apache.spark.scheduler.TaskSetManager$$anonfun$1.apply$mcVI$sp(TaskSetManager.scala:161)
  20.     at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:160)
  21.     at org.apache.spark.scheduler.TaskSetManager.<init>(TaskSetManager.scala:160)
  22.     at org.apache.spark.scheduler.TaskSchedulerImpl.createTaskSetManager(TaskSchedulerImpl.scala:222)
  23.     at org.apache.spark.scheduler.TaskSchedulerImpl.submitTasks(TaskSchedulerImpl.scala:186)
  24.     at org.apache.spark.scheduler.DAGScheduler.submitMissingTasks(DAGScheduler.scala:1058)
  25.     at org.apache.spark.scheduler.DAGScheduler.org$apache$spark$scheduler$DAGScheduler$$submitStage(DAGScheduler.scala:933)
  26.     at org.apache.spark.scheduler.DAGScheduler.handleJobSubmitted(DAGScheduler.scala:873)
  27.     at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.doOnReceive(DAGScheduler.scala:1632)
  28.     at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:1624)
  29.     at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:1613)
  30.     at org.apache.spark.util.EventLoop$$anon$1.run(EventLoop.scala:48)
  31. Caused by: java.io.IOException: error=2, No such file or directory
  32.     at java.lang.UNIXProcess.forkAndExec(Native Method)
  33.     at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
  34.     at java.lang.ProcessImpl.start(ProcessImpl.java:134)
  35.     at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)

解决思路:
1.分析这句话,
17/03/02 21:01:56 WARN net.ScriptBasedMapping: Exception running /etc/spark2/conf.cloudera.spark2_on_yarn/yarn-conf/topology.py 172.16.102.64
java.io.IOException: Cannot run program "/etc/spark2/conf.cloudera.spark2_on_yarn/yarn-conf/topology.py" (in directory "/yarn/nm/usercache/spark/appcache/application_1488459089260_0003/container_1488459089260_0003_01_000001"): error=2, No such file or directory
说明在这个ip的机器上 没有这个py文件。

然后去机器验证,
然后再将01机器的 配置文件 全部copy到另外四台即可。
scp -r /etc/spark2/conf.cloudera.spark2_on_yarn root@hadoop-02:/etc/spark2/
scp -r /etc/spark2/conf.cloudera.spark2_on_yarn root@hadoop-03:/etc/spark2/
scp -r /etc/spark2/conf.cloudera.spark2_on_yarn root@hadoop-04:/etc/spark2/
scp -r /etc/spark2/conf.cloudera.spark2_on_yarn root@hadoop-05:/etc/spark2/

验证:
就ok了

目录
相关文章
|
SQL 分布式计算 对象存储
客户说|科脉 x AnalyticDB,Serverless Spark替换CDH助力运维降本80%
使用AnalyticDB Spark替换自建CDHSpark,助力科脉降本增效
|
SQL 分布式计算 资源调度
spark 3.1.x支持(兼容)hive 1.2.x以及hadoop cdh版本的尝试
spark 3.1.x支持(兼容)hive 1.2.x以及hadoop cdh版本的尝试
1013 0
|
Web App开发 消息中间件 分布式计算
|
分布式计算 Spark Go
|
分布式计算 Java 关系型数据库
java,mysql,hadoop,cdh,hive,spark,ntp,zookeeper,kafka,storm,redis,flume,git 安装详解
    顶部 ---------------------------------------------------------------------------------------------------------------------------------- 0.
1718 0
|
SQL 分布式计算 开发工具
|
1月前
|
分布式计算 大数据 Apache
ClickHouse与大数据生态集成:Spark & Flink 实战
【10月更文挑战第26天】在当今这个数据爆炸的时代,能够高效地处理和分析海量数据成为了企业和组织提升竞争力的关键。作为一款高性能的列式数据库系统,ClickHouse 在大数据分析领域展现出了卓越的能力。然而,为了充分利用ClickHouse的优势,将其与现有的大数据处理框架(如Apache Spark和Apache Flink)进行集成变得尤为重要。本文将从我个人的角度出发,探讨如何通过这些技术的结合,实现对大规模数据的实时处理和分析。
131 2
ClickHouse与大数据生态集成:Spark & Flink 实战
|
2月前
|
存储 分布式计算 算法
大数据-106 Spark Graph X 计算学习 案例:1图的基本计算、2连通图算法、3寻找相同的用户
大数据-106 Spark Graph X 计算学习 案例:1图的基本计算、2连通图算法、3寻找相同的用户
72 0
|
2月前
|
消息中间件 分布式计算 NoSQL
大数据-104 Spark Streaming Kafka Offset Scala实现Redis管理Offset并更新
大数据-104 Spark Streaming Kafka Offset Scala实现Redis管理Offset并更新
45 0