LoginSignup
19

More than 5 years have passed since last update.

CentOS 7 MongoDB (4.0) のインストール

Last updated at Posted at 2014-12-29

CentOS 7 での MongoDB のインストール手順。
公式ドキュメント: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/ にある手順を参照してインストールする。

リポジトリの追加

$ sudo vim //etc/yum.repos.d/mongodb-org-4.0.repo

下記を記載する。

[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc

インストール

$ sudo yum install mongodb-org

起動

$ sudo systemctl start mongod

デフォルトでは 27017 番ポートで起動する。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19