在集羣模式下運行scala spark 2.1應用程序時遇到問題。EMR Spark集羣模式配置單元問題
Release label:emr-5.7.0*
Hadoop distribution:Amazon 2.7.3
Applications:Hive 2.1.1, Presto 0.170, Spark 2.1.1, Ganglia 3.7.2, Zeppelin
0.7.2, ZooKeeper 3.4.10
有一個.jar
其完美的工作,並通過client
模式在羣集上提交。 當我嘗試在cluster
模式提交罐子,我收到一個異常:
java.lang.IllegalArgumentException: Error while instantiating org.apache.spark.sql.hive.HiveSessionState':
at org.apache.spark.sql.SparkSession$.org$apache$spark$sql$SparkSession$$reflect(SparkSession.scala:981) at org.apache.spark.sql.SparkSession.sessionState$lzycompute(SparkSession.scala:110)
...
Caused by: java.lang.NoClassDefFoundError: org/apache/hadoop/hive/conf/HiveConf
at org.apache.spark.sql.hive.client.HiveClientImpl.<init>(HiveClientImpl.scala:97)
這裏是我嘗試運行應用程序:
spark-submit --master yarn \
--deploy-mode cluster \
--num-executors 64 \
--executor-cores 6 \
--driver-memory 6g \
--executor-memory 10g \
--conf "spark.driver.extraClassPath=/usr/lib/spark/jars/*.jar" \
--conf "spark.executor.extraClassPath=/usr/lib/spark/jars/*.jar" \
--conf "spark.yarn.queue=test_queue" \
--conf "spark.sql.hive.metastore.jars=/usr/hive/lib/*.jar" \
--jars /usr/lib/spark/jars/datanucleus-rdbms-3.2.9.jar,/usr/lib/spark/jars/datanucleus-api-jdo-3.2.6.jar,/usr/lib/spark/jars/datanucleus-core-3.2.10.jar \
--class MainApp /home/hadoop/app/application-1.0.jar
這裏我的初始化SparkSession
:
val sparkSession = SparkSession
.builder()
.appName(applicationName)
.enableHiveSupport()
.config("hive.exec.dynamic.partition", "true")
.config("hive.exec.dynamic.partition.mode", "nonstrict")
.getOrCreate()
有人可以提出一些建議,有什麼值得去嘗試?
PS:pyspark
在這個集羣應用程序的工作就像一個魅力在集羣模式下
難道** **蜂房罐子? – mrsrinivas
@mrsrinivas是的,所有的罐子都存在於從節點上 – oki