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

Revision 31305, 0.7 KB (checked in by davidb, 3 years ago)

Next good commit point. Initial testing of shard replset scripts

  • Property svn:executable set to *
Line 
1#!/bin/bash
2
3
4
5repl_set_core="htrc-ef"
6
7MONGODB_REPLSET_META_ARRAY=($MONGODB_REPLSET_METALIST)
8
9num_shards=${#MONGODB_REPLSET_META_ARRAY[*]}
10
11i=0
12while [ $i -lt $num_shards ]; do
13
14  replset_meta_hosts=${MONGODB_REPLSET_META_ARRAY[$i]}
15  eval replset_hosts="`echo \\$$replset_meta_hosts`"
16
17  for h in $replset_hosts ; do
18    echo "* Stopping MongoDB Replica-set Shard$i Server on $h:$MONGODB_REPLSET_PORT"
19    repl_set="$repl_set_core-shard$i"
20    repl_shard_dir="$MONGODB_DBDIR/$repl_set-$h"
21    ssh $h "mongo --host localhost --port $MONGODB_REPLSET_PORT -eval \"db.getSiblingDB('admin').shutdownServer()\""
22#    ssh $h "mongod --dbdir $repl_shard_dir --shutdown"
23  done
24
25  i=$((i+1))
26  echo ""
27done
28
29
Note: See TracBrowser for help on using the browser.