ITeye博客

mongodb安装

OiteBody · 2015-08-20 18:08 · mongodb · 数据库 · Markdown

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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。