You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by abhi <ab...@gmail.com> on 2015/03/03 17:51:24 UTC

Issue with yarn cluster - hangs in accepted state.

I am trying to run below java class with yarn cluster, but it hangs in
accepted state . i don't see any error . Below is the class and command .
Any help is appreciated .


Thanks,

Abhi

====



bin/spark-submit --class com.mycompany.app.SimpleApp --master yarn-cluster
/home/hduser/my-app-1.0.jar


{code}

public class SimpleApp {

    public static void main(String[] args) {

      String logFile = "/home/hduser/testspark.txt"; // Should be some file
on your system

      SparkConf conf = new SparkConf().setAppName("Simple Application");

      JavaSparkContext sc = new JavaSparkContext(conf);

      JavaRDD<String> logData = sc.textFile(logFile).cache();


      long numAs = logData.filter(new Function<String, Boolean>() {

        public Boolean call(String s) { return s.contains("a"); }

      }).count();


      long numBs = logData.filter(new Function<String, Boolean>() {

        public Boolean call(String s) { return s.contains("b"); }

      }).count();


      System.out.println("Lines with a: " + numAs + ", lines with b: " +
numBs);

    }

  }

{code}


15/03/03 11:47:40 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:41 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:42 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:43 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:44 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:45 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:46 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:47 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:48 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:49 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:50 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:51 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:52 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:53 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:54 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:55 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:56 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:57 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:58 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:59 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:48:00 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:48:01 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:48:02 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:48:03 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:48:04 INFO yarn.Client: Application report for
application_1425398386987_0002 (state: ACCEPTED

Re: Issue with yarn cluster - hangs in accepted state.

Posted by abhi <ab...@gmail.com>.
Thanks,
It worked.

-Abhi

On Tue, Mar 3, 2015 at 5:15 PM, Tobias Pfeiffer <tg...@preferred.jp> wrote:

> Hi,
>
> On Wed, Mar 4, 2015 at 6:20 AM, Zhan Zhang <zz...@hortonworks.com> wrote:
>
>>  Do you have enough resource in your cluster? You can check your resource
>> manager to see the usage.
>>
>
> Yep, I can confirm that this is a very annoying issue. If there is not
> enough memory or VCPUs available, your app will just stay in ACCEPTED state
> until resources are available.
>
> You can have a look at
>
> https://github.com/jubatus/jubaql-docker/blob/master/hadoop/yarn-site.xml#L35
> to see some settings that might help.
>
> Tobias
>
>
>

Re: Issue with yarn cluster - hangs in accepted state.

Posted by Tobias Pfeiffer <tg...@preferred.jp>.
Hi,

On Wed, Mar 4, 2015 at 6:20 AM, Zhan Zhang <zz...@hortonworks.com> wrote:

>  Do you have enough resource in your cluster? You can check your resource
> manager to see the usage.
>

Yep, I can confirm that this is a very annoying issue. If there is not
enough memory or VCPUs available, your app will just stay in ACCEPTED state
until resources are available.

You can have a look at

https://github.com/jubatus/jubaql-docker/blob/master/hadoop/yarn-site.xml#L35
to see some settings that might help.

Tobias

Re: Issue with yarn cluster - hangs in accepted state.

Posted by Zhan Zhang <zz...@hortonworks.com>.
Do you have enough resource in your cluster? You can check your resource manager to see the usage.

Thanks.

Zhan Zhang

On Mar 3, 2015, at 8:51 AM, abhi <ab...@gmail.com>> wrote:



I am trying to run below java class with yarn cluster, but it hangs in accepted state . i don't see any error . Below is the class and command . Any help is appreciated .


Thanks,

Abhi

====



bin/spark-submit --class com.mycompany.app.SimpleApp --master yarn-cluster /home/hduser/my-app-1.0.jar


{code}

public class SimpleApp {

    public static void main(String[] args) {

      String logFile = "/home/hduser/testspark.txt"; // Should be some file on your system

      SparkConf conf = new SparkConf().setAppName("Simple Application");

      JavaSparkContext sc = new JavaSparkContext(conf);

      JavaRDD<String> logData = sc.textFile(logFile).cache();


      long numAs = logData.filter(new Function<String, Boolean>() {

        public Boolean call(String s) { return s.contains("a"); }

      }).count();


      long numBs = logData.filter(new Function<String, Boolean>() {

        public Boolean call(String s) { return s.contains("b"); }

      }).count();


      System.out.println("Lines with a: " + numAs + ", lines with b: " + numBs);

    }


  }

{code}


15/03/03 11:47:40 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:41 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:42 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:43 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:44 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:45 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:46 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:47 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:48 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:49 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:50 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:51 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:52 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:53 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:54 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:55 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:56 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:57 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:58 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:47:59 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:48:00 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:48:01 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:48:02 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:48:03 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED)

15/03/03 11:48:04 INFO yarn.Client: Application report for application_1425398386987_0002 (state: ACCEPTED