`

Installing MongoDB 1.8.1 on Ubuntu 10.10 & 11.04 and running with an ‘init’ scri

 
阅读更多

Installing MongoDB 1.8.1, in my case as a developer database, is easy. This blog post just itemises all the steps so that you can pretty much blindly follow along. I’ll probably use these steps myself as I seem to be doing this regurlarly ;-)

Download the 64bit Linux binaries from here and unzip the contents to /usr/local.

cd /tmp
wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.8.1.tgz
sudo tar -zxf /tmp/mongodb-linux-x86_64-1.8.1.tgz -C /usr/local

Setup some symbolic links.

sudo ln -s /usr/local/mongodb-linux-x86_64-1.8.1 /usr/local/mongodb
sudo ln -s /usr/local/mongodb/bin/bsondump /usr/local/bin/bsondump
sudo ln -s /usr/local/mongodb/bin/mongo /usr/local/bin/mongo
sudo ln -s /usr/local/mongodb/bin/mongod /usr/local/bin/mongod
sudo ln -s /usr/local/mongodb/bin/mongodump /usr/local/bin/mongodump
sudo ln -s /usr/local/mongodb/bin/mongoexport /usr/local/bin/mongoexport
sudo ln -s /usr/local/mongodb/bin/mongofiles /usr/local/bin/mongofiles
sudo ln -s /usr/local/mongodb/bin/mongoimport /usr/local/bin/mongoimport
sudo ln -s /usr/local/mongodb/bin/mongorestore /usr/local/bin/mongorestore
sudo ln -s /usr/local/mongodb/bin/mongos /usr/local/bin/mongos
sudo ln -s /usr/local/mongodb/bin/mongosniff /usr/local/bin/mongosniff
sudo ln -s /usr/local/mongodb/bin/mongostat /usr/local/bin/mongostat

The first “ln -s” above sets up a handy symbolic link between the versioned mongodb folder and its unversioned counterpart. When 10Gen release updates, say version 1.8.2, all you need to do is download, unzip, and link the ’1.8.2 mongodb folder’ to the unversioned folder and ‘hey presto’ everything should just work.

To get an init script working cleanly with this setup, download mine from my Github ‘dotfiles’ repo . Please note – my init script enables journaling and the REST interface (on line 51).

wget https://github.com/ijonas/dotfiles/raw/master/etc/init.d/mongod
sudo mv mongod /etc/init.d/mongod
sudo chmod +x /etc/init.d/mongod

You’ll need to add a mongodb user and prep some folders

sudo useradd mongodb
sudo mkdir -p /var/lib/mongodb
sudo mkdir -p /var/log/mongodb
sudo chown mongodb.mongodb /var/lib/mongodb
sudo chown mongodb.mongodb /var/log/mongodb

Also, you need to activate your MongoDB service’s init script by adding it to your system’s run-level configuration. That way the service will startup during the boot sequence and stop nicely during the OS’ shutdown procedure.

sudo update-rc.d mongod defaults

Lastly to launch MongoDB

/etc/init.d/mongod start

Good luck!

UPDATE: Since April 6 Ubuntu now has prefabbed packages containing MongoDB 1.8.1, maintained by 10Gen. See the instruction below.

 

http://blog.csdn.net/luoweifeng1989/article/details/6571965

分享到:
评论

相关推荐

    Installing Ubuntu 14.04 & ROS & TurtleBot 06-29-2016

    Installing Ubuntu 14.04 & ROS & TurtleBot 06-29-2016 个人小结,关于Ubuntu和ROS的安装。

    Installing STLinux on Ubuntu

    而RPM包管理系统需手动安装,其数据库位于`/var/lib/rpm`或对于Ubuntu 10.10版本的用户而言,则是`/root/.rpmdb`,用于记录由STLinux安装的所有包。 #### 调整Shell环境 STLinux中的某些脚本假定`/bin/sh`为bash,...

    Ubuntu.15.04.Server.with.systemd.Administration.and.Reference.epub

    This book is designed as an Ubuntu 15.04 server reference, covering the Ubuntu servers and their support applications. Server tools are covered as well as the underlying configuration files and system...

    MongoDB Basics

    Need a quick and easy to understand introduction to MongoDB and NoSQL databases? MongoDB Basics, from The Definitive Guide to MongoDB, 2E, shows you how a document-oriented database system differs ...

    installing samba on ubuntu

    面是我在Ubuntu6.06 LTS 下源码编译安装samba主要安装过程,本人第一次用Ubuntu,刚装上去时候,没有gcc编译环境。郁闷了半天。找出这一过程发了不少的时间。可能还有些不妥,不过我经过这样的安装达到了向windows共享...

    anaconda安装 - Installing Anaconda on Ubuntu

    ### 安装Anaconda在Ubuntu上的详细步骤及关键知识点 #### 一、Anaconda简介 Anaconda是一款非常受欢迎的数据科学平台,它集成了Python或R语言环境中的许多库和工具,便于用户进行数据处理、科学计算、机器学习等...

    Ubuntu Up and Running.pdf

    Because this book takes you from the first steps of installing the operating system, through configuration, maintenance, and security, and on to topics such as networking, it provides a complete ...

    Requirements For Installing Oracle10gR2 On RHEL 5&OEL 5 (x86_64)

    ### 安装Oracle 10g R2在RHEL 5 & OEL 5 (x86_64)上的需求 #### 概述 本文档详细介绍了在Red Hat Enterprise Linux(RHEL)5和Oracle Enterprise Linux(OEL)5(x86_64架构)上安装Oracle 10g Release 2数据库的...

    Ubuntu Pocket Guide and Reference: A concise companion for day-to-day Ubuntu use

    - **Installation**: The book starts with a detailed guide on installing Ubuntu on your computer, covering various scenarios and hardware configurations. - **Hardware Configuration**: After ...

    Ubuntu 使用手册 14.04 最新版本(英文原版)

    Running Windows Programs on Ubuntu 106 7 Troubleshooting 111 Resolving problems 111 Troubleshooting guide 111 Getting more help 116 8 Learning More 117 What else can I do with Ubuntu? 117 Open source ...

    Docker Containers_Build and Deploy with Kubernetes,Flannel,Cockpit,and Atomic

    ■ How Docker can benefit you: I explain the benefits of creating and run- ning applications in containers, instead of installing software packages (in formats such as RPM or Deb) and running ...

    MySQL V5.5帮助文档

    2.3.3. Installing MySQL on Microsoft Windows Using an MSI Package 2.3.4. MySQL Server Instance Configuration Wizard 2.3.5. Installing MySQL on Microsoft Windows Using a noinstall Zip Archive 2.3.6. ...

    Installing and Configuring Openfiler with DRBD and Heartbeat

    Installing and Configuring Openfiler with DRBD and Heartbeat

Global site tag (gtag.js) - Google Analytics