程序代码查看链接
http://www.aboutyun.com/thread-8404-1-1.html
整合上面链接中的代码,提交计算hdfs上的文件中单词数量
问题日志:
16/03/29 16:50:59 INFO BlockManagerInfo: Added broadcast_1_piece0 in memory on 10.10.6.146:64376 (size: 2.3 KB, free: 1124.2 MB)
16/03/29 16:50:59 INFO SparkContext: Created broadcast 1 from broadcast at DAGScheduler.scala:1006
16/03/29 16:50:59 INFO DAGScheduler: Submitting 2 missing tasks from ShuffleMapStage 0 (MapPartitionsRDD[3] at map at ScalaWordCount.scala:69)
16/03/29 16:50:59 INFO TaskSchedulerImpl: Adding task set 0.0 with 2 tasks
16/03/29 16:51:14 WARN TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources
16/03/29 16:51:29 WARN TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources
16/03/29 16:51:44 WARN TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources
16/03/29 16:51:59 WARN TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources
问题解决:
在代码中加spark.executor.memory设置,具体大小根据集群内存划分