Installing MongoDB 4.2 on CentOS 7

I’m following the official mongoDB manual to make the installation. I’m using XFS filesystem with RAID10 on my machine, that’s the official document recommended.

vim /etc/yum.repos.d/mongodb-org-4.2.repo

Paste the code.

[mongodb-org-4.2]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.2/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc
# sudo yum install -y mongodb-org
# sudo systemctl start mongod
# sudo systemctl status mongod
# sudo systemctl enable mongod

If you receive these errors

2020-04-29T03:38:34.612+0700 I  CONTROL  [initandlisten]
2020-04-29T03:38:34.612+0700 I  CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2020-04-29T03:38:34.612+0700 I  CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2020-04-29T03:38:34.612+0700 I  CONTROL  [initandlisten]
2020-04-29T03:38:34.612+0700 I  CONTROL  [initandlisten]
2020-04-29T03:38:34.612+0700 I  CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2020-04-29T03:38:34.612+0700 I  CONTROL  [initandlisten] **        We suggest setting it to 'never'
2020-04-29T03:38:34.612+0700 I  CONTROL  [initandlisten]

You may solve using this solution on transparent_hugepage always

or from the official document

Tags:

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Exit mobile version