source: other-projects/hathitrust/wcsa/extracted-features-solr/trunk/gslis-cluster/SCRIPTS/remote-solr-setup-local-disk-all.sh@ 31373

Last change on this file since 31373 was 31373, checked in by davidb, 4 years ago

Changes made to operate on solr1 and solr2 boxes

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/bin/bash
2
3if [ "x$SOLR_SHARDS" != "x" ] ; then
4 SOLR_NODES_ARRAY=($SOLR_NODES)
5 SOLR_SHARDS_ARRAY=($SOLR_SHARDS)
6
7 num_shards=${#SOLR_NODES_ARRAY[*]}
8
9 i=0
10
11 while [ $i -lt $num_shards ] ; do
12 solr_node=${SOLR_NODES_ARRAY[$i]}
13 solr_home_shard_dir=${SOLR_SHARDS_ARRAY[$i]}
14
15 solr_host=${solr_node%:*}
16 solr_port=${solr_node##*:}
17
18 remote_dir="$solr_host:$solr_home_shard_dir"
19
20 echo "Running rsync from networked SOLR_HOME to $remote_dir"
21 ssh $solr_host "if [ ! -d $solr_home_shard_dir ] ; then mkdir $solr_home_shard_dir ; fi"
22 rsync -pav "$SOLR_HOME/." "$remote_dir/."
23
24 server_dir="/disk0/solr-server-$solr_host-$solr_port"
25 remote_server_dir="$solr_host:$server_dir"
26
27 echo "Running rsync from networked SOLR_HOME/server to $remote_server_dir"
28 ssh $solr_host "if [ ! -d $server_dir ] ; then mkdir $server_dir ; fi"
29 rsync -pav "$SOLR_TOP_LEVEL_HOME/server/." "$remote_server_dir/."
30
31 i=$((i+1))
32 done
33else
34
35 unique_hosts=`echo $SOLR_NODES | tr ' ' '\n' | sed 's/:.*$//' | sort | uniq`
36
37 #local_dir="/tmp/solr-ef"
38 local_dir1="/hdfsd05/dbbridge/solr-ef"
39 local_dir2="/hdfsd05/dbbridge/gslis-cluster/solr/server/solr"
40
41 for solr_host in $unique_hosts ; do
42 remote_dir1="$solr_host:$local_dir1"
43 remote_dir2="$solr_host:$local_dir2"
44
45 echo "Running rsync from networked SOLR_HOME to $remote_dir1"
46 ssh $solr_host "if [ ! -d $local_dir1 ] ; then mkdir $local_dir1 ; fi"
47 rsync -pav "$SOLR_HOME/." "$remote_dir1/."
48
49 echo "Running rsync from networked SOLR_HOME to $remote_dir2"
50 ssh $solr_host "if [ ! -d $local_dir2 ] ; then mkdir $local_dir2 ; fi"
51 rsync -pav "$SOLR_HOME/." "$remote_dir2/."
52 done
53fi
Note: See TracBrowser for help on using the repository browser.