尝试将配置单元从2.1.0升级到2.3.0时出现以下错误(实际将emr 5.7.0升级到5.8.0)
init hive-metastore schema]/returns: 0: jdbc:mysql://connection_string-> CREATE INDEX PCS_STATS_IDX ON PART_COL_STATS (DB_NAME,TABLE_NAME,COLUMN_NAME,PARTITION_NAME) USING BTREE 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 ***
是否有一种方法可以在不手动删除已在配置单元外部转移存储中创建的索引PCS_STATS_IDX的情况下解决此问题?
发布于 2017-10-20 00:41:12
这也是我在EMR集群的RDS实例上的外部配置单元metastore数据库中观察到的。对于任何emr-5+版本,AWS似乎都没有很好的解决办法-如果已经创建了元存储模式,它几乎应该能够跳过这些初始化配置单元-元存储脚本。解决此问题的一种可能方法是让EMR启动自己的配置单元本地元存储(因此,在不更改初始hive -site.xml的情况下启动EMR集群),在集群启动后,运行一个EMR步骤,停止Hive -server2rds,通过插入以下属性来修改/etc/hive/conf/hive-site.xml以将配置单元元存储指向外部sudo stop hive-server2实例:
<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>并重新启动hive-server2 (sudo start hive-server2)。
发布于 2018-02-03 06:59:01
这可能是因为您的配置单元分发版本和元存储架构版本不同。使用@Kyle Meyer的方式启动您的电子病历,并执行以下命令检查版本: schematool -dbType dbType -info如果版本不匹配,请使用schematool从2.1.0升级到2.3.0: schematool -dbType mysql -initSchemaTo 2.3.0
这将给你带来你现在所面临的错误。要解决此问题,请使用任何客户端(如SQL Workbench )连接到数据库。大多数情况下,它会给出类似"table_name/Indexes已存在“这样的错误。使用sql client删除这些表/索引。但您必须将这些表/索引一起删除。因此,您必须删除该表,然后执行该命令。如果它再次给出其他表/索引的错误,您将不得不删除错误中的先前表和当前表。这将需要时间,但您将能够升级架构。
发布于 2021-12-24 10:58:03
mysql> drop database IF EXISTS metastore;hive-site.xml
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost/metastore?createDatabaseIfNotExist=true&useSSL=false</value>删除metastore DB解决了我的问题
https://stackoverflow.com/questions/46808012
复制相似问题