read additional ports from .properties; launch multiple CC's on one machine(?)
diff --git a/genomix/genomix-driver/src/main/resources/conf/cluster.properties b/genomix/genomix-driver/src/main/resources/conf/cluster.properties
index 3feb919..a083848 100644
--- a/genomix/genomix-driver/src/main/resources/conf/cluster.properties
+++ b/genomix/genomix-driver/src/main/resources/conf/cluster.properties
@@ -1,11 +1,14 @@
#The CC port for Hyracks clients
+# don't change unless you want multiple CCs on one machine
CC_CLIENTPORT=3099
#The CC port for Hyracks cluster management
+# don't change unless you want multiple CCs on one machine
CC_CLUSTERPORT=1099
-#The directory of hyracks binaries
-HYRACKS_HOME="../../../../hyracks"
+#Sets the http port for the Cluster Controller (default: 16001)
+# don't change unless you want multiple CCs on one machine
+CC_HTTPPORT=16001
WORKPATH=""
#The tmp directory for cc to install jars
diff --git a/genomix/genomix-driver/src/main/resources/scripts/startcc.sh b/genomix/genomix-driver/src/main/resources/scripts/startcc.sh
index bd107c4..8f160b9 100755
--- a/genomix/genomix-driver/src/main/resources/scripts/startcc.sh
+++ b/genomix/genomix-driver/src/main/resources/scripts/startcc.sh
@@ -14,7 +14,7 @@
. conf/cluster.properties
#Get the IP address of the cc
CCHOST_NAME=`cat conf/master`
-CCHOST=`bin/getip.sh`
+CCHOST=`ssh -n ${CCHOST_NAME} "${GENOMIX_HOME}/bin/getip.sh"`
#Remove the temp dir
#rm -rf $CCTMP_DIR
@@ -30,15 +30,27 @@
cd $CCTMP_DIR
#Prepare cc script
-CMD="\"${GENOMIX_HOME}/bin/genomixcc\" -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 $JOB_HISTORY_SIZE"
+CMD="\"${GENOMIX_HOME}/bin/genomixcc\" -max-heartbeat-lapse-periods 999999 -default-max-job-attempts 0 -client-net-ip-address $CCHOST -cluster-net-ip-address $CCHOST"
+if [ -n "$CC_CLIENTPORT" ]; then
+ CMD="$CMD -client-net-port $CC_CLIENTPORT"
+fi
+if [ -n "$CC_CLUSTERPORT" ]; then
+ CMD="$CMD -cluster-net-port $CC_CLUSTERPORT"
+fi
+if [ -n "$CC_HTTPPORT" ]; then
+ CMD="$CMD -http-port $CC_HTTPPORT"
+fi
+if [ -n "$JOB_HISTORY_SIZE" ]; then
+ CMD="$CMD -job-history-size $JOB_HISTORY_SIZE"
+fi
if [ -f "${GENOMIX_HOME}/conf/topology.xml" ]; then
CMD="$CMD -cluster-topology \"${GENOMIX_HOME}/conf/topology.xml\""
fi
-#Launch hyracks cc script without toplogy
-printf "\n\n\n*******\n\nStarting CC with command %s\n" "$CMD" >> "$CCLOGS_DIR"/cc.log
-"$CMD" &>> "$CCLOGS_DIR"/cc.log &
+#Launch cc script
+printf "\n\n\n********************************************\nStarting CC with command %s\n\n" "$CMD" >> "$CCLOGS_DIR"/cc.log
+eval "$CMD &>> \"$CCLOGS_DIR\"/cc.log &"
# save the PID of the process we just launched
PID=$!
diff --git a/genomix/genomix-driver/src/main/resources/scripts/startnc.sh b/genomix/genomix-driver/src/main/resources/scripts/startnc.sh
index 448b17d..ea926e5 100755
--- a/genomix/genomix-driver/src/main/resources/scripts/startnc.sh
+++ b/genomix/genomix-driver/src/main/resources/scripts/startnc.sh
@@ -57,8 +57,12 @@
exit 1
fi
-#Launch hyracks nc
-"${GENOMIX_HOME}"/bin/$NCTYPE -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 &
+CMD="\"${GENOMIX_HOME}/bin/$NCTYPE\" -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}\""
+
+printf "\n\n\n********************************************\nStarting NC with command %s\n\n" "$CMD" >> "$NCLOGS_DIR"/$NODEID.log
+
+#Launch nc
+eval "$CMD &>> \"$NCLOGS_DIR\"/$NODEID.log &"
echo $! # write PID of bg'ed script