gpt4 book ai didi

scala - 在 'spark.sql.hive.metastore.jars' 中设置属性 'spark-defaults.conf' 后出现异常

转载 作者:行者123 更新时间:2023-12-01 15:00:58 29 4
gpt4 key购买 nike

下面给出的是我在系统中安装的 Spark & Hive 版本

Spark :spark-1.4.0-bin-hadoop2.6
hive :apache-hive-1.0.0-bin
我已将 Hive 安装配置为使用 MySQL 作为 Metastore。目标是访问 MySQL Metastore 并在 spark-shell 内执行 HiveQL 查询(使用 HiveContext )

到目前为止,我能够通过访问 Derby Metastore 来执行 HiveQL 查询(如 here 所述,相信 Spark-1.4 Hive 0.13.15 0x10 中的内部数据库捆绑在一起)作为内部数据库使用 Derby Metastore 67920)

然后我尝试通过设置下面在 spark-shell 中给出的属性(如建议的 here )将 $SPARK_HOME/conf/spark-defaults.conf 指向我的外部 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

最佳答案

hive-site.xml 的损坏版本会导致这个...请复制正确的 hive-site.xml

关于scala - 在 'spark.sql.hive.metastore.jars' 中设置属性 'spark-defaults.conf' 后出现异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31469173/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com