Skip to main content

Buildout recipe for downloading and installing a mongodb binary package.

Credits

Thanks to Andreas Jung for provinding a patch to symlink all MongoDB binaries.

Thanks to Stephan Hofmockel who contributed a patch for creating a start script with custom command line parameters specified as buildout options.

A brief documentation

This recipe takes a number of options:

darwin-32bit-url

The URL to download the 32 bit binary package for the darwin platform.

darwin-64bit-url

The URL to download the 64 bit binary package for the darwin platform.

linux2-32bit-url

The URL to download the 32 bit binary package for the linux platform.

linux2-64bit-url

The URL to download the 64 bit binary package for the linux platform.

(And all options of mongod version v1.4.2 as described below.)

Tests

We will define a buildout template used by the recipe:

>>> buildout_cfg = """
... [buildout]
... parts = mongodb
...
... [mongodb]
... recipe = rod.recipe.mongodb
... darwin-32bit-url = http://downloads.mongodb.org/osx/mongodb-osx-i386-1.4.1.tgz
... darwin-64bit-url = http://downloads.mongodb.org/osx/mongodb-osx-x86_64-1.4.1.tgz
... linux2-32bit-url = http://downloads.mongodb.org/linux/mongodb-linux-i686-1.4.1.tgz
... linux2-64bit-url = http://downloads.mongodb.org/linux/mongodb-linux-x86_64-1.4.1.tgz
... """

We’ll start by creating a buildout:

>>> import os.path
>>> write('buildout.cfg', buildout_cfg)

Running the buildout gives us:

>>> output = system(buildout)
>>> 'rod.recipe.mongodb: downloading mongoDB distribution...' in output
True

Check whether the binaries are copied:

>>> set(os.listdir('bin')).issuperset(['mongo', 'mongod', 'mongodump', 'mongoexport', 'mongofiles', 'mongoimport', 'mongorestore', 'mongos', 'mongosniff', 'mongostat'])
True

A start script with the format ‘start_PART-NAME_mongod.sh’ should be generated.

>>> 'start_mongodb_mongod.sh' in os.listdir('bin')
True

It is possible to change the name of this start script with the ‘script_name’ option. Furthermore all options of mongod (version v1.4.2) are supported via buildout options. A more comprehensive recipe could be for example:

>>> buildout_cfg = """
... [buildout]
... parts = mongodb
... [mongodb]
... recipe = rod.recipe.mongodb
... linux2-32bit-url = http://downloads.mongodb.org/linux/mongodb-linux-i686-1.4.2.tgz
... script_name = start_master.sh
... quiet=true
... fork=true
... logpath=${buildout:parts-directory}/mongodb/log
... dbpath=${buildout:parts-directory}/mongodb/data
... directoryperdb=true
... master=true
... """

Changes

1.2.0 2010-05-16

  • Creating start script with command line parameters specified as buildout options.

1.1.4 2010-04-18

  • Symlinking rather than copying binaries.

1.1.0 2010-04-15

  • Copying all MongoDB binaries into the ‘bin’ folder of the buildout environment (ajung).

1.0.1 2009-08-21

  • Removing part before updating.

1.0.0 2009-08-14

  • Initial release.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rod.recipe.mongodb-1.2.0.tar.gz (10.1 kB view details)

Uploaded Source

File details

Details for the file rod.recipe.mongodb-1.2.0.tar.gz.

File metadata

File hashes

Hashes for rod.recipe.mongodb-1.2.0.tar.gz
Algorithm Hash digest
SHA256 70581968ccded76dc1f91e855bee11c91a3421aa378b2b1d52efa09faeed03be
MD5 275570a6288877987807ad7f3630bac1
BLAKE2b-256 24127713292b3b30fae4cfd234678b3841f9b1c29b72f5b0b68eed5a71a844cd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page