Comments (6)
We currently host 3 DMBS:
- MariaDB
- PostgreSQL
- MongoDB
The first solution is to add and host single volumes, one for each system.
Another solution could be to use a single volume and backup only that one. This could simplify the backup solution. However, it's important to note that when multiple containers access the same volume on a host, file locks must be managed by the applications running in the containers, otherwise there may be risks.
Exemple for a single, shared, volume:
services:
db_mysql:
image: mysql:latest
volumes:
- db_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: password
db_postgres:
image: postgres:latest
volumes:
- db_data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: password
volumes:
db_data:
Documentation for backing up data volumes
Another solution could be to use remote volume hosting (such as Amazon EBS) or to enhance volume management with volume plugins, some examples.
Just to recall something: data volumes can be initiated with backup through --volumes-from
option.
Another another solution could be to use the container backup.
Just letting everything sink in before chosing solution.
from teleporter-compose.
No I want that each DB is independant, and I don't want physical backup by logical IE dumps SQL, generated with mysqldump, pgdump, mongodump etc. Theses dumps sould be stocked in the local backup directory by default in the repository, with a mount bind. This directory should be customisable like the code dir.
from teleporter-compose.
So:
- One volume for each DBMS
- One backup container
- Local dir using a mount bind
- Backup local dir can be configured with
.env
- Using
mysqldump
,pg_dump
andmongodump
- Crontab
- The backup starts after each container startup. First check if a backup has been made recently
- A manual backup (by the student) can be made on request
- Backup retention : 1 week
- Keep the last 5 files if backups older than one week
- In the future could be use for drive sync
from teleporter-compose.
Crontab is uselessl, a backup at every start will do the job.
Name every backup with the day name will automate a 7 day retention, ex: monday-mysql.sql.gz, monday-pg.sql.gz, etc.
from teleporter-compose.
As we talked about, the current objective is to go fast and use simplicity before developing a better backup management system in the future.
The first introduction to the backup container is therefore on this PR #92
Backup container
- Always restart
- Make backup, sleep for 4 hours and restart
- One entrypoint script (called by command in the compose file) calling 3 scripts
- 3 scripts, one for each db system (yep could be only one with argument for each manual save or db choice, etc, we'll see in the future)
- Manual save can be call through
--save
argument :docker compose exec backup /scripts/backup-mongodb.sh --save
- Alias can be added in terminal container like
backup mysql
(not done yet)
- Alias can be added in terminal container like
- Script logic:
- Check if current day backup is already made, if yes do nothign
- If no, do the daily backup
- If asked, do the manual backup (different name than daily backup, no rotation here)
- Backup rotation (deleted with mtime +6d) for 1 week
- Install dependancies if needed (no custom image yet, first run is not that long)
from teleporter-compose.
Logic have been changed to :
- docker in docker (including dind image from docker)
- scripts directly call dump app though docker exec
from teleporter-compose.
Related Issues (20)
- [vscode web] test live share HOT 7
- Clean folder organization HOT 1
- Set fixed version of docker images HOT 1
- haproxy: restart only is cfg has changed HOT 1
- localhost binding HOT 2
- Alternative to terminal / vscode devcontainers HOT 3
- custom.env to locally update and continue to pull updates without lose customization
- List VPN user as services and not bookmarks HOT 1
- PaaS feature
- Create CHANGELOG.md
- Use human readable docker image versionning
- Interaction between TP and VSCode
- Multillanguage support
- Release 1.0.0
- Let's think about opening vpn-compose project
- Start a ROADMAP
- Release automation with release-please
- clean: remove old data dir refs
- disable vscode from web interface
- default port 3000 for sample
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 teleporter-compose.