Thursday

Installing MongoDB on Linux




Installing MongoDB on Ubuntu :


Configure Package Management System (APT)

        Step 1 :- sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10

        Step 2 :- open   /etc/apt/sources.list.d
           
                  Inside the " sources.list.d " directory create a file with a name 10gen.list
                 10gen.list file should contain the following line

        deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
     
        Step 3 :-  sudo apt-get clean

        Step 4 :-   sudo apt-get update
    
       Step 5 :-   sudo apt-get install mongodb-10gen







     Starting MongoDB :

                     sudo service mongodb start

    Stopping MongoDB : 

                     sudo service mongodb stop

    Restarting MongoDB:

                    sudo service mongodb restart



 Error May Happen :

     No command 'deb' found, did you mean:


      If you have come across this mistake/error, then you have probably done a common mistake. Whenever you see any line starting with deb, make sure that it is not for running in the command prompt, but for adding into a particular file

The line must be added to the file /etc/apt/sources.list

0 comments:

Post a Comment