-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsolr-start.sh
executable file
·52 lines (48 loc) · 1.21 KB
/
solr-start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
base=${0%/*};
SOLR_HOME=$base/solr-conf/
DEBUG_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044"
while getopts ":m:p:h" opt; do
case ${opt} in
m )
mem=$OPTARG
;;
p )
port=$OPTARG
;;
h)
echo "Usage: solr-start [-m] [-p]"
echo " -m Specify memory requirements for Solr"
echo " -p Specify port on which to run Solr"
exit 0;
;;
\? )
echo "Invalid option: $OPTARG"
exit 1;
;;
: )
echo "Invalid option: $OPTARG requires an argument"
;;
esac
done
# check SOLR_DIR has been set
if [ -z $SOLR_DIR ]
then
echo '$SOLR_DIR not set - please set this to the location of your Solr installation' >&2
exit 1;
else
if [ ${mem} ]
then
if [ ${port} ]
then
echo "Starting Solr using $SOLR_HOME, mem: $mem and port: $port"
$SOLR_DIR/bin/solr start -s $SOLR_HOME -m $mem -p $port
else
echo "Starting Solr using $SOLR_HOME, mem: $mem"
$SOLR_DIR/bin/solr start -s $SOLR_HOME -m $mem
fi
else
echo "Starting Solr using $SOLR_HOME"
$SOLR_DIR/bin/solr start -s $SOLR_HOME
fi
fi