之前学习的时候安装的Hive 但是很久没有使用
今天启动的时候,就发现界面一直停在SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
经过一番百度之后,说因为没有正常启动Hive 的 Metastore Server服务进程。
然后我就启动命令:
bin/hive --service metastore
然后发现还是停在这个界面SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
又经过一番百度后,让我初始化一下元数据。
于是我就又跟着初始化元数据:
bin/schematool -dbType mysql -initSchema
发现又报错了
Error: Duplicate key name 'PCS_STATS_IDX' (state=42000,code=1061)
org.apache.hadoop.hive.metastore.HiveMetaException: Schema initialization FAILED! Metastore state would be inconsistent !!
又百度了一番发现以上是因为我的mysql已经创建了metastore database
解决方法:需要删除mysql 中的metastore数据库
删除之后重新初始化元数据库
bin/schematool -dbType mysql -initSchema
初始化之后再启动bin/hive就可以了
感觉就是第一步错,然后步步错
希望这篇文章对大家有所帮助