CentOS7.3 安装MongoDB 3.2 阿里云(亲试)

来源:互联网 发布:模块化数据机房 编辑:程序博客网 时间:2024/06/07 17:51

第一步 —— 将MongoDB添加到yum仓库

根据你需要的MongoDB版本和系统版本不同,创建yum仓库的配置文件/etc/yum.repos.d/mongodb.repo中。这里是MongoDB 3.2。

输入命令:

# vi /etc/yum.repos.d/mongodb.repo

64位系统使用(这里使用阿里源):

[MongoDB]name=MongoDB Repositorybaseurl=http://mirrors.aliyun.com/mongodb/yum/redhat/7/mongodb-org/3.2/x86_64gpgcheck=0enabled=1

第二步 —— 安装MongoDB服务器

# yum install mongodb-org

第三步 —— 启动MongoDB

# /etc/init.d/mongod restart

配置MongoDB随系统自启动

# chkconfig mongod on

第四步 —— 连接MongoDB

# mongo
1 0