복붙노트

[HADOOP] 아파치 스파크의 배포 문제 (클러스터 모드) 하이브로

HADOOP

아파치 스파크의 배포 문제 (클러스터 모드) 하이브로

편집하다:

나는 여러 구조화 된 스키마에서 데이터를 읽는 스파크 응용 프로그램을 개발하고있어 나는 그 스키마의 정보를 집계하기 위해 노력하고있어. 내가 로컬로 실행하면 내 응용 프로그램이 잘 실행됩니다. 내가 클러스터에서 실행할 때, 나는 (아마도 하이브-site.xml 파일에) 또는 제출-명령 인수와 구성에 문제가 있어요. 나는 다른 관련 게시물을 검토 한 결과,하지만 내 시나리오에 대한 해결책의 특정을 찾을 수 없습니다. 내가 노력하고 내가 무엇을 아래에서 자세히있어 오류 명령을 무엇을 언급했습니다. 나는 스파크 할 새로운 그리고 난 사소한 뭔가를 누락 될 수 있습니다,하지만 내 질문을 지원하기 위해 더 많은 정보를 제공 할 수 있습니다.

원래 질문 :

나는 HDP2.3 구성 요소와 함께 번들로 6 노드 하둡 클러스터 내 스파크 응용 프로그램을 실행하기 위해 노력했습니다.

여기에 솔루션을 제안에 너희들을 위해 유용 할 수 있습니다 구성 요소 정보는 다음과 같습니다

클러스터 정보 : 6 노드 클러스터 :

1백28기가바이트 RAM 24 코어 8TB HDD

응용 프로그램에 사용되는 구성 요소

HDP - 2.3

스파크 - 1.3.1

$의 하둡 버전 :

Hadoop 2.7.1.2.3.0.0-2557
Subversion git@github.com:hortonworks/hadoop.git -r 9f17d40a0f2046d217b2bff90ad6e2fc7e41f5e1
Compiled by jenkins on 2015-07-14T13:08Z
Compiled with protoc 2.5.0
From source with checksum 54f9bbb4492f92975e84e390599b881d

대본:

나는 dataframe 같은 그것의 데이터 구조에 스파크의 실시간 쿼리를 최대한 활용할 수있는 방법에 SparkContext 및 HiveContext를 사용하는 것을 시도하고있다. 내 응용 프로그램에서 사용되는 의존성은 다음과 같습니다 :

<dependency> <!-- Spark dependency -->
        <groupId>org.apache.spark</groupId>
        <artifactId>spark-core_2.10</artifactId>
        <version>1.3.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.spark</groupId>
        <artifactId>spark-sql_2.10</artifactId>
        <version>1.3.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.spark</groupId>
        <artifactId>spark-hive_2.10</artifactId>
        <version>1.3.1</version>
    </dependency>
    <dependency>
        <groupId>com.databricks</groupId>
        <artifactId>spark-csv_2.10</artifactId>
        <version>1.4.0</version>
    </dependency>

아래는 제출 명령과 내가지고있어 해당 오류 로그는 다음과 같습니다

Command1을 제출 :

spark-submit --class working.path.to.Main \
    --master yarn \
    --deploy-mode cluster \
    --num-executors 17 \
    --executor-cores 8 \
    --executor-memory 25g \
    --driver-memory 25g \
    --num-executors 5 \
    application-with-all-dependencies.jar

오류 LOG1 :

User class threw exception: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient 

Command2를 제출 :

spark-submit --class working.path.to.Main \
    --master yarn \
    --deploy-mode cluster \
    --num-executors 17 \
    --executor-cores 8 \
    --executor-memory 25g \
    --driver-memory 25g \
    --num-executors 5 \
    --files /etc/hive/conf/hive-site.xml \
    application-with-all-dependencies.jar

오류 LOG2 :

User class threw exception: java.lang.NumberFormatException: For input string: "5s" 

I가 관리 권한을 가지고 있지 않기 때문에, 나는 구성을 수정할 수 없습니다. 글쎄, 난은 IT 엔지니어에게 연락하여 변경,하지만 난 찾고 있어요 수 있습니다 구성 파일의 작은 변화, 가능하면 관련 솔루션!

구성 변경은 여기에 제안했다.

그럼 난 다른 토론 포럼에서 제안 인수 등 다양한 jar 파일을 전달했습니다.

Command3을 제출 :

spark-submit --class working.path.to.Main \
    --master yarn \
    --deploy-mode cluster \
    --num-executors 17 \
    --executor-cores 8 \
    --executor-memory 25g \
    --driver-memory 25g \
    --num-executors 5 \
    --jars /usr/hdp/2.3.0.0-2557/spark/lib/datanucleus-api-jdo-3.2.6.jar,/usr/hdp/2.3.0.0-2557/spark/lib/datanucleus-core-3.2.10.jar,/usr/hdp/2.3.0.0-2557/spark/lib/datanucleus-rdbms-3.2.9.jar \
    --files /etc/hive/conf/hive-site.xml \
    application-with-all-dependencies.jar

오류 LOG3 :

User class threw exception: java.lang.NumberFormatException: For input string: "5s" 

나는 다음과 같은 명령으로 일어난 오류 로그를 분석 할 수있는 것을 이해하지 않았다.

Command4 등 제출 :

spark-submit --class working.path.to.Main \
    --master yarn \
    --deploy-mode cluster \
    --num-executors 17 \
    --executor-cores 8 \
    --executor-memory 25g \
    --driver-memory 25g \
    --num-executors 5 \
    --jars /usr/hdp/2.3.0.0-2557/spark/lib/*.jar \
    --files /etc/hive/conf/hive-site.xml \
    application-with-all-dependencies.jar

LOG4 제출 :

Application application_1461686223085_0014 failed 2 times due to AM Container for appattempt_1461686223085_0014_000002 exited with exitCode: 10
For more detailed output, check application tracking page:http://cluster-host:XXXX/cluster/app/application_1461686223085_0014Then, click on links to logs of each attempt.
Diagnostics: Exception from container-launch.
Container id: container_e10_1461686223085_0014_02_000001
Exit code: 10
Stack trace: ExitCodeException exitCode=10:
at org.apache.hadoop.util.Shell.runCommand(Shell.java:545)
at org.apache.hadoop.util.Shell.run(Shell.java:456)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:722)
at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:211)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:302)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:82)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Container exited with a non-zero exit code 10
Failing this attempt. Failing the application. 

다른 가능한 옵션? 도움의 모든 종류는 높게 평가 될 것입니다. 당신이 다른 어떤 정보가 필요하면 알려 주시기 바랍니다.

감사합니다.

해결법

  1. ==============================

    1.여기에 설명 된이 솔루션은 내 경우 일했다. 두 위치가 있습니다 하이브-site.xml의 그 혼란 스러울 수있는. --files /usr/hdp/current/spark-client/conf/hive-site.xml 대신 --files /etc/hive/conf/hive-site.xml의 사용합니다. 내 구성을 위해 단지를 추가 할 필요가 없습니다 않았다. 이것은 비슷한 문제로 어려움을 겪고있는 사람을 도움이되기를 바랍니다. 감사.

    여기에 설명 된이 솔루션은 내 경우 일했다. 두 위치가 있습니다 하이브-site.xml의 그 혼란 스러울 수있는. --files /usr/hdp/current/spark-client/conf/hive-site.xml 대신 --files /etc/hive/conf/hive-site.xml의 사용합니다. 내 구성을 위해 단지를 추가 할 필요가 없습니다 않았다. 이것은 비슷한 문제로 어려움을 겪고있는 사람을 도움이되기를 바랍니다. 감사.

  2. from https://stackoverflow.com/questions/36945467/apache-sparks-deployment-issue-cluster-mode-with-hive by cc-by-sa and MIT license