root/other-projects/hathitrust/wcsa/extracted-features-solr/trunk/gslis-cluster/SCRIPTS/remote-mongodb-setup-local-disk-all.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
3unique_hosts=`echo $MONGODB_CONFIG_HOSTS $MONGODB_ROUTER_HOSTS $MONGODB_SHARD_HOSTS | tr ' ' '\n' | sed 's/:.*$//' | sort | uniq`
4
5#local_dir="/tmp/mongodb"
6local_dir="/hdfsd05/dbbridge/gslis-cluster/mongodb"
7local_dbdir="/hdfsd05/dbbridge/mongodb-databases"
8
9for mongodb_host in $unique_hosts ; do
10  remote_dir="$mongodb_host:$local_dir"
11
12  echo "Running rsync from networked MONGODB_HOME to $remote_dir"
13  ssh $mongodb_host "if [ ! -d $local_dir ] ; then mkdir $local_dir ; fi"
14  rsync -pav "$MONGODB_HOME/." "$remote_dir/."
15
16  ssh $mongodb_host "if [ ! -d $local_dbdir ] ; then mkdir $local_dbdir ; fi"
17##  ssh $mongodb_host "if [ ! -d $local_dbdir/config-metadata ] ; then mkdir $local_dbdir/config-metadata ; fi"
18
19done
Note: See TracBrowser for help on using the browser.