为什么在 jps 中使用 postgres9 时 Jelastic 环境不起作用?

Why Jelastic environment not working when using postgres9 in jps?

我已经使用文档 https://docs.jelastic.com/application-manifest 创建了一个 jps 文件。

但是没有明确的文档来使用 PostgreSQL。

Jelastic JPS 节点:

{
    "nodeType": "postgres9",
    "restart": false,
    "database": {
        "name": "xxxx",
        "user": "xxx",
        "dump": "xxx.sql"
    }
}

配置环境时出错,

"data": {
    "result": 11005,
    "source": "marketplace",
    "error": "database query error: java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=10.101.3.225)(port=3306)(type=master) : Connection refused (Connection refused)"
}

我在这里提供了完整的 JPS 文件内容。在此,我在导入数据库时​​出错,而其他人在配置对象中工作正常。

{
    "jpsVersion": "0.1",
    "jpsType": "install",
    "application": {
        "id": "xxx",
        "name": "xxx",
        "version": "0.0.1",
        "logo": "http://example.com/img/logo.png",
        "type": "php",
        "homepage": "http://example.com/",
        "description": {
            "en": "xxx"
        },
        "env": {
            "topology": {
                "ha": false,
                "engine": "php7.2",
                "ssl": false,
                "nodes": [
                    {
                        "extip": false,
                        "count": 1,
                        "cloudlets": 16,
                        "nodeType": "nginxphp"
                    },
                    {
                        "extip": false,
                        "count": 1,
                        "cloudlets": 16,
                        "nodeType": "postgres9"
                    }
                ]
            },
            "upload": [
                {
                   "nodeType": "nginxphp",
                   "sourcePath": "https://example.com/xxx.conf",
                   "destPath": "${SERVER_CONF_D}/xxx.conf"
                }
            ],
            "deployments": [
                {
                    "archive": "https://example.com/xxx.zip",
                    "name": "xxx.zip",
                    "context": "ROOT"
                }
            ],
            "configs": [
                {
                    "nodeType": "nginxphp",
                    "restart": true,
                    "path": "${SERVER_CONF_D}/xxx.conf",
                    "replacements": [
                        {
                           "pattern":"/usr/share/nginx/html",
                           "replacement":"${SERVER_WEBROOT}"
                        }
                    ]
                },
                {
                    "nodeType": "postgres9",
                    "restart": false,
                    "database": {
                        "name": "xxx",
                        "user": "xxx",
                        "dump": "https://example.com/xxx.sql"
                    }
                }, {
                    "restart": false,
                    "nodeType": "nginxphp",
                    "path": "${SERVER_WEBROOT}/ROOT/server/php/config.inc.php",
                    "replacements": [{
                            "replacement": "${nodes.postgres9.address}",
                            "pattern": "localhost"
                        }, {
                            "replacement": "${nodes.postgres9.database.password}",
                            "pattern": "xxx"
                        }
                    ]
                }
            ]
        },
        "success": {
            "text": "Installation completed. username: admin and password: xxx"
        }
    }
}

由于到目前为止 (The action is executed only for mysql5, mariadb, and mariadb10 containers) Postgres 的操作被禁用,我们已经根据最近的更新改进了您的清单。使用yaml是因为它更便于阅读和理解:

jpsVersion: 0.1
jpsType: install
name: xxx
version: 0.0.1
logo: http://example.com/img/logo.png
engine: php7.2
nodes:
  - cloudlets: 16
    nodeType: nginxphp
  - cloudlets: 16
    nodeType: postgres9
onInstall:
  - upload [nginxphp]:
      sourcePath: https://example.com/xxx.conf
      destPath: ${SERVER_CONF_D}/xxx.conf
  - deploy:
      archive: https://example.com/xxx.zip
      name: xxx.zip
      context: ROOT
  - replaceInFile [nginxphp]:
      path: ${SERVER_CONF_D}/xxx.conf
      replacements:
      - pattern: /usr/share/nginx/html
        replacement: ${SERVER_WEBROOT}
  - restartNodes [nginxphp]
  - replaceInFile [nginxphp]:
      path: ${SERVER_WEBROOT}/ROOT/server/php/config.inc.php
      replacements:
      - pattern: localhost
        replacement: ${nodes.postgres9.address}
      - pattern: xxx
        replacement: ${nodes.postgres9.password}
  - cmd [postgres9]: printf "PGPASSWORD=${nodes.postgres9.password};\nexport PGPASSWORD;\npsql postgres webadmin -c \"CREATE DATABASE Jelastic;\"\n" > /tmp/createDb
  - cmd [postgres9]: chmod +x /tmp/createDb && /tmp/createDb
success: Installation completed. username admin and password xxx

请注意,您可以在 /console 选项卡中调试每个操作