用于emr的外部配置单元元存储

yrdbyhpb  于 2021-05-29  发布在  Hadoop
关注(0)|答案(2)|浏览(248)

我正在创建一个带有默认配置单元元存储的emr集群,然后我用一些属性覆盖hive-site.xml,这些属性将aws rds示例指向配置单元元存储,一切正常,但是在重新启动配置单元服务器之后,我无法将rds用作配置单元元存储。它仍在使用emr创建的默认配置单元元存储。

hzbexzde

hzbexzde1#

通过在创建集群时为应用程序提供配置对象,可以覆盖应用程序的默认配置。配置对象作为json文件引用。配置对象由分类、属性和可选的嵌套配置组成。属性是要在该文件中更改的设置。您可以在一个json对象中为多个应用程序指定多个分类。
要使用外部mysql元存储信息覆盖hive-site.xml,请创建一个名为hiveconfiguration.json的配置文件,其中包含对hive-site.xml的编辑:

[
    {
      "Classification": "hive-site",
      "Properties": {
        "javax.jdo.option.ConnectionURL": "jdbc:mysql:\/\/hostname:3306\/hive?createDatabaseIfNotExist=true",
        "javax.jdo.option.ConnectionDriverName": "org.mariadb.jdbc.Driver",
        "javax.jdo.option.ConnectionUserName": "username",
        "javax.jdo.option.ConnectionPassword": "password"
      }
    }
]

使用hiveconfiguration.json和以下aws cli命令创建集群:

aws emr create-cluster --release-label emr-5.11.0 --instance-type m3.xlarge --instance-count 2 \
--applications Name=Hive --configurations ./hiveConfiguration.json --use-default-roles

参考文献:
https://docs.aws.amazon.com/emr/latest/releaseguide/emr-hive-metastore-external.html

tzxcd3kk

tzxcd3kk2#

为什么要重新启动hive-server2?如果要更改hive.metastore.*等属性,则需要重新启动hive metastore守护程序,而emr上的守护程序是hcatalog的一部分。实际上,您甚至不需要重新启动任何东西来更新metastore db。您可以运行offline schematool-initschema来指向新的数据库。看到了吗https://cwiki.apache.org/confluence/display/hive/hive+schema+tool

相关问题