geosolutions-it / geonode-generic

Generic Geonode-project based app, to be used with docker/rancher
https://waffle.io/geosolutions-it/geonode-generic
3 stars 6 forks source link

Implement restore procedure #34

Closed giohappy closed 6 years ago

giohappy commented 6 years ago

Currently geonode-generic includes scheduled backups (geosolutionsit/geonode-backup:latest image) but we need to implement a restore procedure for disaster recovery scenarios.

Assuming external volume has been configured for backups storage we need to have the following procedure implemented and tested:

  1. geonode-generic stack running with backups available
  2. stack gets corrupted / destroyed
  3. a new geonode-generic stack is create
  4. previous backups are restored -> new stack should be in the exactly the same state as the previous one (data, users, credentuals, etc.)

The goal is to have a recovery procedure that guarantees stack restoration in the worst scenario, that can be simulated restoring a stack in a brand new host.

For this task a new "geonode-restore" image should be defined. It will use the same configuration (env vars) fro Rancher / Docker as the other containers in the stack.

Recovery procedure steps:

  1. Create new stack without starting the containers
  2. Run the PostGIS container (for pg_restore)
  3. Run the geonode-restore container and wait its completion
  4. Run the other containers

For the moment this will be documented and executed manually. In the future an automated mechanis, under orchestration, will be implemented.

cezio commented 6 years ago

Fixed with https://github.com/geosolutions-it/geonode-restore-docker/pull/1

Restore proc described in https://github.com/cezio/geonode-restore-docker/blob/master/README.md

Image: https://hub.docker.com/r/geosolutionsit/geonode-restore/

Restore procedure tested with both catalog entries.

Note, that 1.0 of geonode-generic stack backup won't work with 1.1 restore (and vice versa). Also, 1.0 won't upgrade properly to 1.1 due to change in db name.