DataPlane Platform Administration
Also available as:
PDF

Embedded database is lost due to docker storage and mounting issues

DSS configuration data is sometimes lost during a dpdeploy.sh restart or stop if you are using the embedded database for production purposes.

Due to issues with the Docker storage engine, conflicts with other processes can prevent the mounted storage under a docker container from being unmounted correctly. This can result in the loss of data in the embedded database.

To prevent this problem from occurring:

  1. Avoid using the embedded database for production purposes.
  2. Regularly backup and create a local copy of the embedded Postgres database to allow for graceful recovery.

To perform backup and recovery of the database:

  1. Back up the database.
    docker exec -u postgres dp-database pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
  2. Remove the docker container.
    docker rm -f dp-database 
  3. Remove the docker volume.
    docker volume rm postresql-data
  4. Start the database container.
    sh docker-database.sh
  5. Restore the database.
    cat <Name of the backup file.sql> | docker exec -i dp-database psql -U dp_admin -d dataplane