【发布时间】:2015-10-06 18:46:30
【问题描述】:
以下是我在系统中安装的 Spark 和 Hive 版本
火花:spark-1.4.0-bin-hadoop2.6
蜂巢:apache-hive-1.0.0-bin
我已将 Hive 安装配置为使用 MySQL 作为 Metastore。目标是访问 MySQL Metastore 并在 spark-shell(使用 HiveContext)中执行 HiveQL 查询
到目前为止,我能够通过访问 Derby Metastore 来执行 HiveQL 查询(如 here 所述,相信 Spark-1.4 与 Hive 0.13.1 捆绑在一起反过来使用内部 Derby 数据库作为 Metastore)
然后我尝试通过在$SPARK_HOME/conf/spark-defaults.conf 中设置下面给出的属性(如建议的here)将spark-shell 指向我的外部Metastore(在这种情况下为MySQL),
spark.sql.hive.metastore.jars /home/mountain/hv/lib:/home/mountain/hp/lib
我还将$HIVE_HOME/conf/hive-site.xml 复制到$SPARK_HOME/conf。但是当我启动 spark-shell
mountain@mountain:~/del$ spark-shell
Spark context available as sc.
java.lang.ClassNotFoundException: java.lang.NoClassDefFoundError:
org/apache/hadoop/hive/ql/session/SessionState when creating Hive client
using classpath: file:/home/mountain/hv/lib/, file:/home/mountain/hp/lib/
Please make sure that jars for your version of hive and hadoop are
included in the paths passed to spark.sql.hive.metastore.jars.
我是否遗漏了什么(或)没有正确设置属性spark.sql.hive.metastore.jars?
【问题讨论】:
-
尝试将尾随
/*附加到路径中 - docs.databricks.com/data/metastores/…
标签: scala apache-spark hive apache-spark-sql