Hive安装报错汇总

今天安装hive,按着官方文档操作,但是并没有能够成功,把碰到的问题记录下

1)执行$HIVE_HOME/bin/hive 报错:##

Caused by: MetaException(message:Version information not found in metastore. )
at org.apache.hadoop.hive.metastore.ObjectStore.checkSchema(ObjectStore.java:7753)
at org.apache.hadoop.hive.metastore.ObjectStore.verifySchema(ObjectStore.java:7731)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)

解决方法:
尝试将hive-default.xml.template 复制改名为hive-default.xml 还是不可以,后来新建hive-site.xml,配置内容如下:
<?xml version=”1.0″ encoding=”UTF-8″ standalone=”no”?>
<?xml-stylesheet type=”text/xsl” href=”configuration.xsl”?>
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:derby:;databaseName=metastore_db;create=true</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>org.apache.derby.jdbc.EmbeddedDriver</value>
<description>Driver class name for a JDBC metastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>APP</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>mine</value>
</property>
<property>
<name>hive.metastore.schema.verification</name>
<value>false</value>
</property>
</configuration>

2)执行$HIVE_HOME/bin/hive 报错:##

Caused by: MetaException(message:Hive metastore database is not initialized. Please use schematool (e.g. ./schematool -initSchema -dbType …) to create the schema. If needed, don’t forget to include the option to auto-create the underlying database in your JDBC connection string (e.g. ?createDatabaseIfNotExist=true for mysql))
at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3414)
at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3386)
at org.apache.hadoop.hive.ql.metadata.Hive.getAllFunctions(Hive.java:3640)

解决方法:
执行$HIVE_HOME/bin/schematool -initSchema -dbType derby

3)执行$HIVE_HOME/bin/schematool -initSchema -dbType derby 报错:##

Starting metastore schema initialization to 2.1.0
Initialization script hive-schema-2.1.0.derby.sql
Error: FUNCTION ‘NUCLEUS_ASCII’ already exists. (state=X0Y68,code=30000)
org.apache.hadoop.hive.metastore.HiveMetaException: Schema initialization FAILED! Metastore state would be inconsistent !!
Underlying cause: java.io.IOException : Schema script failed, errorcode 2
Use –verbose for detailed stacktrace.
*** schemaTool failed ***

解决方法:
将hive-schema-2.1.0.derby.sql 中的’NUCLEUS_ASCII’ 和 ‘NUCLEUS_MATCHES’ 两个function注释掉。

    原文作者:白孩儿
    原文地址: https://www.jianshu.com/p/921e7607fb56
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞