Giter Site home page Giter Site logo

mongosback's Introduction

mongosback 0.91

mongosback is a mongodb backup script created to be easy to use yet flexible, used in production at Wildbit.com

Installation

Clone or download as zip from github, extract to directory. Set the main script as executable (chmod u+x mongosback.sh). Edit mongosback.conf with desired settings and execute from cron.

Upon running, you may provide the path to mongosback.conf by executing with "-f". Example:

./mongosback.sh -f /etc/mongosback.conf

Compatibility

Tested: Debian, CentOS, RHEL

Amazon S3

To use S3 backup, you'll need to install and configure the s3cmd tool:

  • sudo apt-get install s3cmd
  • s3cmd --configure Then add your bucket name and path to the .conf file.

Troubles? Detailed steps can be found here: link

Functionality
  • Archiving
    • keep several backups on-hand, delete after X days.
  • Performance throttling
    • mongodb can be quite resource intensive (IO in particular).
    • three performance throttles (low, normal, high).
    • reduces IO and CPU utilization, useful for backups on master mongo server.
  • Compression
    • perform gzip compression on backups, reducing space utilization.
    • tunable compression levels (fast, normal, best).
  • Simple backup
    • optional simple backup method to bypass compression, archiving and exporting.
      
    • useful if simple dumps are needed with performance throttling and erorr handling.
  • Exporting
    • automatically transfer latest backup to remote FTP or using SCP.
  • Logging
    • logging of all events to log file and optionally syslog.
    • debug mode, copies all mongodump output to debug file to determine failures.
    • calculates total run time and dump size to understand data growth impact.
  • E-mail notifications
    • get updated on successful or failed backup attempts.
    • includes run time and dump size, on-hand archives and target disk utilization.
  • Write locking
    • option to enable write locking on replicaSet slaves.
    • locks writes, performs backup, unlock writes (slave nodes only).
    • helps ensure a consistent state (also consider: --oplog option)
  • Configurability
    • changeable backup path
    • ability to set mongodump runtime options.
    • many others in configuration file.
  • General
    • creates pid file to prevent multiple startups.
    • traps errors caught, logs and optionally e-mails.
    • can be run as non root user
Note on mongoDB rights if using auth

User roles need to contain userAdmin because mongodump backup db.system.users. For now, there is no option to tell mongodump not backuping this users collection. Update: For MongoDB 2.6, user needs to have the backup and hostManager (for clusters) roles

license

GPL v3

contact

Russ Thompson (russ a@t linux.com). actively maintained, please submit issues or suggestions.

mongosback's People

Contributors

vigeek avatar jfbradfo avatar pascoual avatar

Watchers

Thanh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.