forked from MUGBerlin/vagrant-machines
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsteps.txt
40 lines (22 loc) · 841 Bytes
/
steps.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Connect to vgrant instance and to mongos
vagrant ssh configsrv
mongo --host configsrv.local --port 27019
Add the shards
sh.addShard( "shard01.local:27017" )
sh.addShard( "shard02.local:27017" )
sh.addShard( "shard03.local:27017" )
Set chunk size to something demo usable
use config
db.settings.save( { _id:"chunksize", value: 10 } )
Enable Sharding for wikipedia
sh.enableSharding("wikipedia")
Enable sharding on the collection
sh.shardCollection("wikipedia.articles", {_id: 1})
db.articles.ensureIndex({url: 1})
sh.shardCollection("wikipedia.articles", {url: 1})
db.articles.ensureIndex({title: 1})
sh.shardCollection("wikipedia.articles", {title: 1})
db.articles.ensureIndex({sKey: 1})
sh.shardCollection("wikipedia.articles", {sKey: 1})
Testdoc
db.articles.insert( {url: "http://foo.bar", title: "Test", text: "Test"} )