Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

Files

Latest commit

1b56535 · Jun 8, 2019

History

History
64 lines (48 loc) · 2.42 KB

README.md

File metadata and controls

64 lines (48 loc) · 2.42 KB

mongodb-simple-backup

This program dumps all databases of mongodb using mongodump command, and upload them to Azure Blob Storage.

TravisCI Status Docker image size

Requirement

python 3.6 or higer

Environment Variables

This application accepts the Environment Variables like below:

Environment Variable Summary Mandatory Default
MONGODB_ENDPOINT mongodb host yes
STORAGE_ACCOUNT the storage account of azure storage yes
ACCOUNT_KEY account key of the storage acount yes
STORAGE_CONTAINER storage container name of azure blob storage yes
LOG_LEVEL log level(DEBUG, INFO, WARNING, ERRRO, CRITICAL) no INFO
TIMEZONE timezone used when naming dump file no Asia/Tokyo
DUMPFILE_PREFIX dumpfile prefix no mongodb_
STORE_OPLOG if True, oplog will be backed up no False

how to set MONGODB_ENDPOINT

non cluster

When you use a single mongodb, you have to set the MONGODB_ENDPOINT as <hostname>:<port> like below:

mongodb:27017

cluster

When you use mongodb cluster, you have to set the MONGODB_ENDPOINT as <replSet>/<hostname1>:<port1>,<hostname2>:<port2>,... like below:

rs0/mongodb-0.mongodb:27017,mongodb-1.mongodb:27017,mongodb-2.mongodb:27017

Run as Docker container

  1. Pull container roboticbase/mongodb-simple-backup from DockerHub.

    $ docker pull roboticbase/mongodb-simple-backup:latest
  2. Run Container.

    • Set environment variables and start container
    $ export MONGODB_ENDPOINT="mongodb:27017"
    $ export STORAGE_ACCOUNT="mystrageaccount"
    $ export ACCOUNT_KEY="myaccountkey"
    $ export STORAGE_CONTAINER="mongodumpcontainer"
    $ docker run -it -p 3000:3000 roboticbase/fiware-cmd-proxy
    $ docker run -it -e MONGODB_ENDPOINT -e STORAGE_ACCOUNT -e ACCOUNT_KEY -e STORAGE_CONTAINER roboticbase/mongodb-simple-backup:latest

License

Apache License 2.0

Copyright

Copyright (c) 2019 TIS Inc.