875   MongoDB Ubuntu

官网上有安装教程
https://docs.mongodb.org/v2.6/tutorial/install-mongodb-on-ubuntu/

1,添加源包密匙

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

2,添加源包信息

echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list

3,更新本地源信息

sudo apt-get update

4,进行安装

sudo apt-get install -y mongodb-org

5,启停MongoDB


sudo service mongod start/stop/restart

测试安装是否成功
https://docs.mongodb.org/v2.6/tutorial/getting-started/#connect-to-a-mongod
遇到一些问题
1,


2015-12-20T14:16:07.070+0800 E JOURNAL  [initandlisten] Insufficient free space for journal files
2015-12-20T14:16:07.070+0800 I JOURNAL  [initandlisten] Please make at least 3379MB available in /var/lib/mongodb/journal or use --smallfiles

解决方法:

sudo vim /etc/mongod.conf


storage:
# add 
   smallFiles: true




Leave a Reply

Your email address will not be published. Required fields are marked *