Last active
July 27, 2018 02:40
-
-
Save anhtranbk/7a1135a335cde1f95f5f4b919054dc2a to your computer and use it in GitHub Desktop.
Setup MongoDB on Centos 7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /usr/lib/systemd/system/mongod.service | |
# file size | |
LimitFSIZE=infinity | |
# cpu time | |
LimitCPU=infinity | |
# virtual memory size | |
LimitAS=infinity | |
# open files | |
LimitNOFILE=64000 | |
# processes/threads | |
LimitNPROC=64000 | |
# total threads (user+kernel) | |
TasksMax=infinity | |
TasksAccounting=false | |
# Recommended limits for for mongod as specified in | |
# http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use local | |
rs.initiate() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
net: | |
port: 27017 | |
bindIp: 0.0.0.0 | |
replication: | |
oplogSizeMB: 36864 | |
replSetName: rs0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo '[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' > /etc/yum.repos.d/mongodb-org-4.0.repo | |
yum install -y mongodb-org | |
systemctl enable mongod | |
systemctl start mongod |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment