Mongo DB Install on Ubuntu Server 14.04

其实大多数安装文档在官网上都有很详细的描述 我只摘抄自己用的到部分

Import public Key

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6

Create a list file for MongoDB

Create the /etc/apt/sources.list.d/mongodb-org-3.4.list list file using the command appropriate for your version of Ubuntu:

Ubuntu14.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

Reload local package database

  • sudo apt-get update
  • sudo apt-get install -y mongodb-org
  • sudo service mongod start #Start MongoDB
  • cat /var/log/mongodb/mongod.log
  • #Verify that MongoDB has started successfully
  • sudo service mongod stop #Stop MongoDB
  • sudo service mongod restart #Restart MongoDB
  • sudo apt-get purge mongodb-org* #remove MongoDB
  • sudo rm -r /var/log/mongodb
  • sudo rm -r /var/lib/mongodb

 

Advertisements

发表评论

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

WordPress.com 徽标

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

Google photo

You are commenting using your Google account. Log Out /  更改 )

Twitter picture

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

Facebook photo

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

Connecting to %s