Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore postgres DB from backup #1402

Closed
sumanth2893 opened this issue Nov 12, 2021 · 1 comment
Closed

Restore postgres DB from backup #1402

sumanth2893 opened this issue Nov 12, 2021 · 1 comment

Comments

@sumanth2893
Copy link

sumanth2893 commented Nov 12, 2021

Describe the bug
I was running crunchydb postgres on Kubernetes, and I was backing up the underlying pgdata volume using a tool called velero.

I am trying to use the raw volume data to spin up a postgres locally on my machine so I can run a pgdump, however I am finding very difficult to start the postgres using the underlying pddata.

I am trying to use the docker image https://hub.docker.com/r/crunchydata/crunchy-postgres and i am using below docker-compose
and attach backup data in container.

version: "3.9"
services:
  postgres:
    image: crunchydata/crunchy-postgres:centos8-13.4-4.7.2
    environment: 
      PG_DATABASE: postgres
      PG_PRIMARY_PORT: 5432
      PG_MODE: primary
      MODE: postgres
      PG_USER: postgres
      PG_PASSWORD: postgres
      PG_PRIMARY_USER: postgres
      PG_PRIMARY_PASSWORD: postgres
      PG_ROOT_PASSWORD: postgres
      PGDATA_PATH_OVERRIDE: backup
      CRUNCHY_DEBUG: "TRUE"
    ports:
     - "5432:5432"
    volumes:
     - "./postgres:/pgdata/backup"

Output of this docker-compose

postgres container is not working

** log**

Thu Nov 11 15:48:53 UTC 2021 INFO: Image mode found: postgres
Thu Nov 11 15:48:53 UTC 2021 INFO: Starting in 'postgres' mode
Thu Nov 11 15:48:53 UTC 2021 INFO: Setting PGROOT to /usr/pgsql-13.
Thu Nov 11 15:48:53 UTC 2021 INFO: PG_CTL_START_TIMEOUT set at: 60
Thu Nov 11 15:48:53 UTC 2021 INFO: PG_CTL_STOP_TIMEOUT set at: 60
Thu Nov 11 15:48:53 UTC 2021 INFO: PG_CTL_PROMOTE_TIMEOUT set at: 60
Thu Nov 11 15:48:53 UTC 2021 INFO: Cleaning up the old postmaster.pid file..
Thu Nov 11 15:48:53 UTC 2021 INFO: User ID is set to uid=26(postgres) gid=26(postgres) groups=26(postgres).
Thu Nov 11 15:48:53 UTC 2021 INFO: Working on primary..
Thu Nov 11 15:48:53 UTC 2021 INFO: Initializing the primary database..
Thu Nov 11 15:48:53 UTC 2021 INFO: PGDATA already contains a database.
Thu Nov 11 15:48:53 UTC 2021 INFO: Setting ARCHIVE_MODE to off.
Thu Nov 11 15:48:53 UTC 2021 INFO: Setting ARCHIVE_TIMEOUT to 0.
Thu Nov 11 15:48:53 UTC 2021 INFO: Starting PostgreSQL..
2021-11-11 15:48:53.985 UTC [69] LOG:  pgaudit extension initialized
2021-11-11 15:48:53.986 UTC [69] WARNING:  pgnodemx: Kubernetes Downward API path /etc/podinfo does not exist: No such file or directory
2021-11-11 15:48:53.986 UTC [69] DETAIL:  disabling Kubernetes Downward API file system access
2021-11-11 15:48:53.996 UTC [69] LOG:  redirecting log output to logging collector process
2021-11-11 15:48:53.996 UTC [69] HINT:  Future log output will appear in directory "pg_log".
Thu Nov 11 15:48:54 UTC 2021 INFO: PostgreSQL is shutting down. Exiting..

what i am missing here ?

ref: #1400

@jkatz
Copy link
Contributor

jkatz commented Nov 12, 2021

A nearly identical situation is being discussed here: #1400 Please add your comments there. Thanks!

@jkatz jkatz closed this as completed Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants