Mongodb

yum -y update

编辑Mongodb安装源

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

编辑内容如下:

[mongodb-org-3.6]

name=MongoDB Repository

baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/x86_64/

gpgcheck=1

enabled=1

gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc

安装

yum install -y mongodb-org

修改mongodb配置文件

vim /etc/mongod.conf

systemctl start mongod.service //启动服务

systemctl stop mongod.service //停止服务

systemctl restart mongod.service //重启服务

删除安装的包yum erase $(rpm -qa | grep mongodb-org)

删除数据及日志

rm -r /var/log/mongodb

rm -r /var/lib/mongo

 

更多内容参考:

https://www.jianshu.com/p/d09506c64fcd

https://www.cnblogs.com/hackyo/p/7967170.html

Leave a Reply

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