Launches Mongodb when OSX starts
Shell
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 7 commits ahead, 3 commits behind AndreiRailean:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Installing from HomeBrew
Installing from MacPorts
README.md

README.md

MongoDB Mac OS X Mountain Lion Launchctl Item

Forked from https://github.com/AndreiRailean/MongoDB-OSX-Launchctl

Configure MongoDB to start when Mac OSX system boots.

Mongo Installation

This guide assumes you've installed mongo using MacPorts like so:

sudo port install mongo

Mongo daemon location is assumed to be /opt/local/bin/mongod

If you download mongo directly, you need to copy all files inside the bin directory to /opt/local/bin as root. Once you do that, the rest of this guide will apply to you.

Create the DB directory and a log file:

sudo mkdir -p /opt/local/var/db/mongodb
sudo mkdir -p /opt/local/var/log/
sudo touch /opt/local/var/log/mongodb.log

Create a configuration file:

sudo mkdir -p /opt/local/etc/mongodb
sudo cp mongod.conf /opt/local/etc/mongodb/

More on configuration file: http://www.mongodb.org/display/DOCS/File+Based+Configuration

These locations were chosen because that is how most of the other stuff like mysql and redis gets installed.

Install/Reinstall Launchctl Item:

sudo cp org.mongo.mongod.plist /System/Library/LaunchDaemons/.
sudo chown root:wheel /System/Library/LaunchDaemons/org.mongo.mongod.plist
sudo launchctl load /System/Library/LaunchDaemons/org.mongo.mongod.plist
sudo launchctl start org.mongo.mongod`

Install Script

All of the above commands wrapped into an install script for convenience

./install.sh

This script is safe to run even if mongod is already installed

Configuration

If your paths are different, you'll need to manually change both the plist file and install script

Install from HomeBrew

brew install mongodb

Other Info

If you would prefer to install a mac StartupItem (instead of Launchctl item) use mongodb-mac-startup

Idea for this was borrowed from an article on "Cupcake With Sprinkles" blog

Forked from https://github.com/AndreiRailean/MongoDB-OSX-Launchctl

Tested with Mongo 2.0.7 and Mac 10.8.1 (Mountain Lion) on 1 Sep 2012