source: other-projects/hathitrust/wcsa/extracted-features-solr/trunk/gslis-cluster/SETUP.bash@ 31465

Last change on this file since 31465 was 31465, checked in by davidb, 7 years ago

Adjustment to run solr with more memory

File size: 4.7 KB
Line 
1
2short_hostname=`hostname -s`
3
4#export SPARK_MASTER_HOST=gchead
5export SPARK_MASTER_HOST=192.168.64.1
6
7export SPARK_MASTER_URL=spark://$SPARK_MASTER_HOST:7077
8export SPARK_SLAVE_HOSTS="gc0 gc1 gc2 gc3 gc4 gc5 gc6 gc7 gc8 gc9"
9
10if [ "$short_hostname" = "nema" ] ; then
11 export ZOOKEEPER_SERVER=localhost:8181
12 export SOLR_NODES="localhost:8983 localhost:8984 localhost:8985 localhost:8986 localhost:8987 localhost:8988 localhost:8989 localhost:8990 localhost:8991 localhost:8992"
13
14elif [ "${short_hostname%[1-2]}" = "solr" ] ; then
15 export ZOOKEEPER_SERVER=solr1:8181
16 export SOLR_NODES="solr1:8983 solr1:8984 solr1:8985 solr1:8986 solr1:8987"
17 export SOLR_NODES="$SOLR_NODES solr2:8983 solr2:8984 solr2:8985 solr2:8986 solr2:8987"
18 export SOLR_SHARDS="/disk0/solr-full-ef /disk1/solr-full-ef /disk2/solr-full-ef /disk3/solr-full-ef /disk4/solr-full-ef"
19 export SOLR_SHARDS="$SOLR_SHARDS /disk0/solr-full-ef /disk1/solr-full-ef /disk2/solr-full-ef /disk3/solr-full-ef /disk4/solr-full-ef"
20
21 export SOLR_JAVA_MEM="-Xms10g -Xmx15g"
22
23else
24 export ZOOKEEPER_SERVER=gchead:8181
25# export SOLR_NODES="gc0:8983 gc1:8983 gc2:8983 gc3:8983 gc4:8983 gc5:8983 gc6:8983 gc7:8983 gc8:8983 gc9:8983"
26# #export SOLR_NODES="$SOLR_NODES gc0:8984 gc1:8984 gc2:8984 gc3:8984 gc4:8984 gc5:8984 gc6:8984 gc7:8984 gc8:8984 gc9:8984"
27
28 export ZOOKEEPER_SERVER=solr1-s:8181
29 export SOLR_NODES="solr1-s:8983 solr1-s:8984 solr1-s:8985 solr1-s:8986 solr1-s:8987"
30 export SOLR_NODES="$SOLR_NODES solr2-s:8983 solr2-s:8984 solr2-s:8985 solr2-s:8986 solr2-s:8987"
31
32fi
33
34if [ "$short_hostname" != "nema" ] && [ "${short_hostname%[1-2]}" != "solr" ] ; then
35 HDFS_HEAD=hdfs://gchead:9000
36fi
37
38if [ "${short_hostname%[0-9]}" = "gc" ] ; then
39 export HTRC_EF_PACKAGE_HOME="/hdfsd05/dbbridge/gslis-cluster"
40else
41 export HTRC_EF_PACKAGE_HOME=`pwd`
42fi
43
44HTRC_EF_NETWORK_HOME=`pwd`
45
46if [ "$short_hostname" = "gsliscluster1" ] ; then
47 echo ""
48 echo "****"
49fi
50
51if [ "${short_hostname%[1-2]}" = "solr" ] ; then
52 export JAVA_HOME="/usr/lib/jvm/j2sdk1.8-oracle"
53else
54 export JAVA_HOME="$HTRC_EF_NETWORK_HOME/jdk1.8.0"
55fi
56
57export PATH="$JAVA_HOME/bin:$PATH"
58#export _JAVA_OPTIONS="-Xmx512m"
59#export _JAVA_OPTIONS="-Xmx1024m"
60#export _JAVA_OPTIONS="-Xmx2048m"
61export _JAVA_OPTIONS=
62#export _JAVA_OPTIONS="-XX:+HeapDumpOnOutOfMemoryError"
63
64if [ "$short_hostname" = "gsliscluster1" ] ; then
65 echo "* Added in JDK 1.8 into PATH"
66fi
67
68if [ "$short_hostname" != "nema" ] && [ "${short_hostname%[1-2]}" != "solr" ] ; then
69 source SETUP/setup-spark.bash
70fi
71
72source SETUP/setup-zookeeper.bash
73source SETUP/setup-solr.bash
74
75if [ "$short_hostname" = "gsliscluster1" ] ; then
76 export MONGODB_CONFIG_HOSTS="gc0 gc1 gc2"
77 export MONGODB_CONFIG_PORT="27019"
78
79 export MONGODB_ROUTER_HOSTS="gc3 gc4 gc5"
80 export MONGODB_ROUTER_PORT="27017"
81
82 export MONGODB_REPLSET1_HOSTS="gc6 gc7"
83 export MONGODB_REPLSET2_HOSTS="gc8 gc9"
84 export MONGODB_REPLSET_PORT="27017"
85 ##export MONGODB_REPLSET_ARRAY=("$MONGODB_REPLSET1_HOSTS" "$MONGODB_REPLSET2_HOSTS")
86 export MONGODB_REPLSET_METALIST="MONGODB_REPLSET1_HOSTS MONGODB_REPLSET2_HOSTS"
87 export MONGODB_SHARD_HOSTS="$MONGODB_REPLSET1_HOSTS $MONGODB_REPLSET2_HOSTS"
88
89 source SETUP/setup-mongodb.bash
90fi
91
92export PATH="$HTRC_EF_NETWORK_HOME/SCRIPTS:$PATH"
93if [ "$short_hostname" = "gsliscluster1" ] ; then
94 echo "* Added in HTRC EF PACKAGE remote scripting into PATH"
95fi
96
97if [ "$short_hostname" != "nema" ] && [ "${short_hostname%[1-2]}" != "solr" ] ; then
98 spark_conf_slaves="$SPARK_HOME/conf/slaves"
99 if [ ! -f "$spark_conf_slaves" ] ; then
100 echo "****"
101 echo "* Populatig $spark_conf_slaves"
102 echo "* With: $SPARK_SLAVE_HOSTS"
103 echo "****"
104 for s in $SPARK_SLAVE_HOSTS ; do
105 echo $s >> "$spark_conf_slaves"
106 done
107 else
108 slaves=`cat "$spark_conf_slaves" | tr '\n' ' '`
109 if [ "$short_hostname" = "gsliscluster1" ] ; then
110 echo "****"
111 echo "* Spark slaves: $slaves"
112 echo "****"
113 fi
114 fi
115fi
116
117
118zookeeper_config_file="$ZOOKEEPER_HOME/conf/zoo.cfg"
119zookeeper_data_dir="$ZOOKEEPER_HOME/data"
120
121if [ ! -f "$zookeeper_config_file" ] ; then
122 echo "****"
123 echo "* Generating $zookeeper_config_file"
124 cat CONF/zoo.cfg.in | sed "s%@zookeeper-data-dir@%$zookeeper_data_dir%g" > "$zookeeper_config_file"
125
126 if [ ! -d "$zookeeper_data_dir" ] ; then
127 echo "* Creating Zookeeper dataDir:"
128 echo "* $zookeeper_data_dir"
129 mkdir "$zookeeper_data_dir"
130 fi
131 echo "****"
132fi
133
134if [ "$short_hostname" = "gsliscluster1" ] ; then
135 echo "****"
136 echo "* Solr nodes: $SOLR_NODES"
137 echo "****"
138else
139
140 solr_configsets="$SOLR_TOP_LEVEL_HOME/server/solr/configsets"
141 if [ ! -d "$solr_configsets/htrc_configs" ] ; then
142 echo "Untarring htrc_configs.tar.gz in Solr configtests directory"
143 tar xvzf CONF/htrc_configs.tar.gz -C "$solr_configsets"
144 fi
145fi
Note: See TracBrowser for help on using the repository browser.