Hive 安装问题:Hive Metastore 数据库未初始化 [英] Hive installation issues: Hive metastore database is not initialized

查看:51
本文介绍了Hive 安装问题:Hive Metastore 数据库未初始化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在 raspberry pi 2 上安装 hive.我通过解压缩 Hive 压缩包安装了 Hive,并在我创建的 hduser 用户组下手动配置了 $HADOOP_HOME 和 $HIVE_HOME.运行 hive 时,我收到以下错误消息:蜂巢

I tried to install hive on a raspberry pi 2. I installed Hive by uncompress zipped Hive package and configure $HADOOP_HOME and $HIVE_HOME manually under hduser user-group I created. When running hive, I got the following error message: hive

ERROR StatusLogger 未找到 log4j2 配置文件.使用默认配置:仅将错误记录到控制台.

ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.

线程main"中的异常 java.lang.RuntimeException: Hive Metastore 数据库未初始化.请使用 schematool(例如 ./schematool -initSchema -dbType ...)来创建架构.如果需要,不要忘记在 JDBC 连接字符串中包含自动创建底层数据库的选项(例如 ?createDatabaseIfNotExist=true for mysql)

Exception in thread "main" java.lang.RuntimeException: 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)

所以我运行了上面错误消息中建议的命令:schematool -dbType derby -initSchema我收到错误消息:

So I ran the command suggested in the above error message: schematool -dbType derby -initSchema I got the error message:

错误:FUNCTION 'NUCLEUS_ASCII' 已经存在.(状态=X0Y68,代码=30000)org.apache.hadoop.hive.metastore.HiveMetaException:架构初始化失败!Metastore 状态会不一致!!* schemaTool 失败 *

Error: FUNCTION 'NUCLEUS_ASCII' already exists. (state=X0Y68,code=30000) org.apache.hadoop.hive.metastore.HiveMetaException: Schema initialization FAILED! Metastore state would be inconsistent !! * schemaTool failed *

当我尝试在线搜索此错误时,似乎没有任何有用的信息.任何有关 Hive 如何与 Derby 一起工作的帮助或任何解释都将不胜感激!

It seems there aren't any helpful information when I try to google this error online. Any help or any explanation on how Hive works with Derby would be appreciated!

推荐答案

安装 hive 后,如果您做的第一件事是运行 hive,hive 会尝试创建/初始化 Metastore_db,但显然可能无法正确完成.在最初的运行中,也许你看到了你的错误:

After installing hive, if the first thing you did was run hive, hive attempted to create/initialize the metastore_db, but apparently might not get it right. On that initial run, maybe you saw your error:

Exception in thread "main" java.lang.RuntimeException: 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)

运行 hive,即使它失败,也会在您运行 hive 的目录中创建一个 metastore_db 目录:

Running hive, even though it fails, creates a metastore_db directory in the directory from which you ran hive:

ubuntu15-laptop: ~ $>ls -l |grep meta
drwxrwxr-x 5 testuser testuser 4096 Apr 14 12:44 metastore_db

所以当你尝试跑步时

ubuntu15-laptop: ~ $>schematool -initSchema -dbType derby

Metastore 已经存在,但不是完整的形式.

The metastore already existed, but not in complete form.

答案是:

  1. 在第一次运行 hive 之前,运行

  1. Before you run hive for the first time, run

schematool -initSchema -dbType derby

schematool -initSchema -dbType derby

如果您已经运行了 hive,然后尝试 initSchema 并且它失败了:

If you already ran hive and then tried to initSchema and it's failing:

mv metastore_db metastore_db.tmp

mv metastore_db metastore_db.tmp

重新运行

schematool -initSchema -dbType derby

schematool -initSchema -dbType derby

再次运行 hive

**另外注意:如果你改变目录,上面创建的metastore_db将不会被找到!我确信有一个我还不知道的充分理由,因为我今天第一次尝试使用 hive.啊,这是关于此的信息:metastore_db 在我运行 Hive 的任何地方创建

**Also of note: if you change directories, the metastore_db created above won't be found! I'm sure there's a good reason for this that I don't know yet because I'm literally trying to use hive for the first time today. Ahhh here's information on this: metastore_db created wherever I run Hive

这篇关于Hive 安装问题:Hive Metastore 数据库未初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆