I also see similar behavior when I run on Spark SQL. I get this warning:
WARN cluster.YarnScheduler: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources
But after ten minutes the resources are assigned and spark SQL job proceeds to run successfully. Usually I see this only for first query. I am not running any other application on these machines/cluster, so the delay in scheduling does not make sense. Has any one seen similar behavior? When I search for this, usually there is a real resource issue, but in my case resources are available, just not getting allocated properly which could be a bug in Yarn. I am attaching my failed MapReduce job log.
I appreciate your comments.
Thank you,
Anahita
Cloudera Enterprise Data Hub Edition Trial 5.9.0 (had the same issue with 5.8.0)
Java Version 1.7.0.
I have a four node cluster with one dedicated to server roles (HDFS NameNode, HiveServer, ClouderaManagement Server, Yarn Server, etc..) and the other three to worker roles (DataNode, NodeManager).
Each node has a dual socket Xeon E5-2670 with total 24 physical cores (48 with hyper-threading) and 256 GB memory and one PCIe SSD with 3TB of storage.
Yarn configuration options:
FairScheduler
Container virtual cpu cores: 44
Container memory : 160GB
Map(Reduce) task memory: 4GB
Map(Reduce) heap size: 3GB
Resource manager shows 480GB memory and 132 vcores as expected.
Hi Michael,
Thank you for your response. I appreciate your detailed explanation and tuning guides on this. I wanted to clarify a few configurations in my cluster specifically on min/max settings. Currently I have:
yarn.scheduler.minimum-allocation-mb=4GB
yarn.scheduler.maximum-allocation-mb=160GB
yarn.scheduler.increment-allocation-mb=1GB
yarn.scheduler.minimum-allocation-vcores=1
yarn.scheduler.maximum-allocation-vcores=44
yarn.scheduler.increment-allocation-vcores=1
In this case I still have the maximum of 44 containers per node, but my minimum is 1, instead of 4 that you suggested. I see why you would recommend tuning it with min of 4 containers, but wonder if the issue I am seeing is related to this.
What confuses me most is that I am able to fully utilize the cores. When jobs run I see all 132 vcores are used and my cluster resources are fully utilized. However at times, first attempt at AppliationMaster does not make any progress and is killed but second attempt is successful.
Specifically if I don't reboot my machines running TPCx-BB multiple times, I see that second MR application (dataGen-refresh) fails most of the time.
As for Spark, only for first query there is a huge delay before resources get allocated. Since I am not running any other application on my cluster, I don't think it is a real lack of resource like what others experience. (like this: http://www.datastax.com/dev/blog/common-spark-troubleshooting)
Thank you,
Anahita