2017-10-18 60 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客戶端刪除這些表/索引。但是你必須一起刪除這些表/索引。所以你將不得不刪除表格,然後執行命令。如果它再次給出其他表/索引的錯誤,則必須刪除之前的表以及錯誤中的當前表。這將需要時間,但您可以升級架構。