Last change
on this file since 31305 was 31305, checked in by davidb, 7 years ago |
Next good commit point. Initial testing of shard replset scripts
|
-
Property svn:executable
set to
*
|
File size:
703 bytes
|
Rev | Line | |
---|
[31305] | 1 | #!/bin/bash
|
---|
| 2 |
|
---|
| 3 |
|
---|
| 4 |
|
---|
| 5 | repl_set_core="htrc-ef"
|
---|
| 6 |
|
---|
| 7 | MONGODB_REPLSET_META_ARRAY=($MONGODB_REPLSET_METALIST)
|
---|
| 8 |
|
---|
| 9 | num_shards=${#MONGODB_REPLSET_META_ARRAY[*]}
|
---|
| 10 |
|
---|
| 11 | i=0
|
---|
| 12 | while [ $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 ""
|
---|
| 27 | done
|
---|
| 28 |
|
---|
| 29 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.