Installing MongoDB on Red Hat Linux Enterprise v6

Because Mongo is so simple and lightweight, it can run on many platforms. For businesses, there is often some Linux presence and Red Hat is likely the distribution of choice. So, I wanted to write down what it takes to get MongoDB installed on Red Hat Linux Enterprise v6.

First, because I’m a private person, I needed to create an account on www.RedHat.com, then I could download a 30-day trial. This is in the form of a boot disk image (an .iso) and then the actual DVD image which contains the operating system install.

You could always use the open-source Fedora version, which is almost identical, however for this blog post, I wanted to use the real thing since this may be a reference for someone installing on actual Red Hat Enterprise.

The simplest way for me to do this was on Hyper-V, on my Windows 8.1 Pro workstation. Here’s how that went:

STEP 1: Download the ISO’s for Red Hat
Go to www.redhat.com and go to Download Evaluations:

mx38F61

then you’ll see that you can download the ISO’s:

mx3687B

STEP 2: Create the virtual machine in Hyper-V
Open “Hyper-V manager” (see this post, if you have Windows 8 or 8.1 “Pro”, to see how to enable Hyper-V) – this could be on Windows 8 or 8.1 Pro – or on Windows Server, it’s the same Hyper-V software. Right-click on the server name and choose to create a new virtual machine – and follow the prompts:

image

image

image

image

image

image

mx3C676

STEP 3: Install Red Hat Linux Enterprise v6 on the Hyper-V virtual machine
Right-click on the VM and choose Start and go through the installer per-normal…

mx338F3

Not that we booted from the boot ISO, and after a few screens, we need to switch our media over to the installation disk:

mx3E08F

You can switch to the other ISO you downloaded from the Media menu (which I can’t take a screenshot of), or by right-click on Settings for that VM back in Hyper-V

mx39F32

And go to the “DVD Drive” that is listed:

mx33F1C

From here, you can click browse and point to the other ISO you downloaded (named “rhel-server-6.5-i386-dvd.iso”, in my case). That’s how it is supposed to work, but it did not in this case. I got this, whenever I tried to eject or change the disc that is mounted in that DVD drive.

image

Well, that should be what we do, but Red Hat has a death-grip on the DVD drive, so we can’t eject it! So, I shut down the VM, added a second DVD drive, and that worked. I mounted the boot disc to one and the installation disc to the other. That fixed this, for me.

During the installation, I just chose “Basic Server”:

mx3EEA7

mx3A436

Installation took about :15 minutes

Note that “Red Hat 6 does not configure network interfaces on default installation”. Yes, you heard correctly, in the year 2014 – why would network cards be enabled by default!

So, I had to go enable it, and set it to use DHCP. Edit this config file:

$ sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0

That file now looks like this:

mx3D044

Reboot and try to ping something, or type “ifconfig” and you’ll see the network card is now working.

STEP 4: Download and Install MongoDB
This ended up being pretty easy. I just followed the instructions right from the MongoDB site:

http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux/

This is ideal too because in a corporate environment where you aren’t allowed to install un-vetted software from the Internet, you can configure Yum to point to a local repository.

Per the instructions, I created the file:

$ sudo nano /etc/yum.repos.d/mongodb.repo

mx328A1

Then, I can run the Yum install:

$ sudo yum install mongo-10gen mongo-10gen-server

Which looks like this:

mx370D6

and then:

mx310C

STEP 5: Start the service
Now I should be able to start the service with:

$ service mongod start

And sure enough:

mx362DE

STEP 6: Connect to the service
And when I run the mongo client:

$ mongo

I can connect to the local instance:

mx32176

Posted in Infrastructure, Linux, MongoDB, NoSQL, Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives
Categories

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 2 other followers

%d bloggers like this: