Configuring the Yum source for MongoDB
# 编辑文件vim /etc/yum.repos.d/mongodb-org-3.6.repo # 添加以下内容[mongodb-org-3.6]name=MongoDB Repositorybaseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/x86_64/gpgcheck=1enabled=1gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc
Installing MongoDB
清除 安装源 yum clean all
yum install -y mongodb-org
Related actions
# 启动systemctl start mongod.service# 停止systemctl stop mongod.service# 重启systemctl restart mongod.service
Editing a configuration file
# Edit Default configuration file vim/etc/mongod.conf# Data Storage locationstorage: dbpath:/var/lib/mongo journal: Enabled: true# engine:# mmapv1:< Span class= "hljs-comment" ># wiredtiger:# network-related configuration net: port: 27017 # default port bindip: 0.0. 0.0 # monitoring IP configuration, open remote connection can comment the bank or modify the IP to 0.0.0.0# whether to turn on the rights validation security: authorization:enabled
CENTOS6 7 Yum Install MongoDB 3.6