root/other-projects/hathitrust/wcsa/extracted-features-solr/trunk/gslis-cluster/SCRIPTS/remote-solr-start-all.sh @ 31785

Revision 31785, 1.4 KB (checked in by davidb, 23 months ago)

Change to allow solr command to optioanlly issue 'restart' instead of 'start'

  • Property svn:executable set to *
Line 
1#!/bin/bash
2
3solr_cmd=${1-start}
4
5if [ "x$SOLR_SHARDS" != "x" ] ; then
6    SOLR_NODES_ARRAY=($SOLR_NODES)
7    SOLR_SHARDS_ARRAY=($SOLR_SHARDS)
8
9    num_shards=${#SOLR_NODES_ARRAY[*]}
10   
11    i=0
12   
13    while [ $i -lt $num_shards ] ; do
14    solr_node=${SOLR_NODES_ARRAY[$i]}
15    solr_home_shard_dir=${SOLR_SHARDS_ARRAY[$i]}
16   
17    solr_host=${solr_node%:*}
18    solr_port=${solr_node##*:}
19
20    server_dir="/disk0/solr-server-$solr_host-$solr_port"
21   
22    export SOLR_HOME=
23    export SOLR_PID_DIR=
24    #export SOLR_PID_DIR="$solr_home_shard_dir"
25    echo "Starting solr cloud node on: $solr_host:$solr_port solr_home=$solr_home_shard_dir"
26    if [ "x$SOLR_JAVA_MEM" != "x" ] ; then
27        echo "=> SOLR_JAVA_MEM=$SOLR_JAVA_MEM"
28    fi
29    ssh $solr_host solr $solr_cmd -cloud -z $ZOOKEEPER_SERVER -h $solr_host -p $solr_port -d "$server_dir" -s "$solr_home_shard_dir"
30
31    i=$((i+1))
32    done
33else
34
35    run_from_local_disk=1
36
37    #local_dir="/tmp/solr-ef"
38    local_dir="/hdfsd05/dbbridge/solr-ef"
39
40
41    if [ $run_from_local_disk = "1" ] ; then
42    opt_s="-s $local_dir"
43    export SOLR_HOME=
44    echo "****"
45    echo "* Running solr from local disk: $local_dir"
46    echo "****"
47    else
48    opt_s=
49    fi
50   
51    for solr_node in $SOLR_NODES ; do
52    solr_host=${solr_node%:*}
53    solr_port=${solr_node##*:}
54   
55    echo "Starting solr cloud node on: $solr_host [port $solr_port]"
56    ssh $solr_host solr $solr_cmd -cloud -z $ZOOKEEPER_SERVER -h $solr_host -p $solr_port $opt_s
57    done
58fi
Note: See TracBrowser for help on using the browser.