我安装了 Apache Spark 0.9.0 集群,我正在尝试部署从 HDFS 读取文件的代码。这段代码抛出警告,最终作业失败。这是代码
/**
* running the code would fail
* with a warning
* Initial job has not accepted any resources; check your cluster UI to ensure that
* workers are registered and have sufficient memory
*/
object Main extends App {
val sconf = new SparkConf()
.setMaster("spark://labscs1:7077")
.setAppName("spark scala")
val sctx = new SparkContext(sconf)
sctx.parallelize(1 to 100).count
}
下面是警告信息
Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient memory
如何摆脱这个或者我是否缺少一些配置。
最佳答案
当您通过设置 spark.cores.max
和 spark.executor.memory
resp 请求的核心数或 RAM 量(每个节点)时,您会得到这个' 超出了可用的范围。因此,即使没有其他人在使用集群,并且您指定要使用,比如每个节点 100GB RAM,但您的节点只能支持 90GB,那么您将收到此错误消息。
公平地说,在这种情况下消息是模糊的,如果它说你超过了最大值会更有帮助。
关于java - 在 Spark 0.9.0 上运行作业会抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21677142/