Saturday 9 February 2013

Mongodb Installation in ubuntu

Mongodb Installation.

.

Hi , in my previous article I posted how to work with mongoid with rails and some basics about mongodb Mongoid with RailsMongodb with Rails and here is installation steps of mongodb in ubuntu





Step 1 :
open terminal by typing shift+alt+T
Step 2 :
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
Step 3 :

Create a file in the following directory ,at your terminal type the following

cd /etc/apt/sources.list.d then
touch 10gen.list

open the file by typing following command

sudo nano  10gen.list
then enter the following line 
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
 press enter and then ctrl+X  it will ask to save file then press Y
Step 4 :

Then we need to reload the repository by using the following command at your terminal

sudo apt-get update

Now its the time to install 10 gen packages (mongodb maintained by 10gen)

Step 4 :
sudo apt-get install mongodb-10gen
This will install all 10gen packages required for mongodb , when this is done at terminal you see the following line
Adding user `mongodb' to group `mongodb' ... 
Adding user mongodb to group mongodb 
Done.

Thats it you have successfully installed mongodb in your system . Then try start/ stop mongodb services by using the following commands

sudo service mongodb start
sudo service mongodb stop
Connect to mongodb by using the following command at terminal
mongo
it will connect to default database 'test' , you can see in terminal following lines
MongoDB shell version: 2.2.2 
connecting to: test 
Welcome to the MongoDB shell. 
For interactive help, type "help". 
For more comprehensive documentation, see 
 http://docs.mongodb.org/ 
Questions? Try the support group 
 http://groups.google.com/group/mongodb-user 
You can use mongodb GUI tools , the following link will guide you through several tools choose any one of them
http://www.mongodb.org/display/DOCS/Admin+UIs 

I hope this will give some sort of idea how to install mongodb ..I welcome your comments on this article thank you

Cheers,
Ratnakar
About the Author
Ratnakar is a Software Engineer, Blogger from India.His articles mainly focus on Ruby on Rails Technology.
Reach Him : Google+ Facebook Twitter

0 comments: