白水湖数据库备份

animeic d086cbaf1b update 1 year ago
config d086cbaf1b update 1 year ago
format-backup-file 6a15ae76ef update 1 year ago
docker-compose.yaml 6a15ae76ef update 1 year ago
readme.md 6a15ae76ef update 1 year ago

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