Comments (3)
How long does the backup take approximately?
Why do you have a BACKUP_CMD
variable, if you just execute it one line later once?
Wouldn't it be easier to just execute the command directly without the variable?
I'd suggest cleanly stopping the docker container for a short moment (so that the database files on the filesystem are in a consistent state), creating a snapshot of the filesystem, start the docker container again so that the server is running, backup the database files from the snapshot, and then removing the snapshot.
That way the downtime is very short (there is some extra space needed for the snapshot, to track all file changes between the creation and deletion of the snapshot - unless you are doing an osm2pgsql append at the same time, that shouldn't grow too big).
There are probably some compression algorithms that benefit from multithreading.
Usually, I try to avoid compression when dealing with backups (storage is cheap), but rather have exact mirrors (plural) and compress only the transfer of them to different machines (validated via checksums).
That way the contents can be compared and verified fast (without decompressing), only the changes need to be transferred, and data corruption only has an local effect to the data and doesn't render the whole backup corrupt.
(Modern compression formats usually (can) save redundant recovery data (error correction codes), to lower the risk of corrupting the whole compressed file due to a few errors (gzip
, used by tar -z
does not!) - but for backups I find this too risky to rely on, unless you can tune the percentage of that redundancy to your own liking e.g. to 20-50% or more (some tools/algorithms offer that option)).
Edit: PostgreSQL: Documentation: 10: Chapter 25. Backup and Restore
from openstreetmap-tile-server.
How long does the backup take approximately?
around 20 hours. Thats faster than a import of planet but to slow for backup process ..
Why do you have a
BACKUP_CMD
variable, if you just execute it one line later once?
Wouldn't it be easier to just execute the command directly without the variable?
yes, its just a copy from another (more complex) script and I forgot to adapt it ...
I'd suggest cleanly stopping the docker container for a short moment (so that the database files on the filesystem are in a consistent state), creating a snapshot of the filesystem, start the docker container again so that the server is running, backup the database files from the snapshot, and then removing the snapshot.
I did not found a snapshot function for docker volumes. Can you provide me with details?
There are probably some compression algorithms that benefit from multithreading.
Thanks for hint. I found this article with some benchmarks.
https://www.peterdavehello.org/2015/02/use-multi-threads-to-compress-files-when-taring-something/
Edit: PostgreSQL: Documentation: 10: Chapter 25. Backup and Restore
I think thats a good approach for database content and allows backup on running container. It would allow to reuse a existing docker container solution - e.g. https://hub.docker.com/r/prodrigestivill/postgres-backup-local
from openstreetmap-tile-server.
I did not found a snapshot function for docker volumes. Can you provide me with details?
Snapshots are not a function of docker, but might be offered by your underlying volume manager (LVM) or file system (e.g. Btrfs, NSS, NTFS) on your host.
from openstreetmap-tile-server.
Related Issues (20)
- Resource wise, what exactly is more important during the data import phase Disks, RAM or CPU? HOT 1
- How to upload to external database Postgres HOT 4
- How can I instruct the container to only generate the tiles and don't import any POI data into the DB? If possible. HOT 5
- During the data import, will it be possible to create the indexes in parallel rather than sequencially? HOT 1
- hangs on startup HOT 3
- Segmentation fault during import HOT 5
- Run container over proxy with UPDATES=ENABLED parameter
- running server If I run the server, does it automatically render for all the files?
- Import command fails for OSM data
- Data/Labels not shown up on maps HOT 1
- How do I force latin names for countries like Greece or China? HOT 6
- Postgis Plugin: ERROR: could not resize shared memory segment "/PostgreSQL.2682777122" to 50438144 bytes: No space left on device HOT 1
- To optimise the rendering HOT 1
- Import not completing HOT 7
- Search filed?
- Postgres in container not working HOT 2
- Tile fetching behind reverse proxy HOT 1
- Postgres says rendrer user already exsists
- Error downloading tile file : i/0 time out HOT 3
- til-server automatic update: how to do? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openstreetmap-tile-server.