当前位置:Gxlcms > 数据库问题 > centos7 安装mongoDB

centos7 安装mongoDB

时间:2021-07-01 10:21:17 帮助过:5人阅读

# 数据库文件路径
dbpath = /opt/mongoDB/mongodb-linux-x86_64-4.0.5/data
# 日志文件路径
logpath = /opt/mongoDB/mongodb-linux-x86_64-4.0.5/logs/mongodb.log
# 是否追加日志
logappend=true
# 端口
port=27017
# 是否后台程序启动
fork=true
# 是否启动授权认证
auth=true
# 开启链接权限
bind_ip=0.0.0.0
技术图片

5配置mongodb服务

vim /lib/systemd/system/mongodb.service

  

技术图片
[Unit]

Description=mongodb
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
ExecStart=/opt/mongoDB/mongodb-linux-x86_64-4.0.5/bin/mongod --config /opt/mongoDB/mongodb-linux-x86_64-4.0.5/bin/mongodb.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/opt/mongoDB/mongodb-linux-x86_64-4.0.5/bin/mongod --shutdown --config /opt/mongoDB/mongodb-linux-x86_64-4.0.5/bin/mongodb.conf
PrivateTmp=true

[Install]
WantedBy=multi-user.target

 

centos7 安装mongoDB

标签:title   targe   end   toolbar   enter   class   授权   conf   unity   

人气教程排行