#!/bin/bash -x
# Copyright (c) 2014 Cloudera, Inc.
# Confidential Cloudera Information: Covered by NDA.

PROC_NAME=$1
MASTER_ADDRESS=$2

FLAG_FILE=tests/5nodes_test/$PROC_NAME.flags
echo 16777216 | sudo tee /proc/sys/vm/max_map_count
ulimit -c unlimited
BASE_DIR=$3/$PROC_NAME
DATA_DIR=$BASE_DIR/data
LOG_DIR=$BASE_DIR/glogs
mkdir -p $LOG_DIR

case $PROC_NAME in
kudu-master)
  DATA_DIR_OPTION="--master_wal_dir=$DATA_DIR --master_data_dirs=$DATA_DIR"
  MASTER_ADDRESS_OPT=--master_rpc_bind_addresses
  ;;
kudu-tablet_server)
  DATA_DIR_OPTION="--tablet_server_wal_dir=$DATA_DIR --tablet_server_data_dirs=$DATA_DIR"
  MASTER_ADDRESS_OPT=--tablet_server_master_addrs
  ;;
*)
  echo "Wrong process name"
  exit 1
  ;;
esac

./build/latest/$PROC_NAME -flagfile=$FLAG_FILE --webserver_doc_root=`pwd`/www \
                          $MASTER_ADDRESS_OPT=$MASTER_ADDRESS \
                          $DATA_DIR_OPTION --log_dir=$LOG_DIR &> $PROC_NAME.log &

PID=$!
echo $PID > $BASE_DIR/$PROC_NAME.pid
wait $PID
my_status=$?
echo $my_status > $PROC_NAME.ext

#!/bin/bash -x
# Copyright (c) 2014 Cloudera, Inc.
# Confidential Cloudera Information: Covered by NDA.

PROC_NAME=$1
MASTER_ADDRESS=$2

FLAG_FILE=tests/5nodes_test/$PROC_NAME.flags
echo 16777216 | sudo tee /proc/sys/vm/max_map_count
ulimit -c unlimited
DATA_DIR=$3/$PROC_NAME
LOG_DIR=$DATA_DIR/glogs
mkdir -p $LOG_DIR

case $PROC_NAME in
kudu-master)
  DATA_DIR_OPTION="--master_wal_dir=$DATA_DIR --master_data_dirs=$DATA_DIR"
  MASTER_ADDRESS_OPT=--master_rpc_bind_addresses
  ;;
kudu-tablet_server)
  DATA_DIR_OPTION="--tablet_server_wal_dir=$DATA_DIR --tablet_server_data_dirs=$DATA_DIR"
  MASTER_ADDRESS_OPT=--tablet_server_master_addrs
  ;;
*)
  echo "Wrong process name"
  exit 1
  ;;
esac

./build/latest/$PROC_NAME -flagfile=$FLAG_FILE --webserver_doc_root=`pwd`/www \
                          $MASTER_ADDRESS_OPT=$MASTER_ADDRESS \
                          $DATA_DIR_OPTION --log_dir=$LOG_DIR &> $PROC_NAME.log &

PID=$!
echo $PID > $DATA_DIR/$PROC_NAME.pid
wait $PID
my_status=$?
echo $my_status > $PROC_NAME.ext

--- 
+++ 
@@ -8,8 +8,9 @@
 FLAG_FILE=tests/5nodes_test/$PROC_NAME.flags
 echo 16777216 | sudo tee /proc/sys/vm/max_map_count
 ulimit -c unlimited
-DATA_DIR=$3/$PROC_NAME
-LOG_DIR=$DATA_DIR/glogs
+BASE_DIR=$3/$PROC_NAME
+DATA_DIR=$BASE_DIR/data
+LOG_DIR=$BASE_DIR/glogs
 mkdir -p $LOG_DIR
 
 case $PROC_NAME in
@@ -32,7 +33,7 @@
                           $DATA_DIR_OPTION --log_dir=$LOG_DIR &> $PROC_NAME.log &
 
 PID=$!
-echo $PID > $DATA_DIR/$PROC_NAME.pid
+echo $PID > $BASE_DIR/$PROC_NAME.pid
 wait $PID
 my_status=$?
 echo $my_status > $PROC_NAME.ext
Fix the cluster startup script to put data in its own dir

Without this, nothing starts.

Change-Id: I21d2fb4b606fade73b22e95130cdcbcc5450dd98
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/6553
Tested-by: Adar Dembo <866ca730bfc7f544e3ebce604ceeba4879f23df0@cloudera.com>
Reviewed-by: Adar Dembo <866ca730bfc7f544e3ebce604ceeba4879f23df0@cloudera.com>
