【问题标题】:Hive Metastore is not creating MYSQL or Derby ConnectionHive Metastore 未创建 MYSQL 或 Derby 连接
【发布时间】:2014-02-22 11:14:40
【问题描述】:

Hive Metastore 未创建 MYSQL 或 Derby 连接。

德比

schematool -dbType derby -initSchema
Metastore connection URL:    jdbc:mysql://localhost/metastore
Metastore Connection Driver :    com.mysql.jdbc.Driver
Metastore connection User:   hive

schematool -dbType derby -info
Metastore connection URL:    jdbc:mysql://localhost/metastore
Metastore Connection Driver :    com.mysql.jdbc.Driver
Metastore connection User:   hive
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to load driver
*** schemaTool failed ***

对于mysql

schematool -dbType mysql -initSchema
Metastore connection URL:    jdbc:mysql://localhost/metastore
Metastore Connection Driver :    com.mysql.jdbc.Driver
Metastore connection User:   hive
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to load driver
*** schemaTool failed ***

schematool -dbType mysql -info
Metastore connection URL:    jdbc:mysql://localhost/metastore
Metastore Connection Driver :    com.mysql.jdbc.Driver
Metastore connection User:   hive
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to load driver
*** schemaTool failed ***

有什么问题。

我正在运行 Hive 0.12.0

【问题讨论】:

  • DownVoters 请发表评论
  • 我对 0.14.0 也有同样的问题。 schematool 忽略 hive-site.xml 中的配置
  • 你找到解决办法了吗,请帮忙?

标签: mysql hadoop hive derby


【解决方案1】:

错误信息非常广泛。要获取有关根本原因的更多信息,schematool 支持-verbose 标志:

schematool -dbType derby -initSchema -verbose

这将打印完整的堆栈跟踪,在我的例子中识别丢失的数据库:

引起:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 未知数据库“元存储”

【讨论】:

    【解决方案2】:

    对于这个特定的错误“加载驱动程序失败”,您应该检查您是否复制了 mysql 连接器或在 Hive lib 文件夹中有链接。

    ln -s /usr/share/java/mysql-connector-java.jar $HIVE_HOME/lib/mysql-connector-java.jar

    (如果 Java 库中没有它,请下载它)

    同样获得 Derby 的 lib。

    【讨论】:

      【解决方案3】:

      如果你想访问 Derby,我怀疑这些应该是这样的:

      Metastore connection URL:    jdbc:derby://localhost:1527/metastore
      Metastore Connection Driver :    org.apache.derby.jdbc.ClientDriver
      

      而不是

      Metastore connection URL:    jdbc:mysql://localhost/metastore
      Metastore Connection Driver :    com.mysql.jdbc.Driver
      

      【讨论】:

      • 在哪里更改这些?我正在使用 0.12.0。我刚刚提取了包。我应该额外创建任何文件吗?比如 hive -site
      【解决方案4】:

      我认为问题出在您的网址上。修改 URL 如下。输入mysql端口号。

      元存储连接 URL:jdbc:mysql://localhost:3306/metastore

      【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-05-15
      • 2022-09-28
      • 1970-01-01
      • 2022-06-14
      • 2016-08-12
      • 2019-01-30
      • 1970-01-01
      相关资源
      最近更新 更多