diff options
author | Eliot Horowitz <eliot@10gen.com> | 2011-04-29 17:37:45 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2011-04-29 17:37:45 -0400 |
commit | c574959c57f3f66dcdd41a244f08b687ca03480b (patch) | |
tree | 241dd8e3ae4996fc333609028d85654dc01177c5 /jstests | |
parent | 1183afb5c661d6fa34f69e75fb7c5d522bc1a8b9 (diff) | |
download | mongo-c574959c57f3f66dcdd41a244f08b687ca03480b.tar.gz |
shell helpers for turning on/off balancer SERVER-2680
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/sharding/shard3.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/jstests/sharding/shard3.js b/jstests/sharding/shard3.js index 71325637baf..0a4bc2ff75f 100644 --- a/jstests/sharding/shard3.js +++ b/jstests/sharding/shard3.js @@ -4,9 +4,18 @@ s = new ShardingTest( "shard3" , 2 , 1 , 2 ); s2 = s._mongos[1]; +db = s.getDB( "test" ) s.adminCommand( { enablesharding : "test" } ); s.adminCommand( { shardcollection : "test.foo" , key : { num : 1 } } ); +assert( sh.getBalancerState() , "A1" ) +sh.setBalancerState( false ) +assert( ! sh.getBalancerState() , "A2" ) +sh.setBalancerState( true ) +assert( sh.getBalancerState() , "A3" ) +sh.setBalancerState( false ) +assert( ! sh.getBalancerState() , "A4" ) + s.config.databases.find().forEach( printjson ) a = s.getDB( "test" ).foo; |