Introduction: Install Homebrew & MongoDB on a Mac

Installing HOMEBREW and MONGODB on a Mac.

First off what is Homebrew?

Homebrew is the ‘so called’ missing package manager for a Mac. Linux folks who use Redhat and Ubuntu are used to installing things with yum and other package managers. Mac typically installs things with point and click packages because it focuses on the GUI. But this small setup will allow for ease of installation of many packages that are not packaged in a point and click package, in this case we will install MongoDB. (NoSql).

Homebrew is a bit unique from Yum, I would check out the Wiki here and do some reading if you want to learn more.

https://github.com/Homebrew/homebrew/wiki

Ok Lets install Homebrew.

We will use a Ruby call to go the install.

You will need the basics,

• An Intel CPU 1

• OS X 10.5 or higher 2

• Command Line Tools for Xcode: xcode-select --install, https://developer.apple.com/downloads or Xcode 3

• A Bourne-compatible shell for installation (e.g. bash or zsh)

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/insta...

It will explain what it is going to do, and then do it for you.

Some simple brew commands.

To update new

-> brew update

To find out what is outdated

-> brew outdated

To upgrade everything

-> brew upgrade

Now everyone is interested in NoSql at the moment, so lets install MongoDB on a mac via Homebrew.

-> brew install mongodb

Here is the output from my terminal

————+

shadowmancer$ brew install mongodb

==> Downloading https://downloads.sf.net/project/machomebrew/Bott...

######################################################################## 100.0%

==> Pouring mongodb-2.6.1.mavericks.bottle.tar.gz

==> Caveats

To have launchd start mongodb at login:

ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

Then to load mongodb now:

launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist

Or, if you don't want/need launchctl, you can just run:

mongod --config /usr/local/etc/mongod.conf

==> Summary

? /usr/local/Cellar/mongodb/2.6.1: 17 files, 317M

rapscallion:local shadowmancer$ brew

Example usage:

brew [info | home | options ] [FORMULA...]

brew install FORMULA...

brew uninstall FORMULA...

brew search [foo]

brew list [FORMULA...]

brew update

brew upgrade [FORMULA...]

brew pin/unpin [FORMULA...]

Troubleshooting:

brew doctor

brew install -vd FORMULA

brew [--env | config]

Brewing:

brew create [URL [--no-fetch]]

brew edit [FORMULA...]

open https://github.com/Homebrew/homebrew/wiki/Formula...

Further help:

man brew

brew home

———-+

That is it, short and easy. Homebrew will let you install many different things easily, and MongoDB will let you get started with HADOOP!

Homebrew

http://brew.sh

MongoDB

http://www.mongodb.org

Hadoop (Apache)

http://hadoop.apache.org

Thanks

Joseph Murphy
AKA Grehyton (WURM)

Comments

author
paulsoerensen (author)2016-06-10

Nope you don't pixel67.

First off, when installing MongoDB from Brew, it will install it into: /usr/local/Cellar/mongodb/3.2.7/

The configuration file will be located in: /usr/local/etc/mongod.conf
If you open it up, you'll see that you db directory is specified:

systemLog:
destination: file
path: /usr/local/var/log/mongodb/mongo.log
logAppend: true
storage:
dbPath: /usr/local/var/mongodb
net:
bindIp: 127.0.0.1

Start MongoDB using your configuration file:
$ mongod --config /usr/local/etc/mongod.conf

Open a new terminal tab and connect to MongoDB:
$ mongo

author
pixel67 (author)2015-02-17

so when installing from homebrew we don't need to create the /data/db directory?

author
sivakumar.bhuchipalli (author)2015-01-01

Hello guys, You can go through free online big data and hadoop tutorials at http://hadooptutorial.info­ blog. All the concepts are very clear and easy to understand.

About This Instructable

21,966views

8favorites

License:

More by BoxOfSugar:Some Simple OS X Command Line Tools For EveryoneInstall and Configure HADOOP on OsXUsing Netinstall OS X 10.9 and Others
Add instructable to: