aws-如何通过配置文件将多个postgresql连接器添加到EMR

And*_*ldo 6 postgresql amazon-web-services amazon-emr emr

要在AWS EMR中的presto中添加一个 postgresql连接器,可以使用下面的配置文件来实现。

[
    {
        "Classification": "presto-connector-postgresql",
        "Properties": {
            "connection-url": "jdbc:postgresql://<host>:<port>/<database>",
            "connection-user": "<user>",
            "connection-password": "<password>"
        },
        "Configurations": []
    }
]
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试将一个项目简单地添加到配置文件中时,如下所示:

[
    {
        "Classification": "presto-connector-postgresql",
        "Properties": {
            "connection-url": "jdbc:postgresql://<host>:<port>/<database>",
            "connection-user": "<user>",
            "connection-password": "<password>"
        },
        "Configurations": []
    },
    {
        "Classification": "presto-connector-postgresql",
        "Properties": {
            "connection-url": "jdbc:postgresql://<host>:<port>/<another-database>",
            "connection-user": "<user>",
            "connection-password": "<password>"
        },
        "Configurations": []
    }

]
Run Code Online (Sandbox Code Playgroud)

Terraform抱怨: Classification 'presto-connector-postgresql' was specified multiple times.

这可以通过在/ etc / presto / conf / catalog文件夹下的database.properties文件中手动添加每个数据库来实现。

database.properties

connector.name=postgresql
connection-password = <password>
connection-url = jdbc:postgresql://<host>:<port>/<database>
connection-user = <user>
Run Code Online (Sandbox Code Playgroud)

another-database.properties

connector.name=postgresql
connection-password = <password>
connection-url = jdbc:postgresql://<host>:<port>/<another-database>
connection-user = <user>
Run Code Online (Sandbox Code Playgroud)

只是想知道是否有一种方法可以通过EMR配置实现相同的目标。