2012. július 30., hétfő

Installing MongoDB on Linux Ubuntu Server 12.04

For those who like to know how to install MongoDB on a clean Linux Ubuntu 12.04 install.
Note: this article is for any Ubuntu versions above 9.10, using upstart.


At first, you need to tell Ubuntu that the repository where you are going to download MongoDB is a secure one. Do that by typing this line in the terminal:
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
I you are interrested about the 'apt-key' part, visit SecureApt.


Now you need to tell where to look for MongoDB. You will need to store this information in a file named 10gen.list, in the /etc/apt/sources.list.d/ directpory, so feel free to type in the terminal (I use vim):
$ sudo vim /etc/apt/sources.list.d/10gen.list
And the contents of the file will be:
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen


Now, let's update!
$ sudo apt-get update
And finally, here comes our target: MongoDB!
updated 'mongo' to 'mongo-10gen'
$ sudo apt-get install mongodb-10gen

Done.
Based on my experience, if you type in "mongo" now, it will not work. I rebooted the server and it was working like a charm. Try rebooting and then:
$ mongo
show dbs;
//local
//test

Nincsenek megjegyzések:

Megjegyzés küldése