2017-10-18 58 views
0

尝试从2.1.0升级蜂房2.3.0获得以下错误 (其实升级EMR 5.7.0至5.8.0)重复键名,而升级蜂巢

​​ Notice: /Stage[main]/Hadoop_hive::Init_metastore_schema/Exec[init hive-metastore schema]/returns: Error: Duplicate key name 'PCS_STATS_IDX' (state=42000,code=1061) Notice: /Stage[main]/Hadoop_hive::Init_metastore_schema/Exec[init hive-metastore schema]/returns: Notice: /Stage[main]/Hadoop_hive::Init_metastore_schema/Exec[init hive-metastore schema]/returns: Closing: 0: jdbc:mysql://connection_string:3306/hive?createDatabaseIfNotExist=true Notice: /Stage[main]/Hadoop_hive::Init_metastore_schema/Exec[init hive-metastore schema]/returns: org.apache.hadoop.hive.metastore.HiveMetaException: Schema initialization FAILED! Metastore state would be inconsistent !! Notice: /Stage[main]/Hadoop_hive::Init_metastore_schema/Exec[init hive-metastore schema]/returns: at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:586) Notice: /Stage[main]/Hadoop_hive::Init_metastore_schema/Exec[init hive-metastore schema]/returns: ... 8 more Notice: /Stage[main]/Hadoop_hive::Init_metastore_schema/Exec[init hive-metastore schema]/returns: *** schemaTool failed ***

是否有解决办法无需手动删除已配置的外部Metastore中已创建的索引PCS_STATS_IDX?

回答

0

这也是我在EMR集群的RDS实例上使用外部配置单元Metastore数据库观察到的结果。它看起来好像AWS对于任何emr-5 +版本都有很好的解决方法 - 它就好像它应该能够在已经创建的Metastore模式时跳过这些init配置单元的metastore脚本。解决此问题的一种可能方法是让EMR启动自己的hive本地Metastore(因此启动EMR群集而不更改初始hive-site.xml),并且在群集启动后,运行EMR步骤,停止蜂房-server2上sudo stop hive-server2,修改/etc/hive/conf/hive-site.xml通过插入这些属性以指向蜂房Metastore在外部RDS实例:

 <property> 
     <name>javax.jdo.option.ConnectionUserName</name> 
     <value>username</value> 
     </property> 

     <property> 
     <name>javax.jdo.option.ConnectionPassword</name> 
     <value>password</value> 
     </property> 

     <property> 
     <name>javax.jdo.option.ConnectionURL</name> 
     <value>jdbc:mysql://<rds instance connection string>:3306/db_name?createIfNotExist=true</value> 
     </property> 

并重新启动蜂房-server2中(sudo start hive-server2)。

0

这可能是因为您的Hive分发版本和Metastore模式版本不同。 使用@ [凯尔迈尔]的方式来启动你的emr并执行以下命令来检查版本: schematool -dbType dbType -info 如果它们不匹配使用schematool从2.1.0升级到2.3.0: schematool -dbType mysql -initSchemaTo 2.3.0

这会给你现在遇到的错误。要解决这个问题,请使用任何客户端(如SQL Workbench)连接到您的数据库。它将主要给你错误,如“table_name /索引已经存在”。 使用sql客户端删除这些表/索引。但是你必须一起删除这些表/索引。所以你将不得不删除表格,然后执行命令。如果它再次给出其他表/索引的错误,则必须删除之前的表以及错误中的当前表。这将需要时间,但您可以升级架构。