yum安装mongodb

来源:互联网 发布:低头族数据统计 编辑:程序博客网 时间:2024/05/16 17:25

参考:http://docs.mongodb.org/master/tutorial/install-mongodb-on-red-hat/


创建文件/etc/yum.repos.d/mongodb-org-3.0.repo

写入:

[mongodb-org-3.0]name=MongoDB Repositorybaseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/gpgcheck=0enabled=1


//安装mongodb
#yum install -y mongodb-org

//启动
#service mongod start

//命令行进入mongodb,看到箭头即可。
#mongo
>


如果远程无法连接,修改防火墙,尝试修改/etc/mongod.conf

bind_ip=0.0.0.0port=27017httpinterface=true

为了能在http://ip:28017看到mongo状态信息,还需要修改/etc/mongod.conf

不修改会提示错误信息:

REST is not enabled.  use --rest to turn on.check that port 28017 is secured for the network too.

在/etc/mongod.conf加入这么一行即可

rest=true


0 0
原创粉丝点击