How do I upgrade a single MongoDB node to sharding mode?
2011-07-03 16:39
531 查看
So the basic document on MongoDB.org is here:
http://www.mongodb.org/display/D...
Moving from single to sharded is not trivial. You need to add:
Another shard. (if using replica sets, each shard is a replica set)
At least one config DB (3 for production). The config DB is small, but should be housed on a separate computer. This DB basically contains information about which machines are in the cluster and what data they contain.
A `mongos` process, known as the Router.
You'll also have to change your code. The Router points to the config DB, your code points to the router for all requests.
You will then need to connect to the router and issue some commands to start sharding:
http://www.mongodb.org/display/D...
Then you will need to pick a shard key and shard the appropriate collections. There's a whole document on choosing a shard key:
http://www.mongodb.org/display/D...
Once configured, MongoDB automatically balances the data across shards. This should be done "in the background", however, it will need read and write throughput to move data. Think of it this way, if you have 200GB of data, your disk is now going to have to move 100GB of data.
This movement will likely impact performance, so watch your server loads.
可以详细阅读下面这些文档:
其实官方已经有一个文档说如何在没有downtime的情况下,将Non-sharded system升级为sharding mode system, V5
http://www.mongodb.org/display/DOCS/Upgrading+from+a+Non-Sharded+System
一个简单的setup + configure sharding mode mongodb的例子:
http://www.mongodb.org/display/DOCS/A+Sample+Configuration+Session
详细介绍什么是mongodb sharding,架构和一些feature:
http://www.mongodb.org/display/DOCS/Sharding+Introduction
主要谈的是配置一个sharding mode的mongodb cluster,包括如何sharding一个single mongodb node上的db/collection:
http://www.mongodb.org/display/DOCS/Configuring+Sharding
选择一个合格的shard key很重要,查看这里看应该注意哪些东西:
http://www.mongodb.org/display/DOCS/Choosing+a+Shard+Key
http://www.mongodb.org/display/D...
Moving from single to sharded is not trivial. You need to add:
Another shard. (if using replica sets, each shard is a replica set)
At least one config DB (3 for production). The config DB is small, but should be housed on a separate computer. This DB basically contains information about which machines are in the cluster and what data they contain.
A `mongos` process, known as the Router.
You'll also have to change your code. The Router points to the config DB, your code points to the router for all requests.
You will then need to connect to the router and issue some commands to start sharding:
http://www.mongodb.org/display/D...
Then you will need to pick a shard key and shard the appropriate collections. There's a whole document on choosing a shard key:
http://www.mongodb.org/display/D...
Once configured, MongoDB automatically balances the data across shards. This should be done "in the background", however, it will need read and write throughput to move data. Think of it this way, if you have 200GB of data, your disk is now going to have to move 100GB of data.
This movement will likely impact performance, so watch your server loads.
可以详细阅读下面这些文档:
其实官方已经有一个文档说如何在没有downtime的情况下,将Non-sharded system升级为sharding mode system, V5
http://www.mongodb.org/display/DOCS/Upgrading+from+a+Non-Sharded+System
一个简单的setup + configure sharding mode mongodb的例子:
http://www.mongodb.org/display/DOCS/A+Sample+Configuration+Session
详细介绍什么是mongodb sharding,架构和一些feature:
http://www.mongodb.org/display/DOCS/Sharding+Introduction
主要谈的是配置一个sharding mode的mongodb cluster,包括如何sharding一个single mongodb node上的db/collection:
http://www.mongodb.org/display/DOCS/Configuring+Sharding
选择一个合格的shard key很重要,查看这里看应该注意哪些东西:
http://www.mongodb.org/display/DOCS/Choosing+a+Shard+Key
相关文章推荐
- [hadoop]How To Install Apache Hadoop Pseudo Distributed Mode on a Single Node
- Upgrade MongoDB from single node to Master-Slave
- How to run eclipse in clean mode? and what happens if we do so?
- HowTo Restore RMAN Disk backups of RAC Database to Single Instance On Another Node
- How do I lock the orientation to portrait mode in a iPhone Web Application?
- Single Mode Fiber Jumper VS. Multimode Fiber Jumper : How to Choose?
- How to Upgrade Node.js via NPM
- HowTo Restore RMAN Disk backups of RAC Database to Single Instance On Another Node [ID 415579.1]
- How do I write to files using cheerio and request in node?
- How to create openstack single node with devstack
- How does Gradle know whether to do a single or multiproject build?
- HowTo Restore RMAN Disk backups of RAC Database to Single Instance On Another Node
- HOW-TO: upgrade nodejs to latest version
- how to use Zypper to do a live distribution upgrade of openSUSE.
- How To Upgrade ASM from 10.2 to 11.1 (single Instance configuration -Non-RAC)
- How To Upgrade ASM from 10.2 to 11.1 (single Instance configuration -Non-RAC)
- HowTo Restore RMAN Disk backups of RAC Database to Single Instance On Another Node [ID 415579.1]
- How To Upgrade ASM from 10.2 to 11.1 (single Instance configuration -Non-RAC)
- How to upgrade nodejs
- How To Upgrade ASM from 10.2 to 11.1 (single Instance configuration -Non-RAC)