stefanprodan / mgob

MongoDB dockerized backup agent. Runs schedule backups with retention, S3 & SFTP upload, notifications, instrumentation with Prometheus and more.
MIT License
769 stars 152 forks source link

backup plan not starting #156

Closed janu8ry closed 2 years ago

janu8ry commented 2 years ago

mgob.yml

target:
  host: "mongo"
  port: 27017
  database: "mydb"
  username: "admin"
  password: "secret"
  params: "--authenticationDatabase admin"
scheduler:
  cron: "0 0,12,18,24 */1 * *"
  retention: 20
  timeout: 60

docker-compose.yml

version: "3.9"

services:
  mongo:
    image: mongo:4.4.14-focal
    restart: always
    container_name: "mongo"
    ports:
      - "27017:27017"
    volumes:
      -  /data/db:/data/db
    environment:
      - MONGO_INITDB_ROOT_USERNAME_FILE=/run/secrets/mongo_username
      - MONGO_INITDB_ROOT_PASSWORD_FILE=/run/secrets/mongo_password
    command: mongod --quiet
    secrets:
      - mongo_username
      - mongo_password
  mgob:
    image: mgob:latest
    restart: always
    container_name: "mgob"
    ports:
      - "8090:8090"
    volumes:
      - ./mgob.yml:/config/mgob.yml
      - ./backup:/storage

secrets:
  mongo_username:
    file: mongo_username.txt
  mongo_password:
    file: mongo_password.txt

time="~~~" level=info msg="Next tmp cleanup run at ~~~ message is not showing after start, and localhost:8090/status is empty and returns [].
It worked properly before i added auth. However if i enter mgob container shell with docker exec and execute the command below, it worked
mongodump -h mongo:27017 --db mydb -u 'admin' -p 'secret' --authenticationDatabase admin