我遇到了这个问题:当我在spark上运行机器学习任务时,在一些阶段之后,所有的任务被分配给一台机器(excutor),并且阶段执行变得越来越慢。
[火花配置设置]
val conf = new SparkConf().setMaster(sparkMaster).setAppName("ModelTraining").setSparkHome(sparkHome).setJars(List(jarFile))
conf.set("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
conf.set("spark.kryo.registrator", "LRRegistrator")
conf.set("spark.storage.memoryFraction", "0.7")
conf.set("spark.executor.memory", "8g")
conf.set("spark.cores.max", "150")
conf.set("spark.speculation", "true")
conf.set("spark.storage.blockManagerHeartBeatMs", "300000")
val sc = new SparkContext(conf)
val lines = sc.textFile("hdfs://xxx:52310"+inputPath , 3)
val trainset = lines.map(parseWeightedPoint).repartition(50).persist(StorageLevel.MEMORY_ONLY)
[来自火花的警告日志]
14/09/19 10:26:23 WARN TaskSetManager: Loss was due to fetch failure from BlockManagerId(45, TS-BH109, 48384, 0)
14/09/19 10:27:18 WARN TaskSetManager: Lost TID 726 (task 14.0:9)
14/09/19 10:29:03 WARN SparkDeploySchedulerBackend: Ignored task status update (737 state FAILED) from unknown executor Actor[akka.tcp://sparkExecutor@TS-BH96:33178/user/Executor#-913985102] with ID 39
14/09/19 10:29:03 WARN TaskSetManager: Loss was due to fetch failure from BlockManagerId(30, TS-BH136, 28518, 0)
14/09/19 11:01:22 WARN BlockManagerMasterActor: Removing BlockManager BlockManagerId(47, TS-BH136, 31644, 0) with no recent heart beats: 47765ms exceeds 45000ms
有什么建议吗?
答案 0 :(得分:1)
你可以发布执行者日志 - 那里有任何可疑的东西吗?特别是,你有丢失的TID 726(任务14.0:9)。在驱动程序日志中,您应该看到分配了哪个执行程序TID 726 - 我检查该计算机上的错误日志,并查看是否有任何感兴趣的内容显示在那里。
我的猜测(而且这只是一个猜测)是你的遗嘱执行人崩溃了。此时系统将尝试启动新的执行程序,但这通常很慢。与此同时,当前任务可能会重新发送给现有的执行者,以进一步调整系统。