Ignore:
Timestamp:
2017-01-31T00:08:35+13:00 (5 years ago)
Author:
davidb
Message:

Changes made to operate on solr1 and solr2 boxes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/hathitrust/wcsa/extracted-features-solr/trunk/gslis-cluster/SCRIPTS/remote-solr-setup-local-disk-all.sh

    r31304 r31373  
    11#!/bin/bash
    22
    3 unique_hosts=`echo $SOLR_NODES | tr ' ' '\n' | sed 's/:.*$//' | sort | uniq`
     3if [ "x$SOLR_SHARDS" != "x" ] ; then
     4    SOLR_NODES_ARRAY=($SOLR_NODES)
     5    SOLR_SHARDS_ARRAY=($SOLR_SHARDS)
    46
    5 #local_dir="/tmp/solr-ef"
    6 local_dir1="/hdfsd05/dbbridge/solr-ef"
    7 local_dir2="/hdfsd05/dbbridge/gslis-cluster/solr/server/solr"
     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##*:}
    817
    9 for solr_host in $unique_hosts ; do
    10   remote_dir1="$solr_host:$local_dir1"
    11   remote_dir2="$solr_host:$local_dir2"
     18    remote_dir="$solr_host:$solr_home_shard_dir"
    1219
    13   echo "Running rsync from networked SOLR_HOME to $remote_dir1"
    14   ssh $solr_host "if [ ! -d $local_dir1 ] ; then mkdir $local_dir1 ; fi"
    15   rsync -pav "$SOLR_HOME/." "$remote_dir1/."
     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/."
    1623
    17   echo "Running rsync from networked SOLR_HOME to $remote_dir2"
    18   ssh $solr_host "if [ ! -d $local_dir2 ] ; then mkdir $local_dir2 ; fi"
    19   rsync -pav "$SOLR_HOME/." "$remote_dir2/."
    20 done
     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 TracChangeset for help on using the changeset viewer.