@H_403_0@1.增加MongoDB仓库
@H_403_0@vim /etc/yum.repos.d/mongodb.repo
@H_403_0@
@H_403_0@如果你的系统是64位,添加如下内容:
@H_403_0@[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1
@H_403_0@
@H_403_0@如果你的系统是32位,添加如下内容:
@H_403_0@baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686/
enabled=1
@H_403_0@
@H_403_0@:wq退出编辑
@H_403_0@
@H_403_0@2.安装MongoDB
@H_403_0@yum -y update
@H_403_0@yum -y install mongodb-org mongodb-org-server
@H_403_0@
@H_403_0@3.运行MongoDB
@H_403_0@ 输入mongod 运行MongoDB
@H_403_0@ 新建一个命令行,输入mongo链接到数据库
@H_403_0@
@H_403_0@4.永久运行MongoDB
@H_403_0@mongod --fork --logpath /var/log/mongod.log
@H_403_0@
@H_403_0@
@H_403_0@
@H_403_0@参考资料:https://www.liquidweb.com/kb/how-to-install-mongodb-on-centos-7/
@H_403_0@http://stackoverflow.com/questions/8827615/how-do-you-keep-mongo-running-on-a-remote-server 原文链接:https://www.f2er.com/centos/380256.html