Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- md c:\data\cluster\config\c0 c:\data\cluster\config\c1 c:\data\cluster\config\c2
- md c:\data\cluster\shard0\m0 c:\data\cluster\shard0\m1 c:\data\cluster\shard0\arb
- md c:\data\cluster\shard1\m0 c:\data\cluster\shard1\m1 c:\data\cluster\shard1\arb
- md c:\data\cluster\shard2\m0 c:\data\cluster\shard2\m1 c:\data\cluster\shard2\arb
- md c:\data\cluster\s0 c:\data\cluster\s1
- rem ===========================================================================
- rem Shard 0 - Primary
- start mongod --replSet shard0 --smallfiles --nojournal --noprealloc --dbpath /data/cluster/shard0/m0 --logpath /data/cluster/shard0/m0/mongod.log --port 27107
- rem Shard 0 - Secondary
- start mongod --replSet shard0 --smallfiles --nojournal --noprealloc --dbpath /data/cluster/shard0/m1 --logpath /data/cluster/shard0/m1/mongod.log --port 27108
- rem Shard 0 - Árbitro
- start mongod --replSet shard0 --smallfiles --nojournal --noprealloc --dbpath /data/cluster/shard0/arb --logpath /data/cluster/shard0/arb/mongod.log --port 27109
- mongo --port 27107 --eval " rs.initiate(); sleep(3000); rs.add ('WIWI:27108'); rs.addArb('WIWI:27109')"
- rem ==========================================================================
- rem Shard 1 - Primary
- start mongod --replSet shard1 --smallfiles --nojournal --noprealloc --dbpath /data/cluster/shard1/m0 --logpath /data/cluster/shard1/m0/mongod.log --port 27117
- rem Shard 1 - Secondary
- start mongod --replSet shard1 --smallfiles --nojournal --noprealloc --dbpath /data/cluster/shard1/m1 --logpath /data/cluster/shard1/m1/mongod.log --port 27118
- rem Shard 1 - Árbitro
- start mongod --replSet shard1 --smallfiles --nojournal --noprealloc --dbpath /data/cluster/shard1/arb --logpath /data/cluster/shard1/arb/mongod.log --port 27119
- mongo --port 27117 --eval " rs.initiate(); sleep(3000); rs.add ('WIWI:27118'); rs.addArb('WIWI:27119')"
- rem ==========================================================================
- rem Shard 2 - Primary
- start mongod --replSet shard2 --smallfiles --nojournal --noprealloc --dbpath /data/cluster/shard2/m0 --logpath /data/cluster/shard2/m0/mongod.log --port 27127
- rem Shard 2 - Secondary
- start mongod --replSet shard2 --smallfiles --nojournal --noprealloc --dbpath /data/cluster/shard2/m1 --logpath /data/cluster/shard2/m1/mongod.log --port 27128
- rem Shard 2 - Árbitro
- start mongod --replSet shard2 --smallfiles --nojournal --noprealloc --dbpath /data/cluster/shard2/arb --logpath /data/cluster/shard2/arb/mongod.log --port 27129
- mongo --port 27127 --eval " rs.initiate(); sleep(3000); rs.add ('WIWI:27128'); rs.addArb('WIWI:27129')"
- rem ==========================================================================
- rem Config servers
- rem config1
- start mongod --smallfiles --nojournal --noprealloc --dbpath /data/cluster/config/c0 --logpath /data/cluster/config/c0/mongod.log --port 27227 --configsvr
- rem config2
- start mongod --smallfiles --nojournal --noprealloc --dbpath /data/cluster/config/c1 --logpath /data/cluster/config/c1/mongod.log --port 27228 --configsvr
- rem config3
- start mongod --smallfiles --nojournal --noprealloc --dbpath /data/cluster/config/c2 --logpath /data/cluster/config/c2/mongod.log --port 27229 --configsvr
- rem ==========================================================================
- rem mongos
- rem mongos1
- start mongos --logpath /data/cluster/s0/mongos.log --port 27017 --configdb WIWI:27227,WIWI:27228,WIWI:27229
- rem mongos2
- start mongos --logpath /data/cluster/s1/mongos.log --port 27018 --configdb WIWI:27227,WIWI:27228,WIWI:27229
- rem ==========================================================================
- echo 'sh.addShard( "shard0/WIWI:27107" ); sh.addShard("shard1/WIWI:27117" ); sh.addShard( "shard2/WIWI:27127" ); sh.status()' | mongo
- rem ==========================================================================
- echo 'sh.enableSharding("test"); \
- sh.shardCollection("test.testcol", { a : 1, b : 1 } )' | mongo
- return
- rem ==========================================================================
- for (i=0; i<10000; i++) {
- docArr = [];
- for (j=0; j<1000; j++) {
- docArr.push( { a : i, b : j, c : "Filler String 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" } )
- };
- db.testcol.insert(docArr) ;
- }
- rem ==========================================================================
- sh.status()
Advertisement
Add Comment
Please, Sign In to add comment