"hive meta data problem"hive.metastore. Hivemetaexception:failed to get schema version.

Source: Internet
Author: User
Tags character set error code sql error sql error code create database

raini@biyuzhe:~$ Schematool-dbtype Mysql-initschema
Slf4j:class path contains multiple slf4j bindings.
Slf4j:found Binding in [jar:file:/home/raini/app/apache-hive-2.1.1-bin/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/ Impl/staticloggerbinder.class]
Slf4j:found Binding in [jar:file:/home/raini/app/hadoop-2.8.0/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/ Org/slf4j/impl/staticloggerbinder.class]
Slf4j:see http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
Slf4j:actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Metastore Connection Url:jdbc:mysql://localhost:3306/hive?createdatabaseifnotexist=true&usessl=false
Metastore Connection Driver:com.mysql.jdbc.Driver
Metastore Connection User:hive
Starting Metastore schema initialization to 2.1.0
Initialization Script Hive-schema-2.1.0.mysql.sql
Initialization script completed
Org.apache.hadoop.hive.metastore.HiveMetaException:Failed to get schema version.
Underlying cause:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:Table ' hive. VERSION ' doesn ' t exist
SQL Error code:1146
Use--verbose for detailed stacktrace.
Schematool Failed * * *


Problems, such as the installation of hive-2.1.1 after the format is unsuccessful, did not find Metastore (with MySQL, before the upgrade is good)


Reason:

Previously used Hive-1.2.1,mysql connection Metastore used by the user as hive, may be deleted metadata is not clean or some configuration files can not be deleted,


Solve:

Use another user.

mysql> create user ' hive1 ' @ '% ' identified by ' hive1 ';
Mysql> Grant All on * * to ' hive1 ' @localhost identified by ' hive1 ';
mysql> flush Privileges;

and modified: Hive-site.xml

<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive1</value>
</property>

<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>hive1</value>
</property>



This is the step that hive2.0 needs. (Execute it)

Mysql> Source/home/raini/app/hive/scripts/metastore/upgrade/mysql/hive-schema-2.1.0.mysql.sql;


Start hive and get it done ~




Question 2:

Hive (default) > CREATE Database Anserchapp;
Failed:execution Error, return code 1 from Org.apache.hadoop.hive.ql.exec.DDLTask. Metaexception (Message:got exception:java.io.IOException Failed on local exception:java.io.IOException:Couldn ' t set up IO streams; Host Details:local host is: "biyuzhe/127.0.1.1"; Destination host is: "User": 8020; )


Set up:

mysql> ALTER DATABASE hive character Set latin1; Query OK, 1 row Affected (0.00 sec)

Error:

Hive (default) > CREATE Database Anserchapp;
Failed:execution Error, return code 1 from Org.apache.hadoop.hive.ql.exec.DDLTask. Metaexception (Message:java.lang.IllegalArgumentException:java.net.UnknownHostException:user)



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.