var st = new ShardingTest({ shards: 2, mongos: 4 });
|
st.stopBalancer();
|
|
var testDB_s0 = st.s.getDB('test');
|
testDB_s0.adminCommand({ enableSharding: 'test' });
|
testDB_s0.adminCommand({ movePrimary: 'test', to: 'shard0001' });
|
testDB_s0.adminCommand({ shardCollection: 'test.user', key: { x: 1 }});
|
|
var testDB_s1 = st.s1.getDB('test');
|
testDB_s1.user.insert({ x: 1 });
|
testDB_s1.adminCommand({ moveChunk: 'test.user', find: { x: 0 }, to: 'shard0000' });
|
|
testDB_s0.user.findOne({ x: 1 });
|
|
|
testDB_s1.user.drop();
|
testDB_s1.user.insert({ x: 10 });
|
|
testDB_s0.user.findOne({ x: 10 });
|