Environment Configuration
MongoDB Installation
Download Yum Source Configuration
wget Https://repo.mongodb.org/yum/redhat/mongodb-org-3.0.repo MV mongodb-org-3.0.repo/etc/yum.repos.d/
Installing MongoDB
Yum-y Install mongodb-org
Modify the MongoDB configuration file
# Modify the Listener address to 0.0.0.0net:port:27017 bindip:0.0.0.0# Modify the replica set configuration replication:oplogsizemb:20480 Replsetname:gogen
Modify Kernel Configuration
# It's best to join the boot profile echo never >/sys/kernel/mm/transparent_hugepage/enabledecho never >/sys/kernel/mm/transparent_ Hugepage/defrag
Modify the file descriptor /etc/security/limits.conf
# After the configuration file is added later content Mongod soft nofile 64000mongod hard nofile 64000mongod soft nproc 32000mongod hard Nproc 32000
Start the service
Chkconfig Mongod onservice mongod start
Replica Set Configuration
Test
MongoDB 3.0 Replica Set Build