buyingyi | 98e9a9b | 2013-03-10 21:24:35 +0000 | [diff] [blame] | 1 | #!/bin/bash |
buyingyi | 80bb3cc | 2013-04-25 00:17:23 -0700 | [diff] [blame] | 2 | # |
| 3 | #------------------------------------------------------------------------ |
| 4 | # Copyright 2009-2013 by The Regents of the University of California |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # you may obtain a copy of the License from |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # ------------------------------------------------------------------------ |
| 17 | # |
| 18 | |
buyingyi | 98e9a9b | 2013-03-10 21:24:35 +0000 | [diff] [blame] | 19 | hostname |
| 20 | |
| 21 | #Import cluster properties |
| 22 | . conf/cluster.properties |
| 23 | |
| 24 | #Get the IP address of the cc |
| 25 | CCHOST_NAME=`cat conf/master` |
| 26 | CCHOST=`bin/getip.sh` |
| 27 | |
| 28 | #Remove the temp dir |
| 29 | rm -rf $CCTMP_DIR |
| 30 | mkdir $CCTMP_DIR |
| 31 | |
| 32 | #Remove the logs dir |
| 33 | rm -rf $CCLOGS_DIR |
| 34 | mkdir $CCLOGS_DIR |
| 35 | |
| 36 | #Export JAVA_HOME and JAVA_OPTS |
| 37 | export JAVA_HOME=$JAVA_HOME |
| 38 | export JAVA_OPTS=$CCJAVA_OPTS |
| 39 | |
buyingyi | 80bb3cc | 2013-04-25 00:17:23 -0700 | [diff] [blame] | 40 | HIVESTERIX_HOME=`pwd` |
| 41 | |
| 42 | #Enter the temp dir |
| 43 | cd $CCTMP_DIR |
| 44 | |
buyingyi | f2782a8 | 2013-03-23 10:57:43 +0000 | [diff] [blame] | 45 | if [ -f "conf/topology.xml" ]; then |
| 46 | #Launch hyracks cc script with topology |
buyingyi | 80bb3cc | 2013-04-25 00:17:23 -0700 | [diff] [blame] | 47 | ${HIVESTERIX_HOME}/bin/hivesterixcc -client-net-ip-address $CCHOST -cluster-net-ip-address $CCHOST -client-net-port $CC_CLIENTPORT -cluster-net-port $CC_CLUSTERPORT -max-heartbeat-lapse-periods 999999 -default-max-job-attempts 0 -job-history-size 0 -cluster-topology "conf/topology.xml" &> $CCLOGS_DIR/cc.log & |
buyingyi | f2782a8 | 2013-03-23 10:57:43 +0000 | [diff] [blame] | 48 | else |
| 49 | #Launch hyracks cc script without toplogy |
buyingyi | 80bb3cc | 2013-04-25 00:17:23 -0700 | [diff] [blame] | 50 | ${HIVESTERIX_HOME}/bin/hivesterixcc -client-net-ip-address $CCHOST -cluster-net-ip-address $CCHOST -client-net-port $CC_CLIENTPORT -cluster-net-port $CC_CLUSTERPORT -max-heartbeat-lapse-periods 999999 -default-max-job-attempts 0 -job-history-size 0 &> $CCLOGS_DIR/cc.log & |
buyingyi | f2782a8 | 2013-03-23 10:57:43 +0000 | [diff] [blame] | 51 | fi |