linux版安装:
如果机器能联网,可采用官网安装步骤进行安装;
如果不能联网,则采用离线安装
Centos6.5离线安装:
官网下载:https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel62-3.0.5.tgz
解压:tar -zxvf mongodb-linux-x86_64-rhel62-3.0.5.tgz
cd mongodb-linux-x86_64-rhel62-3.0.5/bin
单机运行:
启动mongodb server:./mongod -journal -maxConns=2400 -rest
客户端登录服务器
bin/mongo
执行db.foo.save({1 : “Hello world”})
然后查找db.foo.find();
看到{ "_id" : ObjectId("4e4b395986738efa2d0718b9"), "1" : "hello world" }
执行到这里恭喜你,成功安装好了mongodb
集群安装:
官网参考:https://docs.mongodb.org/manual/tutorial/deploy-shard-cluster/
案例参考:http://www.2cto.com/database/201307/230419.html