5.Mongodb
1.查看分片: db.runComand({listshards:1})
2.查看数据存储情况:show dbs
3.查看分片状态: sh.status()
4.开启数据库分片配置:db.runComand({enablesharding :"testdb"})
db.enableSharding("testdb")
db.shardCollection("testdb.persons",{id: 1})
5.创建索引(如果有数据,需先创建索引,才能将这个字段做为分片建分片:
6.use testdb
db.users.ensureIndex({id: 1})
7.创建分片的建(id):db.runComand({shardcollection : "testdb.usercollection",key: {id: 1}})
8.balancer 自动平衡v3.4
标签:创建,mongodb,db,汇总,testdb,分片,runComand,id From: https://www.cnblogs.com/chenshaojun2008/p/18156570