buyingyi | 55df521 | 2013-03-24 07:20:08 +0000 | [diff] [blame^] | 1 | hostname |
| 2 | |
| 3 | MY_NAME=`hostname` |
| 4 | #Get the IP address of the cc |
| 5 | CCHOST_NAME=`cat conf/master` |
| 6 | CURRENT_PATH=`pwd` |
| 7 | CCHOST=`ssh ${CCHOST_NAME} "cd ${CURRENT_PATH}; bin/getip.sh"` |
| 8 | |
| 9 | #Import cluster properties |
| 10 | . conf/cluster.properties |
| 11 | |
| 12 | #Clean up temp dir |
| 13 | |
| 14 | rm -rf $NCTMP_DIR |
| 15 | mkdir $NCTMP_DIR |
| 16 | |
| 17 | #Clean up log dir |
| 18 | rm -rf $NCLOGS_DIR |
| 19 | mkdir $NCLOGS_DIR |
| 20 | |
| 21 | |
| 22 | #Clean up I/O working dir |
| 23 | io_dirs=$(echo $IO_DIRS | tr "," "\n") |
| 24 | for io_dir in $io_dirs |
| 25 | do |
| 26 | rm -rf $io_dir |
| 27 | mkdir $io_dir |
| 28 | done |
| 29 | |
| 30 | #Set JAVA_HOME |
| 31 | export JAVA_HOME=$JAVA_HOME |
| 32 | |
| 33 | IPADDR=`bin/getip.sh` |
| 34 | #echo $IPADDR |
| 35 | |
| 36 | #Get node ID |
| 37 | NODEID=`hostname | cut -d '.' -f 1` |
| 38 | |
| 39 | #Set JAVA_OPTS |
| 40 | export JAVA_OPTS=$NCJAVA_OPTS |
| 41 | |
| 42 | cd $HYRACKS_HOME |
| 43 | HYRACKS_HOME=`pwd` |
| 44 | |
| 45 | #Enter the temp dir |
| 46 | cd $NCTMP_DIR |
| 47 | |
| 48 | #Launch hyracks nc |
| 49 | $HYRACKS_HOME/hyracks-server/target/appassembler/bin/hyracksnc -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}" &> $NCLOGS_DIR/$NODEID.log & |