buyingyi | 1341a16 | 2013-06-05 15:07:52 -0700 | [diff] [blame^] | 1 | #!/bin/bash |
| 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 | |
| 19 | hostname |
| 20 | |
| 21 | #Get the IP address of the cc |
| 22 | CCHOST_NAME=`cat conf/master` |
| 23 | CURRENT_PATH=`pwd` |
| 24 | CCHOST=`ssh ${CCHOST_NAME} "cd ${CURRENT_PATH}; bin/getip.sh"` |
| 25 | |
| 26 | #Import cluster properties |
| 27 | . conf/cluster.properties |
| 28 | . conf/debugnc.properties |
| 29 | |
| 30 | #Clean up temp dir |
| 31 | |
| 32 | rm -rf $NCTMP_DIR2 |
| 33 | mkdir $NCTMP_DIR2 |
| 34 | |
| 35 | #Clean up log dir |
| 36 | rm -rf $NCLOGS_DIR2 |
| 37 | mkdir $NCLOGS_DIR2 |
| 38 | |
| 39 | |
| 40 | #Clean up I/O working dir |
| 41 | io_dirs=$(echo $IO_DIRS2 | tr "," "\n") |
| 42 | for io_dir in $io_dirs |
| 43 | do |
| 44 | rm -rf $io_dir |
| 45 | mkdir $io_dir |
| 46 | done |
| 47 | |
| 48 | #Set JAVA_HOME |
| 49 | export JAVA_HOME=$JAVA_HOME |
| 50 | |
| 51 | #Get OS |
| 52 | IPADDR=`bin/getip.sh` |
| 53 | |
| 54 | #Get node ID |
| 55 | NODEID=`hostname | cut -d '.' -f 1` |
| 56 | NODEID=${NODEID}2 |
| 57 | |
| 58 | #Set JAVA_OPTS |
| 59 | export JAVA_OPTS=$NCJAVA_OPTS2 |
| 60 | |
| 61 | PREGELIX_HOME=`pwd` |
| 62 | |
| 63 | #Enter the temp dir |
| 64 | cd $NCTMP_DIR2 |
| 65 | |
| 66 | #Launch hyracks nc |
| 67 | #echo ${PREGELIX_HOME}/bin/pregelixnc -cc-host $CCHOST -cc-port $CC_CLUSTERPORT -cluster-net-ip-address $IPADDR -data-ip-address $IPADDR -result-ip-address $IPADDR -node-id $NODEID -iodevices "${IO_DIRS}" |
| 68 | ${PREGELIX_HOME}/bin/pregelixnc -cc-host $CCHOST -cc-port $CC_CLUSTERPORT -cluster-net-ip-address $IPADDR -data-ip-address $IPADDR -result-ip-address $IPADDR -node-id $NODEID -iodevices "${IO_DIRS2}" &> $NCLOGS_DIR2/$NODEID.log & |