当我在Hive上发出选择查询时,请收到以下错误
FAILED: SemanticException Failed to get a spark session: org.apache.hadoop.hive.ql.metadata.HiveException: Failed to create spark client.
我在内存配置上关注了几个网站,但没有任何帮助。我在环境中的设置如下。有人可以帮忙。
yarn-site.xml
yarn.nodemanager.resource.memory-mb - 4096
yarn.nodemanager.resource.cpu-vcores - 2
yarn.scheduler.minimum-allocation-mb - 128
yarn.scheduler.maximum-allocation-mb - 1024
mapred-site.xml
mapreduce.framework.name - yarn
mapreduce.map.memory.mb - 4096
mapreduce.reduce.memory.mb - 8192
mapreduce.map.java.opts - -Xmx3072m
mapreduce.reduce.java.opts - -Xmx6144m
hive-site.xml
hive.execution.engine - spark
spark.home - /.../.../binary/spark-1.6.1-bin-hadoop2.6
spark.master - yarn-client
spark.eventLog.enabled - true
spark.eventLog.dir - /.../.../binary/spark-1.6.1-bin-hadoop2.6/logs
spark.executor.memory - 512m
spark.executor.cores - 2
spark-env.sh
export SPARK_WORKER_CORES=4
export SPARK_WORKER_MEMORY=16384M
export SPARK_EXECUTOR_CORES=1
export SPARK_EXECUTOR_MEMORY=8192M
您可以在Hive Cli中使用Hive -e,请观看登录控制台
hive --hiveconf hive.root.logger=DEBUG,console -e "select count(1) from tableA;"
我解决了更改/用户DIR在HDFS上的问题。