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,配置内容如下:




javax.jdo.option.ConnectionURL
jdbc:derby:;databaseName=metastore_db;create=true


javax.jdo.option.ConnectionDriverName
org.apache.derby.jdbc.EmbeddedDriver
Driver class name for a JDBC metastore


javax.jdo.option.ConnectionUserName
APP


javax.jdo.option.ConnectionPassword
mine


hive.metastore.schema.verification
false

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注释掉。

你可能感兴趣的:(Hive安装报错汇总)