Install MongoDB on Ubuntu 12.04

转载 2013年12月05日 01:07:12


Install MongoDB on Ubuntu 12.04

MongoDB is a document database used commonly in modern web applications. This tutorial should help you setup a virtual private server to use as a dedicated MongoDB server for a production application environment. 

Step 1 -- Create a Droplet

This one's easy. Once you're done, go ahead and `ssh` in. 
N.B. :: It is recommended that you configure `ssh` and `sudo` like this 

Step 2 -- Create the Install Script

The MongoDB install process is simple enough to be completed with a Bash script. Copy the following into a new file named `mongo_install.bash` in your home directory: 

apt-key adv --keyserver --recv 7F0CEB10
echo "deb dist 10gen" | tee -a /etc/apt/sources.list.d/10gen.list
apt-get -y update
apt-get -y install mongodb-10gen

Here's an explanation of each line in the script: 
  1. The `apt-key` call registers the public key of the custom 10gen MongoDB aptitude repository
  2. A custom 10gen repository list file is created containing the location of the MongoDB binaries
  3. Aptitude is updated so that new packages can be registered locally on the Droplet
  4. Aptitude is told to install MongoDB

TIP: At any time, to change to your home directory, simply execute `cd` 

Step 3 -- Run the Install Script

Execute the following from your home directory: 
$ sudo bash ./mongo_install.bash

If everything is successful, you should see the output contain a PID of the newly started MongoDB process: 
mongodb start/running, process 2368

Step 4 -- Check It Out

By default with this install method, MongoDB should start automatically when your Droplet is booted. This means that if you need to reboot your Droplet, MongoDB will start right back up.
To start learning about the running `mongod` process, run the following command: 
$ ps aux | grep mongo

One line of the output should look like the following: 
mongodb    569  0.4  6.4 627676 15936 ?        Ssl  22:54   0:02 /usr/bin/mongod --config /etc/mongodb.conf

We can see the... 
  • User: `mongodb`
  • PID: `569`
  • Command: `/usr/bin/mongod --config /etc/mongodb.conf`
  • Config File: `/etc/mongodb.conf`




How To Install LAMP (Linux, Apache, MySQL, PHP) On Ubuntu 11.04/11.10/12.04

How To Install LAMP (Linux, Apache, MySQL, PHP) On Ubuntu 11.04/11.10/12.04 Do you like this ...

How to Install CodeIgniter on an Ubuntu 12.04 Cloud Server

About CodeIgniter CodeIgniter is an open source web application framework for PHP that is small...

精选:深入理解 Docker 内部原理及网络配置

网络绝对是任何系统的核心,对于容器而言也是如此。Docker 作为目前最火的轻量级容器技术,有很多令人称道的功能,如 Docker 的镜像管理。然而,Docker的网络一直以来都比较薄弱,所以我们有必要深入了解Docker的网络知识,以满足更高的网络需求。

install ubuntu 12.04 on macbook pro md101 2012-7 version

i can`t use cdrom, i don`t know why, so i find a way to burn the iso into a udisk. use following sc...

install kvm on ubuntu12.04

setup 1, Install kvm# apt-get install q emu-kvm li bvirt-bin bridge-utils virtinstsetup 2, configure...

HOWTO install Oracle 11g on Ubuntu Linux 12.04 (Precise Pangolin) 64bits

安装了Ubuntu 12.04 64bit, 想在上面安装Oracle 11gr2,网上找了好多文档都没成功,最后完全参考了MordicusEtCubitus的文章。 成功安装的关键点:inst...

Install CMake on Ubuntu 12.04


ubuntu_Install Android SDK on Ubuntu 12.04 LTS

Ubuntu (latest version: 12.04 LTS) is now the most popular GNU/Linux distribution on this planet; An...

Install MongoDB on Ubuntu

Overview Use this tutorial to install MongoDB on LTS Ubuntu Linux systems from .deb packages. Whi...

Install MongoDB on Ubuntu

Install MongoDB on Ubuntu Overview Use this tutorial to install MongoDB on Ubuntu Linux syst...

Install MongoDB on Ubuntu16.04

折腾了一天,终于在Ubuntu 16.04 LTS上安装好了MongoDB,详细记录如下。 我是参考官网进行安装的,首先在平台支持上可以看到,Ubuntu 16.04只支持最新的3.2版本,于是...