root/other-projects/hathitrust/wcsa/extracted-features-solr/trunk/gslis-cluster/SCRIPTS/remote-mongodb-init-collection.sh @ 31307

Revision 31306, 0.6 KB (checked in by davidb, 3 years ago)

Final part of the mongodb shard puzzle -- router servers

  • Property svn:executable set to *
Line 
1#!/bin/bash
2
3
4router_hosts_array=($MONGODB_ROUTER_HOSTS)
5head_router_host=${router_hosts_array[0]}
6
7
8col_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
13ssh $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 browser.