Spark运行时遇到的错误 scheduler.TaskSchedulerImpl: Initial job has not accepted any resources

Cady ·
更新时间:2024-11-14
· 636 次阅读

错误提示: scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your clus ter UI to ensure that workers are registered and have sufficient resources 调度器:初始化Job时没有足够的资源,检查你的ClusterUI确保Worker节点已经注册并且有足够的资源

发生此错误的原因可能有两个:


1. 主机主机名和ip是否配置正确

    先查看/etc/hosts文件配置是否正确
                           vi /etc/hosts

    查看是否主机名和IP号一致

2.内存或者Core数不够。

     由于我之前没有设置Spark_EXECUTOR_MEMORY,这个值默认值为1024M,所以内存不够,无法成功运行。可以在Spark-webUI上可以看到

方法:

                cd $SPARK_HOME/conf

                 vi spark-env.sh

添加         export SPARK_EXECUTOR_MEMORY=512M

错误提示信息:

sc.textFile("hdfs://node001:8020/spark/data/test.txt").flatMap(_.split(" ")).map((_,1)).reduceByKey(_+_).collect() [Stage 0:> (0 + 0) / 2]20/02/20 19:35:36 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your clus ter UI to ensure that workers are registered and have sufficient resources20/02/20 19:35:51 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources 20/02/20 19:36:06 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources 20/02/20 19:36:21 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources [Stage 0:> (0 + 0) / 2]20/02/20 19:36:36 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your clus ter UI to ensure that workers are registered and have sufficient resources20/02/20 19:36:51 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources 20/02/20 19:37:06 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources 20/02/20 19:37:21 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources [Stage 0:> (0 + 0) / 2]20/02/20 19:37:36 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your clus ter UI to ensure that workers are registered and have sufficient resources20/02/20 19:37:51 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources 20/02/20 19:38:06 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources 20/02/20 19:38:21 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources [Stage 0:> (0 + 0) / 2]20/02/20 19:38:36 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your clus ter UI to ensure that workers are registered and have sufficient resources20/02/20 19:38:51 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources 20/02/20 19:39:06 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources 20/02/20 19:39:21 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources [Stage 0:> (0 + 0) / 2]20/02/20 19:39:36 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your clus ter UI to ensure that workers are registered and have sufficient resources20/02/20 19:39:51 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources 20/02/20 19:40:06 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources 20/02/20 19:40:21 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources [Stage 0:> (0 + 0) / 2]20/02/20 19:40:36 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your clus ter UI to ensure that workers are registered and have sufficient resources20/02/20 19:40:51 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources 20/02/20 19:41:06 WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources [1]+ Stopped ./spark-shell --master spark://node001:7077
作者:qq_34072169



has any NOT spark

需要 登录 后方可回复, 如果你还没有账号请 注册新账号
相关文章