Help us understand the problem. What is going on with this article?

MongoDBインストール(CentOS、Amazon Linux)

More than 1 year has passed since last update.

yumアップデート

yum update -y

レポジトリ追加

vi /etc/yum.repos.d/mongodb-org-3.4.repo

■ CentOSの場合

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

■ Amazon Linuxの場合

[mongodb-org-3.4]
name=MongoDB Repository
baseurl=http://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.4/x86_64/
gpgcheck=0
enabled=1

インストール

yum install -y mongodb-org

SELinuxの無効化

※ Amazon Linuxは最初から無効のため必要なし

getenforce
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

起動

■ CentOSの場合

systemctl start mongod
systemctl enable mongod

■ Amazon Linuxの場合

/etc/init.d/mongod start
chkconfig mongod on

起動確認

cat /var/log/mongodb/mongod.log
2017-07-25T09:51:17.306+0000 I NETWORK  [thread1] waiting for connections on port 27017
Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away