Install MongoDB Community Edition on Ubuntu
--> install mongodb community edition
1. Import the public key used by the package management system. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
2. Create a list file for MongoDB.-> Ubuntu 12.04:echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list-> Ubuntu 14.04:echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
->Ubuntu 16.04echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list3 Reload local package database. sudo apt-get update4 Install the MongoDB packages. sudo apt-get install -y mongodb-org5 Start MongoDB. sudo service mongod start6 Verify that MongoDB has started successfully.Verify that the mongod process has started successfully by checking the contents of the log file at /var/log/mongodb/mongod.log for a line reading [initandlisten] waiting for connections on port <port> where <port> is the port configured in /etc/mongod.conf, 27017 by default.7 Stop MongoDB. sudo service mongod stop8 Restart MongoDB. sudo service mongod restart
--> Uninstall MongoDB Community EditionTo completely remove MongoDB from a system, you must remove the MongoDB applications themselves, the configuration files, and any directories containing data and logs. The following section guides you through the necessary steps.
WARNING
This process will completely remove MongoDB, its configuration, and all databases. This process is not reversible, so ensure that all of your configuration and data is backed up before proceeding.1 Stop MongoDB. sudo service mongod stop2 Remove Packages. sudo apt-get purge mongodb-org*3 Remove Data Directories. sudo rm -r /var/log/mongodb sudo rm -r /var/lib/mongodb
1. Import the public key used by the package management system. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
2. Create a list file for MongoDB.-> Ubuntu 12.04:echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list-> Ubuntu 14.04:echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
->Ubuntu 16.04echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list3 Reload local package database. sudo apt-get update4 Install the MongoDB packages. sudo apt-get install -y mongodb-org5 Start MongoDB. sudo service mongod start6 Verify that MongoDB has started successfully.Verify that the mongod process has started successfully by checking the contents of the log file at /var/log/mongodb/mongod.log for a line reading [initandlisten] waiting for connections on port <port> where <port> is the port configured in /etc/mongod.conf, 27017 by default.7 Stop MongoDB. sudo service mongod stop8 Restart MongoDB. sudo service mongod restart
--> Uninstall MongoDB Community EditionTo completely remove MongoDB from a system, you must remove the MongoDB applications themselves, the configuration files, and any directories containing data and logs. The following section guides you through the necessary steps.
WARNING
This process will completely remove MongoDB, its configuration, and all databases. This process is not reversible, so ensure that all of your configuration and data is backed up before proceeding.1 Stop MongoDB. sudo service mongod stop2 Remove Packages. sudo apt-get purge mongodb-org*3 Remove Data Directories. sudo rm -r /var/log/mongodb sudo rm -r /var/lib/mongodb
x
Comments
Post a Comment