Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Use PGDATA instead of POSTGRES_PGDATA #2435

Open
srajappa opened this issue Nov 4, 2019 · 1 comment
Open

Use PGDATA instead of POSTGRES_PGDATA #2435

srajappa opened this issue Nov 4, 2019 · 1 comment

Comments

@srajappa
Copy link

srajappa commented Nov 4, 2019

I am using Postgres in the DC/OS cluster and after a an unexpected restart for Postgres, I noticed all the "unique" data which I thought was persisted vanished.

I am adding the corresponding marathon file below:

{
    "id": "postgresql",
    "cmd": null,
    "cpus": 1,
    "mem": 1024,
    "disk": 0,
    "instances": 1,
    "acceptedResourceRoles": ["*"],
    "container": {
      "type": "DOCKER",
      "docker": {
        "forcePullImage": false,
        "image": "postgres:9.6",
        "parameters": [],
        "privileged": false
      },
      "volumes": [
        {
          "containerPath": "var",
          "persistent": {
            "type": "root",
            "size": 512,
            "constraints": []
          },
          "mode": "RW"
        }
      ],
      "portMappings": [
        {
          "containerPort": 5432,
          "hostPort": 0,
          "labels": {
            "VIP_0": "/postgresql:5432"
          },
          "name": "postgresql",
          "protocol": "tcp",
          "servicePort": 10024
        }
      ]
    },
    "env": {
      "POSTGRES_USER": "admin",
      "POSTGRES_PGDATA": "pgdata",
      "POSTGRES_DB": "defaultdb",
      "POSTGRES_INITDB_ARGS": "",
      "POSTGRES_PASSWORD": "password"
    },
    "healthChecks": [
      {
        "gracePeriodSeconds": 300,
        "intervalSeconds": 60,
        "maxConsecutiveFailures": 3,
        "portIndex": 0,
        "protocol": "TCP",
        "ipProtocol": "IPv4",
        "timeoutSeconds": 20,
        "delaySeconds": 15
      }
    ],
    "labels": {
      "DCOS_PACKAGE_OPTIONS": "eyJzZXJ2aWNlIjp7Im5hbWUiOiJwb3N0Z3Jlc3FsIn0sInBvc3RncmVzcWwiOnsiY3B1cyI6MSwibWVtIjoxMDI0fSwiZGF0YWJhc2UiOnsidXNlcm5hbWUiOiJhZG1pbiIsInBhc3N3b3JkIjoicGFzc3dvcmQiLCJkYm5hbWU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BlcVZrU2xRa0JBbTVralVoZjBxV2NjL2JrTWhYUTA1T3hSVElET3VvZkJUcVlvUEVCS1RXQUJUbUtsY2xxYncwNVZqNlh4RmtXeXBPam1va3JYM3N1NmZqRThEeExBeHVQUEQ4aCtlQ0dJK3Ewekd5MTUwSHhtZXJPOE5qYkNZTGVWd2d0M2lhWXNjRVZXckk4UWo3SVpRQ2lyWGkvZnRnU1cwOFNCS2MyZGdrVDlLODkvSVpLY1hsTkQrclVnTXZGRmpFTWJDVFEyYUloWU5GRFkvNm1NQWw4Y2JXWkdzeHVVdVNNRC9YVHp2eVFuSXdLM05PNlAramxTSXU3ajkreVQzSTRYVEdoN1lobVVNZDc5Nko0Qm1QYy92UElDUXFGNTV1RjB3SUpmaGZuYzFNaWxoNnJJN0xWNERzd2FSWE0rdlhLcVpXdVM5dzRGWGtQY2xQYm1BeWR1Szh0TVlmSjVCc2RjOGNaTkczT3VOS3F0b1NoZmphR2tyQisxTjVrQ1hCVkZNRnVFeHpzTzJFNWZqaE5RWUplL29DOVVxZU9UbGg4KzdpcTRZZm4rYko0THMvK1pRNWwxTklqNEtsTmM5VlI3d3dsQ01YaWtJUSs4a1cvdStXSUpsSEVINWRIb1pDV3V3RE9kSDRjQ1RMand4SU5oSXJFa1N1aS9PeTZ2NGQvSDZjcDIzN3VTSjU1ZnlQY1BrNE1XVlBQT0czRVdMb0hBa1F2RWJ0c3VSMkdzNjRnTzRtWjM5Ly9RLzNpY21rU2kwQUFBPT0ifQ==",
      "DCOS_PACKAGE_VERSION": "9.6-0.2",
      "DCOS_PACKAGE_NAME": "postgresql",
      "MARATHON_SINGLE_INSTANCE_APP": "true",
      "DCOS_PACKAGE_IS_FRAMEWORK": "false"
    },
    "networks": [
      {
        "mode": "container/bridge"
      }
    ],
    "portDefinitions": [],
    "maxLaunchDelaySeconds": 300,
    "upgradeStrategy": {
      "maximumOverCapacity": 0,
      "minimumHealthCapacity": 0
    }
  }

After digging it was found out that one of the env variables i.e. POSTGRES_PGDATA is not recognized by our Postgres Docker container. If we removed and added the key PGDATA and provided a mount path, the persistence works in full swing.

@rishabh96b
Copy link
Contributor

Thanks for creating this issue @srajappa ! If this is still relevant to you, please feel free to create a PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants