6.根据关键字“Schema initialization FAILED! Metastore state would be inconsistent !!”,查询到hdp的官方论坛。
解释说,这个是一个已知的问题。需要修改ambari的sql脚本,删除mysql的一些index等。
https://community.hortonworks.com/questions/113748/hive-metastore-start.html
7. 官方建议的步骤繁多。个人比较懒。而且这个hive库,前一天还是正常的。这个问题是突然出现的,我不倾向与,这个是bug的可能。
继续分析,查看hivemetastore的log,还是有必要的。
发现问题,表不存在
2018-03-07 15:34:43,871 INFO [pool-8-thread-200]: metastore.HiveMetaStore (HiveMetaStore.java:logInfo(746)) - 200: get_all_databases
2018-03-07 15:34:43,871 INFO [pool-8-thread-200]: HiveMetaStore.audit (HiveMetaStore.java:logAuditEvent(371)) - ugi=ambari-qa-hbjt_hadoop@domain.com ip=/172.18.98.57 cmd=get_all_databases
2018-03-07 15:34:43,873 ERROR [pool-8-thread-200]: metastore.RetryingHMSHandler (RetryingHMSHandler.java:invoke(165)) - HMSHandler Fatal error: javax.jdo.JDOException: Exception thrown when executing query
at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:596)
......
NestedThrowablesStackTrace:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'hivemeta.dbs' doesn't exist
at sun.reflect.GeneratedConstructorAccessor60.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
8.现在要从mysql入手分析,逐步检查。