配置单元中的元数据错误

9nvpjoqh  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(278)

我已安装 hadoop , hive 以及 MySQL 在中的同一服务器上 CENT OS . 我还设置了 MySQL 用户id-hive可以通过以下步骤访问数据库。

mysql> CREATE DATABASE metastore;
mysql> USE metastore;

mysql> SOURCE $HIVE_HOME/scripts/metastore/upgrade/mysql/hive-schema-0.10.0.mysql.sql;

mysql> CREATE USER 'hiveuser'@'%' IDENTIFIED BY 'hivepassword'; 

mysql> GRANT all on *.* to 'hiveuser'@localhost identified by 'hivepassword';

mysql>  flush privileges;

my hive-site.xml文件属性如下:

<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost/metastorecreateDatabaseIfNotExist=true</value>
<description>metadata is stored in a MySQL server</description>
</property>

<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
<description>MySQL JDBC driver class</description>
</property>

<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hiveuser</value>
<description>user name for connecting to mysql server</description>      
</property>

<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>hivepassword</value>
<description>password for connecting to mysql server</description>
</property>

<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive/warehouse</value>
<description> warehouse </description>
</property>

当我在 hive shell 我得到以下错误:
配置单元>显示表格;失败:元数据错误:java.lang.runtimeexception:无法示例化org.apache.hadoop.hive.metastore.hivemetastoreclient失败:执行错误,从org.apache.hadoop.hive.ql.exec.ddltask返回代码1
我在网上搜了所有的东西,但找不到解决我问题的办法。有人能指引我吗,我在这里错过了什么?

6uxekuva

6uxekuva1#

1. First just check your hadoop daemons. All are up or not.

2. Else restart your hadoop cluster once.

3. Have you copied the jar (mysql-connector-java.***) into Hive's lib dir?

4. Which mysql version you are using. If it is very old then :

   mysql>alter database metastore_Db character set latin1;

 I think step 1 and 2 will solve your problem.

相关问题