`
bo_hai
  • 浏览: 554979 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

Hive Failed to connect to the MetaStore Server 解决方案

 
阅读更多

1、最近在自学hive。安装hive及使用hive自带数据库可以正常运行。但是呢我想使用mysql作为后台数据库。因此要进行一翻配置。根据网上的文档,配置后,使用命令

show databases

 时,报错。错误信息是:

Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient

 再看hive.log 日志记录:

2013-06-01 11:52:16,379 WARN  hive.metastore (HiveMetaStoreClient.java:open(285)) - Failed to connect to the MetaStore Server...
2013-06-01 11:52:17,382 WARN  hive.metastore (HiveMetaStoreClient.java:open(285)) - Failed to connect to the MetaStore Server...
2013-06-01 11:52:18,383 WARN  hive.metastore (HiveMetaStoreClient.java:open(285)) - Failed to connect to the MetaStore Server...
2013-06-01 11:52:19,386 WARN  hive.metastore (HiveMetaStoreClient.java:open(285)) - Failed to connect to the MetaStore Server...
2013-06-01 11:52:20,387 WARN  hive.metastore (HiveMetaStoreClient.java:open(285)) - Failed to connect to the MetaStore Server...
2013-06-01 11:52:21,392 ERROR exec.Task (SessionState.java:printError(401)) - FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient

 

日志信息可以看出是:不能connect to metaStore server的问题。

我的解决方案是:

1)先检查mysql 链接jdbc使用到的启动 JAR是否放到 hive/lib 下面。

2)在hive运行的服务器,使得mysql命令行,看能否成功链接到mysql服务器。我的hive有mysql运行在同一台机器上,使用root用户登陆mysql,创建帐户(hive),赋予权限后,hive 还是不能登录,根据错误信息,在网上找到的问题原因是:mysql库中的user表中存在user 为空的记录,解决方案是:删除user表中user字段为空的记录。最后不能要忘了运行:flush privileges 命令。确认hive账户可以在运行hive服务的机器上登录mysql服务器;

3)正确配置hive-site.xml。

4)我遇到的问题是:配置完 hive-site.xml后,运行 show tables ,同样报上述错误。再次检查hive-site.xml 配置,发现:

<property>
  <name>hive.metastore.uris</name>
  <value>thrift://xxxxxxxx</value>
  <description>Thrift uri for the remote metastore. Used by metastore client to connect to remote metastore.</description>
</property>

 我不知道这个配置是干什么用的。果断清空value的值。再次运行show databases命令。成功!!!!

5)再次提醒读者朋友们:当你们的错误信息与上述错误相似时,请认真检查 hive.metastore.uris 的value 配置是否正确。建义新手不要配置。

最后与大家分享我的hive-site.xml配置:

<property>
  <name>javax.jdo.option.ConnectionURL</name>
  <value>jdbc:mysql://127.0.0.1:3306/metastore_db?createDatabaseIfNotExist=true</value>
  <description>JDBC connect string for a JDBC metastore</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionDriverName</name>
  <value>com.mysql.jdbc.Driver</value>
  <description>Driver class name for a JDBC metastore</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionUserName</name>
  <value>hive</value>
  <description>username to use against metastore database</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionPassword</name>
  <value>a123</value>
  <description>password to use against metastore database</description>
</property>

 

新手只需要配置上述四处及可。

分享到:
评论
1 楼 bo_hai 2013-11-25  
今天再次遇到这个问题了!

相关推荐

    hive metastore java api使用

    hive metastore hive metastore是hive的元数据管理服务,实际应用中很多第三方框架需要访问metastore服务,如spark,impala等。同样hive metastore也提供了java接口。 使用 import org.apache.hadoop.hive.conf....

    hive systemctl启停hiveserver2和metastore服务.pdf

    hive自带的启停hive服务非常不方便,操作麻烦,那么有没什么办法一键启停hive服务呢?这个文章就是解决这个问题的

    hive开启权限后不能创建数据库问题

    背景:由于Hive需要开启权限管理,安装网上教程,开启权限配置,重启集群后。 使用root用户登录,进入Hive命令行界面。 执行 create database test; 发现报错: Authorization failed:No privilege 'Create' found ...

    hive-metastore-3.1.2.jar

    hive-metastore-3.1.2.jar

    hive的一些报错及解决方法

    hive的一些报错及解决方法:连接报错、执行脚本卡住、内存溢出报错、表死锁问题

    Apache Hive(hive-standalone-metastore-3.0.0-bin.tar.gz)

    Apache Hive(hive-standalone-metastore-3.0.0-bin.tar.gz、hive-standalone-metastore-3.0.0-src.tar.gz)是一种分布式容错数据仓库系统,支持大规模分析,并使用 SQL 促进读取、写入和管理驻留在分布式存储中的 ...

    standalone-hive-metastore

    独立的Hive Metastore 该项目可在本地运行Hive Metastore,或将其嵌入到容器中。 尽管是公开的,但该项目目前尚未记录,并且可能仍承载某些基础结构特定配置。 该项目的灵感来自和多亏了他

    hive-metastore-2.3.6.jar

    在hive java api的时候 : 需要导入hive运行所需的jar包,导入jar包有两种方式可实现 1.使用maven依赖直接修改配置文件,以下为配置内容:(不推荐,会下载额外很多无用包,而且时间很长在1小时左右) 2.挑选必须...

    Practical.Hive.A.Guide.to.Hadoops.Data.Warehouse.System.1484202724

    to resource for using Hive: authors Scott Shaw, Ankur Gupta, David Kjerrumgaard, and Andreas Francois Vermeulen take you through learning HiveQL, the SQL-like language specific to Hive, to analyze, ...

    大数据之Hive官方文档简要翻译(中文文档)

    将官方文档做了简要翻译 ...元数据使用JPOX ORM解决方案(Data Nucleus)持久化,因此它支持的任何数据库都可以被Hive使用。大多数商业关 系数据库和许多开源数据库都受到支持。请参阅下面一节中支持的数据库列表。

    Hive metastore 使用达梦数据库存储元数据

    ## Hive metastore 使用达梦数据库存储元数据 - 使用说明 1. **在达梦数据库中创建metastore将使用的用户和表空间** 2. **配置hive-site.xml** 3. **元数据初始化** ### 常见问题

    hive-exec-2.1.1.jar

    Hive Metastore:存储元数据(如表的模式、分区信息等)。 HiveServer2:提供客户端连接和 SQL 查询执行。 Hive Execution Engine:这是实际执行查询的组件,它读取数据,处理查询,并返回结果。 hive-exec-2.1.1 是...

    hivesql语句练习

    &lt;description&gt;JDBC connect string for a JDBC metastore &lt;name&gt;javax.jdo.option.ConnectionDriverName &lt;value&gt;com.mysql.jdbc.Driver&lt;/value&gt; &lt;description&gt;Driver class name for a JDBC metastore ...

    spark-hive-thriftserver_2.11-2.1.3-SNAPSHOT-123456.jar

    spark-hive-thriftserver_2.11-2.1.spark-hive-thrift

    Apache Hive Essentials(PACKT,2015)

    In this book, we prepare you for your journey into big data by firstly introducing you to backgrounds in the big data domain along with the process of setting up and getting familiar with your Hive ...

    Practical Hive(Apress,2016)

    to resource for using Hive: authors Scott Shaw, Ankur Gupta, David Kjerrumgaard, and Andreas Francois Vermeulen take you through learning HiveQL, the SQL-like language specific to Hive, to analyze, ...

    Hive Succinctly

    Author Elton Stoneman uses Hive Succinctly to introduce the core principles of Hive and guides readers through mapping Hadoop and HBase data in Hive, writing complex queries in HiveQL, and running ...

    hive-jdbc-uber-2.6.5.jar

    Hit the "Connect" button to test the connection. You should see something like the following in the "Connection Message" text area if the connection is successful. Apache Hive 1.2.1000.2.5.3.0-37 ...

    详细调研hivemetastore管理机制.zip

    详细调研hivemetastore管理机制.zip

    hive解决问题方案

    hive解决问题的一些方案

Global site tag (gtag.js) - Google Analytics