【MongoDB学习笔记1】基于CentOS 6.5安装MongoDB
更新:HHH   时间:2023-1-7


1.添加MongoDB安装源

vim /etc/yum.repos.d/mongodb-enterprise.repo

将下列配置项写入文件

[mongodb-enterprise]
name=MongoDB Enterprise Repository
baseurl=https://repo.mongodb.com/yum/redhat/$releasever/mongodb-enterprise/stable/$basearch/
gpgcheck=0
enabled=1
 
2.用yum安装MongoDB
yum install mongodb-enterprise

 

3.设置MongoDB进程开机启动

chkconfig mongod on #不建议使用这种方式

或者

echo "mongod -f /etc/mongod.conf --rest" >>/etc/rc.local #建议使用这种开机启动方式


详细信息介绍:

1.安装mongodb-enterprise,会安装以下几个包

mongodb-enterprise-server,包括Mongod进程,配置文件和初始化脚本;

mongodb-enterprise-mongos,包括mongos进程;

mongodb-enterprise-shell,包括mongo shell进程;

mongodb-enterprise-tools,包括mongoimport bsondump, mongodump,mongoexport, mongofiles, mongoimport, mongooplog, mongoperf, mongorestore, mongostat, 和mongotop工具;

2.yun MongoDB后配置文件为/etc/mongodb,初始化脚本为/etc/rc.d/init.d/mongod;

 

3.安装其他版本的MongoDB,例如安装2.6.1版本

yum install mongodb-enterprise-2.6.1
返回MongoDB数据库教程...