blob: 970c30b5e4cf240810b42d486e082811790eb610 [file] [log] [blame]
buyingyi1341a162013-06-05 15:07:52 -07001#!/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
19hostname
20
21MY_NAME=`hostname`
22#Get the IP address of the cc
23CCHOST_NAME=`cat conf/master`
24CURRENT_PATH=`pwd`
25CCHOST=`ssh ${CCHOST_NAME} "cd ${CURRENT_PATH}; bin/getip.sh"`
26
27#Import cluster properties
28. conf/cluster.properties
29
30#Clean up temp dir
31
32rm -rf $NCTMP_DIR
33mkdir $NCTMP_DIR
34
35#Clean up log dir
36rm -rf $NCLOGS_DIR
37mkdir $NCLOGS_DIR
38
39
40#Clean up I/O working dir
41io_dirs=$(echo $IO_DIRS | tr "," "\n")
42for io_dir in $io_dirs
43do
44 rm -rf $io_dir
45 mkdir $io_dir
46done
47
48#Set JAVA_HOME
49export JAVA_HOME=$JAVA_HOME
50
51IPADDR=`bin/getip.sh`
52#echo $IPADDR
53
54#Get node ID
55NODEID=`hostname | cut -d '.' -f 1`
56
57#Set JAVA_OPTS
58export JAVA_OPTS=$NCJAVA_OPTS
59
60PREGELIX_HOME=`pwd`
61
62#Enter the temp dir
63cd $NCTMP_DIR
64
65#Launch hyracks nc
66${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}" &> $NCLOGS_DIR/$NODEID.log &