惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
Last Week in AI
Last Week in AI
博客园_首页
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
人人都是产品经理
人人都是产品经理
V
Visual Studio Blog
宝玉的分享
宝玉的分享
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
量子位
博客园 - 聂微东
S
SegmentFault 最新的问题
博客园 - 司徒正美
罗磊的独立博客
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
美团技术团队
小众软件
小众软件
Jina AI
Jina AI

博客园 - 風語者·疾風

转载:ZooKeeper Programmer's Guide(中文翻译) Python【map、reduce、filter】内置函数使用说明(转载) Python使用基础 Redis Sentinel:集群Failover解决方案(转载) Sentinel-Redis高可用方案(二):主从切换 Sentinel-Redis高可用方案(一):主从复制 照片方案 8天学通MongoDB(实际操作版)——第一天 基础入门 构建Ubuntu Server试验环境 单元测试培训系列:(二)单元测试与Visual Studio My Record Series: (1.3) Windows Phone 7 Application Events My Record Series: (1.2) Windows Phone 7 Launchers and Choosers My Record Series: (1.1) Windows Phone 7.1 Development Environment 结合测试驱动TDD实施单元测试UnitTest 架构评审表(Architecture & Design Review Check List) 单元测试培训系列:(三)可测试性(Testability)与重构Refactoring 单元测试培训系列:(一)单元测试概念以及必要性 .NET Mocking Framework对比 Ajax-Enabled WCF Service中如何获取到Response
8天学通MongoDB(实际操作版)——第九天 构建学习...
風語者·疾風 · 2012-05-04 · via 博客园 - 風語者·疾風

根据此前的学习,已经可以了解到MongoDB主要的几种服务器角色:

  1. Mongos,这是MongoDB群集的入口服务器,主要承担数据路由任务。它会根据配置的“片键”将数据分发到自己管理的MongoDB群集中;
  2. ConfigServer,该服务器角色负责管理Mongos数据分片的依据,数据和片的对应关系以及相应的配置信息(需要注意的是ConfigServer的个数必须为1或3)
  3. ShardServer,独立的分片Mongod服务器,并入到Mongos下统一管理,存储分片的数据;
  4. ShardServer(repSet),副本集中的分片服务器,每个副本集中至少需要两个以上的ShardServer;
  5. ArbiterServer,副本集中的仲裁服务器,每个副本集中至少需要一个ArbiterServer;

参见下图,我们需要部署两个Mongos入口,3个ConfigServer,一个独立的ShardServer和一个RepSet(包含两个ShardServer和一个ArbiterServer),一共需要9个mongod实例。

决定把这8个实例分别部署到3台电脑上(一台物理主机,两台虚拟机)

Physical Server(192.168.111.11)

  • ConfigServer-I(D盘)
    mongod --configsvr --dbpath=d:\mongodb\db --port 2000
  • ShardServer(C盘)
    mongod –dbpath=c:\mongodb\db –port 4000
  • ArbiterServer(E盘)
    mongod --dbpath=e:\mongodb\db –port 4004 –replSet superlab/192.168.111.111:4000

Virtual Server-I(192.168.111.111)

  • ConfigServer-II(D盘)
    mongod --configsvr --dbpath=d:\mongodb\db --port 2000
  • Mongos(C盘)
    mongos --port 8848 --configdb=192.168.111.111:2000,192.168.111.222:2000,192.168.111.11:2000(C盘)
  • ShardServer(repSet) (E盘,磁盘空间需要大于2G)
    mongod --dbpath=e:\mongodb\db --port 4000 --replSet HALab/192.168.111.222:4000

Virtual Server-II(192.168.111.222)

  • ConfigServer-III(D盘)
    mongod --configsvr --dbpath=d:\mongodb\db --port 2000
  • Mongos(C盘)
    mongos --port 8848 --configdb=192.168.111.111:2000,192.168.111.222:2000,192.168.111.11:2000(C盘)
  • ShardServer(repSet) (E盘,磁盘空间需要大于2G)
    mongod --dbpath=e:\mongodb\db --port 4000 --replSet HALab/192.168.111.111:4000