root/other-projects/hathitrust/wcsa/extracted-features-solr/trunk/gslis-cluster/SETUP.bash @ 31305

Revision 31305, 3.6 KB (checked in by davidb, 3 years ago)

Next good commit point. Initial testing of shard replset scripts

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"
13else
14  export ZOOKEEPER_SERVER=gchead:8181
15  export SOLR_NODES="gc0:8983 gc1:8983 gc2:8983 gc3:8983 gc4:8983 gc5:8983 gc6:8983 gc7:8983 gc8:8983 gc9:8983"
16  #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"
17fi
18
19if [ "$short_hostname" != "nema" ] ; then
20  HDFS_HEAD=hdfs://gchead:9000
21fi
22
23if [ "${short_hostname%[0-9]}" = "gc" ] ; then
24  export HTRC_EF_PACKAGE_HOME="/hdfsd05/dbbridge/gslis-cluster"
25else
26  export HTRC_EF_PACKAGE_HOME=`pwd`
27fi
28
29HTRC_EF_NETWORK_HOME=`pwd`
30
31if [ "$short_hostname" = "gsliscluster1" ] ; then
32  echo ""
33  echo "****"
34fi
35
36export JAVA_HOME="$HTRC_EF_NETWORK_HOME/jdk1.8.0"
37export PATH="$JAVA_HOME/bin:$PATH"
38#export _JAVA_OPTIONS="-Xmx512m"
39#export _JAVA_OPTIONS="-Xmx1024m"
40#export _JAVA_OPTIONS="-Xmx2048m"
41export _JAVA_OPTIONS=
42#export _JAVA_OPTIONS="-XX:+HeapDumpOnOutOfMemoryError"
43
44if [ "$short_hostname" = "gsliscluster1" ] ; then
45  echo "* Added in JDK 1.8 into PATH"
46fi
47
48if [ "$short_hostname" != "nema" ] ; then
49  source SETUP/setup-spark.bash
50fi
51
52source SETUP/setup-zookeeper.bash
53source SETUP/setup-solr.bash
54
55export MONGODB_CONFIG_HOSTS="gc0 gc1 gc2"
56export MONGODB_CONFIG_PORT="27019"
57
58export MONGODB_ROUTER_HOSTS="gc3 gc4 gc5"
59export MONGODB_ROUTER_PORT="27017"
60
61export MONGODB_REPLSET1_HOSTS="gc6 gc7"
62export MONGODB_REPLSET2_HOSTS="gc8 gc9"
63export MONGODB_REPLSET_PORT="27017"
64##export MONGODB_REPLSET_ARRAY=("$MONGODB_REPLSET1_HOSTS" "$MONGODB_REPLSET2_HOSTS")
65export MONGODB_REPLSET_METALIST="MONGODB_REPLSET1_HOSTS MONGODB_REPLSET2_HOSTS"
66export MONGODB_SHARD_HOSTS="$MONGODB_REPLSET1_HOSTS $MONGODB_REPLSET2_HOSTS"
67
68source SETUP/setup-mongodb.bash
69
70export PATH="$HTRC_EF_NETWORK_HOME/SCRIPTS:$PATH"
71if [ "$short_hostname" = "gsliscluster1" ] ; then
72  echo "* Added in HTRC EF PACKAGE remote scripting into PATH"
73fi
74
75if [ "$short_hostname" != "nema" ] ; then
76  spark_conf_slaves="$SPARK_HOME/conf/slaves"
77  if [ ! -f "$spark_conf_slaves" ] ; then
78    echo "****"
79    echo "* Populatig $spark_conf_slaves"
80    echo "* With: $SPARK_SLAVE_HOSTS"
81    echo "****"
82    for s in $SPARK_SLAVE_HOSTS ; do
83      echo $s >> "$spark_conf_slaves"
84    done
85  else
86    slaves=`cat "$spark_conf_slaves" | tr '\n' ' '`
87    if [ "$short_hostname" = "gsliscluster1" ] ; then
88      echo "****"
89      echo "* Spark slaves: $slaves"
90      echo "****"
91    fi
92  fi
93fi
94
95
96zookeeper_config_file="$ZOOKEEPER_HOME/conf/zoo.cfg"
97zookeeper_data_dir="$ZOOKEEPER_HOME/data"
98
99if [ ! -f "$zookeeper_config_file" ] ; then
100  echo "****"
101  echo "* Generating $zookeeper_config_file"
102  cat CONF/zoo.cfg.in | sed "s%@zookeeper-data-dir@%$zookeeper_data_dir%g" > "$zookeeper_config_file"
103
104  if [ ! -d "$zookeeper_data_dir" ] ; then
105    echo "* Creating Zookeeper dataDir:"
106    echo "*   $zookeeper_data_dir"
107    mkdir "$zookeeper_data_dir"
108  fi
109  echo "****"
110fi
111
112if [ "$short_hostname" = "gsliscluster1" ] ; then
113  echo "****"
114  echo "* Solr nodes: $SOLR_NODES"
115  echo "****"
116else
117  solr_configsets="$SOLR_TOP_LEVEL_HOME/server/solr/configsets"
118  if [ ! -d "$solr_configsets/htrc_configs" ] ; then
119    echo "Untarring htrc_configs.tar.gz in Solr configtests directory"
120    tar xvzf CONF/htrc_configs.tar.gz -C "$solr_configsets"
121  fi
122fi
Note: See TracBrowser for help on using the browser.