Sign inSign up

phenompeople/mongodb

By phenompeople

Updated about 7 years ago

MongoDB is an open-source, document database designed for ease of development and scaling.

Image
0

1M+

phenompeople/mongodb repository overview

Docker Automated build Docker Build Status Docker Pulls License

mongodb

MongoDB is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas

phenompeople/mongodb
Pre-Requisites
How to use this image
  1. This image can be used by simply running

$ docker run --name=mongodb -p 27017:27017 -td phenompeople/mongodb

Above command runs mongodb container with port 27017 mapped to host and connecting to local mongodb.conf.

  1. To make image run even after reboot use extra option --restart=always

$ docker run --restart=always --name=mongodb -p 27017:27017 -td phenompeople/mongodb

Note:

  • If you remove the container all your data and configurations will be lost, and the next time you run the image the database will be reinitialized.
  • MongoDB adds a user and group, mongodb, that runs the process and owns the associated files such as logs in /var/log/mongodb and database files in /var/lib/mongodb
  • You will need to add a user and group, for your new daemon user, as well as chown'ing the files to your new user and group. Linux understand users by IDs not by names, hence create a local user and group mongod with uid 401
  1. To avoid this loss of data, you should mount a volume that will persist even after the container is removed. If you are using default configuration file mount the volume to /var/lib/mongo

$ docker run --restart=always --name=mongodb -p 27017:27017 -v /data:/var/lib/mongo -td phenompeople/mongodb

MongoDB’s official guide on deploying to production recommends using the XFS file system on Linux, especially when deploying the WiredTiger storage engine.

  • XFS is a highly scalable, high-performance 64-bit journaling file system developed at SGI in 1993 and ported to Linux in 2002.
  • Parallelized access via allocation groups ensures multiple threads can perform I/O simultaneously on the same volume.
  • Extent based allocation reduces fragmentation, metadata size, and improves I/O performance by allowing fewer and larger I/O operations.
  • Delayed allocation improves data contiguity and performance.
  • Fragmentation is reduced by combining writes and allocating extents in large chunks, and files written randomly (such as those that are memory mapped) can be allocated contiguously
  1. On your system, use yum to install the xfsprogs and xfsdump packages:

yum install xfsprogs xfsdu

  1. To avoid this loss of data, you should mount a volume that will persist even after the container is removed. If you are using default configuration mount the volume to /var/lib/mongo

$ docker run --restart=always --name=mongodb -p 27017:27017 -v /data:/var/lib/mongo -td phenompeople/mongodb

Maintainers

License and Authors

License: Apache License

Author : Phenompeople Pvt Ltd ([email protected])

Tag summary

Content type

Image

Digest

Size

328 MB

Last updated

about 7 years ago

docker pull phenompeople/mongodb