gyts62 发表于 2018-10-27 08:39:31

安装部署MONGODB分片集群

要使单个collection也分片存储,需要给collection指定一个分片key,通过以下命令操作:  > db.runCommand( { shardcollection : “”,key :});
  注:
  a. 分片的collection系统会自动创建一个索引(也可用户提前创建好)
  b. 分片的collection只能有一个在分片key上的唯一索引,其它唯一索引不被允许
  One note: a sharded collection can have only one unique index, which must exist on the shard key. No other unique indexes can exist on the collection.

页: [1]
查看完整版本: 安装部署MONGODB分片集群