【问题标题】:how to add postgres-configuration into cordas build gradle deployNodes-task如何将 postgres 配置添加到 cordas build gradle deployNodes-task
【发布时间】:2019-09-12 09:27:30
【问题描述】:

我想在 build-gradle 任务 deployNodes 中将默认 h2 数据库的配置替换为 postgres 实现

我想替换条目h2Port 10013

dataSourceProperties: {
    dataSourceClassName: "org.postgresql.ds.PGSimpleDataSource",
    dataSource.url: "jdbc:postgresql://localhost:5432/postgres_xyz?currentSchema=public",
    dataSource.user: "xyz",
    dataSource.password: "xyz",
    dataSource.currentSchema: "public"
}
database: {
    transactionIsolationLevel: "READ_COMMITTED"
}

我该怎么做/我可以使用哪种格式?

【问题讨论】:

    标签: postgresql gradle corda


    【解决方案1】:

    您可以使用extraConfig=[ ... ] 块在build.gradle 脚本中将Postgresql DB 属性添加到您的节点配置中,如下所示。

    node {
    
        ...
    
        extraConfig = [
            dataSourceProperties: [
                    dataSourceClassName : "org.postgresql.ds.PGSimpleDataSource",
                    'dataSource.url' : "jdbc:postgresql://localhost:5432/nodedb",
                    'dataSource.user' : "postgres",
                    'dataSource.password' : "pa$$w0rd"
            ],
            database: [
                    transactionIsolationLevel : "READ_COMMITTED"
            ]
        ]
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-05
      • 2013-07-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多