解决Hive installation issues: Hive metastore database is not initialized
2016-06-14 20:30
615 查看
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: hiveERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.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 underlyingdatabase in your JDBC connection string (e.g. ?createDatabaseIfNotExist=true for MySQL)So I ran the command suggested in the above error message: schematool -dbType derby -initSchema I got the error message:Error: FUNCTION 'NUCLEUS_ASCII' already exists. (state=X0Y68,code=30000) org.apache.hadoop.hive.metastore.HiveMetaException: Schema initialization FAILED! Metastore state would be inconsistent !! * schemaToolfailed *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!answer: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)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_dbSo when you then tried running
ubuntu15-laptop: ~ $>schematool -initSchema -dbType derby(或者mysql)The metastore already existed, but not in complete form.Soooooo the answer is:Before you run hive for the first time, runschematool -initSchema -dbType derby(或者mysql)If you already ran hive and then tried to initSchema and it's failing:mv metastore_db metastore_db.tmpRe runschematool -initSchema -dbType derby(或者mysql)Run hive again**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_dbcreated wherever I run Hive
相关文章推荐
- <LeetCode OJ> 334. Increasing Triplet Subsequence
- LeetCode---Top K Frequent Elements解题分析
- vuejs学习小记 单次插值
- Html中修改视频播放器的param属性的value的值
- String ,StringBuffer和StringBuilder最佳用法
- iOS-你真的会用UIMenuController吗?(详细)
- duilib动画按钮实现
- 如何使用iOS手势UIGestureRecognizer
- 关于UIImageView的显示问题——居中显示或者
- IOS UIScrollView
- HDOJ_Number Sequence
- Web自动化框架LazyUI使用手册(2)--先跑起来再说(第一个测试用例-百度搜索)
- Web自动化框架LazyUI使用手册(2)--先跑起来再说(第一个测试用例-百度搜索)
- java生成UUID通用唯一识别码 (Universally Unique Identifier)
- iOS开发 - 第02篇 - UI进阶 - 13 - 核心动画
- UIBezierPath详解
- UI设计师不可不知的安卓屏幕知识
- iOS最完美的UITextField中输入金额,只能输入数字和小数点,保留两位小数点且0放在首位
- solr 自定义QueryParser 用户查询解析方案
- Handler、Looper、MessageQueue源码分析