发布于 2015-09-14 14:51:26 | 158 次阅读 | 评论: 0 | 来源: 网络整理

sh.addShardTag(shard, tag)

2.2 新版功能.

参数:
  • shard (string) – Specifies the name of the shard that you want to give a specific tag.
  • tag (string) – Specifies the name of the tag that you want to add to the shard.

sh.addShardTag() associates a shard with a tag or identifier. MongoDB uses these identifiers to direct chunks that fall within a tagged range to specific shards.

sh.addTagRange() associates chunk ranges with tag ranges.

Always issue sh.addShardTag() when connected to a mongos instance.

Example

The following example adds three tags, NYC, LAX, and NRT, to three shards:

sh.addShardTag("shard0000", "NYC")
sh.addShardTag("shard0001", "LAX")
sh.addShardTag("shard0002", "NRT")
最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务