Installing MongoDB is one of the most rudimentry operation(s). We can proceed in one of the 2 ways
I prefer choice 1.
Reason, you get to install the most stable version of the application and updates can be easily handled through Homebrew.
There's a lot more to installation than downloading files. Here are a few things one has to think through
Unless you are a seasoned LINUX/UNIX developer above items are a source of confusion. If you are one of the kind and like to manage things all by yourself under your nose, go right ahead with option 2. Rest all can take Option 1
Alright, now to install it from homebrew, do this
Once the installation is complete, here are a few things you need to be familiar with
With this in mind our next step is to make sure we have mongodb DB service as a part of OSX launch control process
And that's all to it. Now run your mongo Db with simple
"mongo" command. You should now be able to control all MONGO processes with launch control commands
- Homebrew
- Install from source
I prefer choice 1.
Reason, you get to install the most stable version of the application and updates can be easily handled through Homebrew.
There's a lot more to installation than downloading files. Here are a few things one has to think through
- Setting up mongo library. Where should this be - User directory or in a common location. Should this be /usr/local or /usr/bin or /etc...???
- Executable files need to be placed in right directory with shortcuts for easier access
- Executable files should have appropriate access privileges to ensure sanctity
- Data and log files to be created in right directory with right access
Unless you are a seasoned LINUX/UNIX developer above items are a source of confusion. If you are one of the kind and like to manage things all by yourself under your nose, go right ahead with option 2. Rest all can take Option 1
Alright, now to install it from homebrew, do this
brew update
brew install mongodb
Once the installation is complete, here are a few things you need to be familiar with
- All mongodb executable files are available in /usr/local/bin
- Configuration file is available in /usr/local/etc - mongod.conf
- Logs and data files to be stored in /usr/local/var/log && /usr/local/var/mongodb
With this in mind our next step is to make sure we have mongodb DB service as a part of OSX launch control process
Create a soft link for config file
ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents
Then, add it to OSX launch process
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
And that's all to it. Now run your mongo Db with simple
"mongo" command. You should now be able to control all MONGO processes with launch control commands
No comments:
Post a Comment