Skip to content

Instantly share code, notes, and snippets.

@YoshihitoAso
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YoshihitoAso/9631889 to your computer and use it in GitHub Desktop.
Save YoshihitoAso/9631889 to your computer and use it in GitHub Desktop.
[MongoDB][Ubuntu]ubuntuにmongodbをインストールする手順

UbuntuにMongoDBをインストールする

※参考情報:OSのバージョン

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.10
DISTRIB_CODENAME=quantal
DISTRIB_DESCRIPTION="Ubuntu 12.10"

MongoDBをインストール

公式ドキュメントの通り、以下の手順でインストール出来る

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
$ echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
$ sudo apt-get update
$ sudo apt-get install mongodb-10gen

MongoDBの起動

起動停止は以下のコマンドで実施する。

MongoDBのプロセスを開始

$ sudo service mongodb start

MongoDBのプロセスを停止

$ sudo service mongodb stop

MongoDBのプロセスを再起動

$ sudo service mongodb restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment