Last change
on this file since 31307 was 31306, checked in by davidb, 7 years ago |
Final part of the mongodb shard puzzle -- router servers
|
-
Property svn:executable
set to
*
|
File size:
592 bytes
|
Line | |
---|
1 | #!/bin/bash
|
---|
2 |
|
---|
3 |
|
---|
4 | router_hosts_array=($MONGODB_ROUTER_HOSTS)
|
---|
5 | head_router_host=${router_hosts_array[0]}
|
---|
6 |
|
---|
7 |
|
---|
8 | col_init_syntax="db = db.getSiblingDB('htrc_ef') ; \
|
---|
9 | sh.enableSharding(\\\"htrc_ef\\\") ; \
|
---|
10 | db.volumes.ensureIndex( { _id : \\\"hashed\\\" } ) ; \
|
---|
11 | sh.shardCollection(\\\"htrc_ef.volumes\\\", { \\\"_id\\\": \\\"hashed\\\" } )"
|
---|
12 |
|
---|
13 | ssh $head_router_host "mongo --host localhost --port $MONGODB_ROUTER_PORT -eval \"$col_init_syntax\""
|
---|
14 |
|
---|
15 | # use htrc_ef;
|
---|
16 | # sh.enableSharding("htrc_ef")
|
---|
17 | # db.volumes.ensureIndex( { _id : "hashed" } )
|
---|
18 | # sh.shardCollection("htrc_ef.volumes", { "_id": "hashed" } ) |
---|
Note:
See
TracBrowser
for help on using the repository browser.