mongodb备份服务

animeic d94b55cf45 clear & add baishuihu vor 1 Jahr
config d94b55cf45 clear & add baishuihu vor 1 Jahr
format-backup-file d94b55cf45 clear & add baishuihu vor 1 Jahr
docker-compose.yaml 1030ed66b5 change backup dir vor 2 Jahren
readme.md 2819945ff6 update readme.md vor 2 Jahren

readme.md

数据库备份

文档:https://github.com/stefanprodan/mgob

使用

  1. 在config/添加配置 config/3dshow.yaml
  2. 启动服务:docker-compose up -d

webapi

mgob-host:8090/storage file server
mgob-host:8090/status backup jobs status
mgob-host:8090/metrics Prometheus endpoint
mgob-host:8090/version mgob version and runtime info
mgob-host:8090/debug pprof endpoint

恢复数据

  1. 进入容器 docker exec -it mongo-backup sh
  2. 恢复命令 mongorestore --gzip --archive=/storage/local-3dshow/local-3dshow1-1668757800.gz --host 3dshow-mongo:27017 --drop -u root -p 3dshow --authenticationDatabase admin

格式化备份文件

cd ./format-backup-file

go build -o format-backup-file

chmod +x format-backup-file

sh format-backup-file