trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbirds...@apache.org
Subject [01/14] incubator-trafodion git commit: -Eliminated installing trafodion components along with install_local_hadoop -Added a new script to install trafodion components (install_traf_components) -Modifed core 'makefile' so dcs gets built along with 'core'
Date Wed, 30 Sep 2015 16:39:27 GMT
Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 91cd23464 -> 469408f8e


-Eliminated installing trafodion components along with install_local_hadoop
-Added a new script to install trafodion components (install_traf_components)
-Modifed core 'makefile' so dcs gets built along with 'core'
-Introduced a new makefile at the top level


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/0b1fce25
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/0b1fce25
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/0b1fce25

Branch: refs/heads/master
Commit: 0b1fce255c4697db6400ea50b8ad36e7e99a843c
Parents: cef0573
Author: Anuradha Hegde <hegdean@dev01.trafodion.org>
Authored: Thu Sep 17 06:18:17 2015 +0000
Committer: Anuradha Hegde <hegdean@dev01.trafodion.org>
Committed: Thu Sep 17 06:18:17 2015 +0000

----------------------------------------------------------------------
 Makefile                                        |  20 ++
 core/Makefile                                   |  27 +-
 core/conn/Makefile                              |   6 +-
 .../unixcli/package/trafodbclnx_install.sh      |   5 -
 core/macros.gmk                                 |   1 +
 core/rest/Makefile                              |   4 +
 core/sqf/Makefile                               |  15 +-
 core/sqf/sql/scripts/dcscheck                   | 105 +++++-
 core/sqf/sql/scripts/install_local_hadoop       | 259 +-------------
 core/sqf/sql/scripts/install_traf_components    | 349 +++++++++++++++++++
 env.sh                                          |   3 +
 11 files changed, 522 insertions(+), 272 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0b1fce25/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..ddfd578
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,20 @@
+
+all: 
+	echo "Building all Trafodion components"
+	cd core && $(MAKE) all 
+
+package: all
+	echo "Packaging Trafodion components"
+	cd core && $(MAKE) package 
+
+package-all: package
+	echo "Packaging all Trafodion components"
+	cd core && $(MAKE) package-all 
+
+clean: 
+	echo "Removing Trafodion objects"
+	cd core && $(MAKE) clean 
+
+cleanall: 
+	echo "Removing all Trafodion objects"
+	cd core && $(MAKE) cleanall 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0b1fce25/core/Makefile
----------------------------------------------------------------------
diff --git a/core/Makefile b/core/Makefile
index 3bf60c5..3d845d8 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -27,15 +27,15 @@
 include macros.gmk
 
 # Make Targets
-.PHONY: all dbsecurity foundation $(MPI_TARGET) ndcs ci jdbc_jar jdbc_type2_jar sqroot $(SEAMONSTER_TARGET)
verhdr rest odb
-.PHONY: package package-all pkg-product pkg-sql-regress check-copyrights
+.PHONY: all dbsecurity foundation $(MPI_TARGET) ndcs ci jdbc_jar jdbc_type2_jar sqroot $(SEAMONSTER_TARGET)
verhdr dcs rest odb
+.PHONY: package package-all pkg-product pkg-sql-regress pkg-phx-tests check-copyrights
 
 ################
 ### Main targets
 # Server-side only
 
 # Default target (all components)
-all: $(MPI_TARGET) dbsecurity foundation jdbc_jar $(SEAMONSTER_TARGET) ndcs ci jdbc_type2_jar
rest odb
+all: $(MPI_TARGET) dbsecurity foundation jdbc_jar $(SEAMONSTER_TARGET) ndcs ci jdbc_type2_jar
dcs rest odb
 
 package: pkg-product pkg-client
 
@@ -69,10 +69,15 @@ foundation: dbsecurity $(MPI_TARGET) $(SEAMONSTER_TARGET)
 
 jdbc_jar: verhdr
 	cd conn/jdbc_type4 && $(ANT) deploy 2>&1 | sed -e "s/$$/	##(JDBCT4)/";exit
$${PIPESTATUS[0]}
-	mvn install:install-file -Dfile=conn/jdbc_type4/lib/jdbcT4.jar \
+	$(MAVEN) install:install-file -Dfile=conn/jdbc_type4/lib/jdbcT4.jar \
 	    -DgroupId=org.trafodion.jdbc.t4.T4Driver -DartifactId=t4driver -Dversion="$$TRAFODION_VER"
\
 	    -Dpackaging=jar -DgeneratePom=true | sed -e "s/$$/        ##(JDBCT4)/";exit $${PIPESTATUS[0]}
 
+dcs: verhdr jdbc_jar
+	cd ../dcs && $(MAVEN) site package 2>&1 | sed -e "s/$$/        ##(DCS)/";exit
$${PIPESTATUS[0]}
+	mkdir -p ../${DISTRIBUTION_DIR}
+	mv ../dcs/target/dcs*.gz ../${DISTRIBUTION_DIR}/ | sed -e "s/$$/  ##(DCS)/" ; exit $${PIPESTATUS[0]}
+
 ndcs: jdbc_jar foundation
 	cd conn/odbc/src/odbc && $(MAKE) ndcs        2>&1 | sed -e "s/$$/	##(NDCS)/";exit
$${PIPESTATUS[0]}
 	cd conn/odbc/src/odbc && $(MAKE) bldlnx_drvr 2>&1 | sed -e "s/$$/	##(NDCS)/";exit
$${PIPESTATUS[0]}
@@ -84,7 +89,7 @@ trafci: jdbc_jar
 jdbc_type2_jar: ndcs
 	cd conn/jdbc_type2 && $(ANT)  2>&1 | sed -e "s/$$/	##(JDBC_TYPE2)/" ; exit
$${PIPESTATUS[0]}
 	cd conn/jdbc_type2 && $(MAKE) 2>&1 | sed -e "s/$$/	##(JDBC_TYPE2)/" ; exit
$${PIPESTATUS[0]}
-	mvn install:install-file -Dfile=conn/jdbc_type2/dist/jdbcT2.jar \
+	$(MAVEN) install:install-file -Dfile=conn/jdbc_type2/dist/jdbcT2.jar \
 	    -DgroupId=org.trafodion.jdbc.t2.T2Driver -DartifactId=t2driver -Dversion="$$TRAFODION_VER"
\
 	    -Dpackaging=jar -DgeneratePom=true | sed -e "s/$$/        ##(JDBC_TYPE2)/";exit $${PIPESTATUS[0]}
 
@@ -106,6 +111,8 @@ clean: sqroot
 	cd conn/jdbc_type2 &&		$(ANT) clean && $(MAKE) clean
 	cd rest &&			$(MAKE) clean
 	cd conn/odb &&			$(MAKE) clean
+	cd ../dcs &&			$(MAVEN) clean 
+	$(RM) -r ../${DISTRIBUTION_DIR}
 
 cleanall: sqroot
 	cd $(MPI_TARGET) &&		$(MAKE) clean-local
@@ -118,8 +125,10 @@ cleanall: sqroot
 	cd conn/jdbc_type2 &&	        $(ANT) clean && $(MAKE) clean
 	cd rest &&			$(MAKE) clean
 	cd conn/odb &&			$(MAKE) clean
+	cd ../dcs &&			$(MAVEN) clean
+	$(RM) -r ../${DISTRIBUTION_DIR}
 
-package-all: package pkg-sql-regress
+package-all: package pkg-sql-regress pkg-phx-tests
 
 pkg-product: all  
 	cd sqf && $(MAKE) package 2>&1 | sed -e "s/$$/	##(Package)/";exit $${PIPESTATUS[0]}
@@ -129,7 +138,11 @@ pkg-client: ci ndcs odb
 
 # Package SQL regression tests (all target produces some regress/tool files so do that first)
 pkg-sql-regress: all
-	cd sqf && $(MAKE) package-regress 2>&1 | sed -e "s/$$/	##(Package)/";exit
$${PIPESTATUS[0]}
+	cd sqf && $(MAKE) package-regress 2>&1 | sed -e "s/$$/	##(Package sql regress)/";exit
$${PIPESTATUS[0]}
+
+# Package Phoenix test
+pkg-phx-tests: all
+	cd sqf && $(MAKE) package-phx 2>&1 | sed -e "s/$$/	##(Package phoenix)/";exit
$${PIPESTATUS[0]}
 
 version:
 	@cd sqf; unset SQ_VERBOSE; source sqenv.sh ; echo "$${TRAFODION_VER}"

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0b1fce25/core/conn/Makefile
----------------------------------------------------------------------
diff --git a/core/conn/Makefile b/core/conn/Makefile
index 4fc88ac..468f0b7 100644
--- a/core/conn/Makefile
+++ b/core/conn/Makefile
@@ -21,13 +21,13 @@
 #
 # Makefile for packaging client products
 
-include $(MY_SQROOT)/macros.gmk #top level
+include ../macros.gmk #top level
 
 RM      = /bin/rm
 ifeq ($(SQ_BUILD_TYPE),release)
-  CLIENT_TAR	?= $(MY_SQROOT)/../trafodion_clients-$(TRAFODION_VER).tgz
+  CLIENT_TAR	?= ../../${DISTRIBUTION_DIR}/trafodion_clients-$(TRAFODION_VER).tgz
 else
-  CLIENT_TAR	?= $(MY_SQROOT)/../trafodion_clients-$(TRAFODION_VER)-debug.tgz
+  CLIENT_TAR	?= ../../${DISTRIBUTION_DIR}/trafodion_clients-$(TRAFODION_VER)-debug.tgz
 endif
 
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0b1fce25/core/conn/unixodbc/odbc/odbcclient/unixcli/package/trafodbclnx_install.sh
----------------------------------------------------------------------
diff --git a/core/conn/unixodbc/odbc/odbcclient/unixcli/package/trafodbclnx_install.sh b/core/conn/unixodbc/odbc/odbcclient/unixcli/package/trafodbclnx_install.sh
index 47de77f..fc0c3f7 100644
--- a/core/conn/unixodbc/odbc/odbcclient/unixcli/package/trafodbclnx_install.sh
+++ b/core/conn/unixodbc/odbc/odbcclient/unixcli/package/trafodbclnx_install.sh
@@ -109,11 +109,6 @@ function do_prompt {
 }
 
 function verify_dir {
-    echo $1 | /bin/grep "^/.*" > /dev/null 2>&1
-    if [ $? -ne 0 ]; then
-        echo -e "\n** error!  path name must begin with a '/'."
-        return 1
-    fi
     if ! [ -d $1 ]; then 
 	mkdir -p $1
 	if [[ $? != 0 ]]; then

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0b1fce25/core/macros.gmk
----------------------------------------------------------------------
diff --git a/core/macros.gmk b/core/macros.gmk
index 1a92723..c81f816 100644
--- a/core/macros.gmk
+++ b/core/macros.gmk
@@ -22,3 +22,4 @@
 # Current code values not configurable
 MPI_TARGET=mpi
 SEAMONSTER_TARGET=seamonster
+DISTRIBUTION_DIR=distribution

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0b1fce25/core/rest/Makefile
----------------------------------------------------------------------
diff --git a/core/rest/Makefile b/core/rest/Makefile
index 76226d5..a4b4c79 100644
--- a/core/rest/Makefile
+++ b/core/rest/Makefile
@@ -21,6 +21,7 @@
 
 # This Makefile is just a thin shell to Maven, which is used to do the real build
 
+include ../macros.gmk #top level
 BLD_TRAFODION_REST_TARNAME           =rest-$(TRAFODION_VER).tar.gz
 
 VFILE			    =trafodion-rest.jar.versions
@@ -35,6 +36,8 @@ build_all:
 	echo "$(MAVEN) site package -DskipTests"
 	echo "### For full Maven output, see file build_rest.log"
 	set -o pipefail && $(MAVEN) site package -DskipTests | tee build_rest.log | grep
--line-buffered -E -e '^\[[^WId]' -e '^\[INFO\] B[Uu][Ii][Ll][Dd]' -e 'to compile'
+	mkdir -p ../../${DISTRIBUTION_DIR}
+	mv target/$(BLD_TRAFODION_REST_TARNAME) ../../${DISTRIBUTION_DIR}/
 	$(RM) $(VFILE)
 
 build_chk:
@@ -46,3 +49,4 @@ clean:
 	-$(MAVEN) clean | grep ERROR
 	$(RM) build_rest.log
 	$(RM) $(VFILE)
+	$(RM) ../../${DISTRIBUTION_DIR}/$(BLD_TRAFODION_REST_TARNAME)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0b1fce25/core/sqf/Makefile
----------------------------------------------------------------------
diff --git a/core/sqf/Makefile b/core/sqf/Makefile
index c3c917a..dafa12b 100644
--- a/core/sqf/Makefile
+++ b/core/sqf/Makefile
@@ -246,6 +246,7 @@ genverhdr:
                                         -date "${PV_DATE}"
 
 PKG_PROD = trafodion
+PKG_PHX = phoenix
 
 ifeq ($(SQ_BUILD_TYPE),release)
   PKG_TYPE="server-$(TRAFODION_VER)"
@@ -253,12 +254,12 @@ else
   PKG_TYPE="server-$(TRAFODION_VER)-debug"
 endif
 
-
 PKG_BIN ?= "${PKG_PROD}.bin"
-PKG_TAR ?= "../${PKG_PROD}_$(PKG_TYPE).tgz"
+PKG_TAR ?= "../../${DISTRIBUTION_DIR}/${PKG_PROD}_$(PKG_TYPE).tgz"
 PKG_TAR_UN = "${PKG_PROD}_${SQ_BUILD_TYPE}.tar"
-SRC_PKG_BIN ?= "../${PKG_PROD}-src.bin"
-SRC_PKG_TAR ?= "../${PKG_PROD}-src.tgz"
+SRC_PKG_BIN ?= "../../${DISTRIBUTION_DIR}/${PKG_PROD}-src.bin"
+SRC_PKG_TAR ?= "../../${DISTRIBUTION_DIR}/${PKG_PROD}-src.tgz"
+PKG_PHX_TAR ?= "../../${DISTRIBUTION_DIR}/${PKG_PHX}-tests.tgz"
 
 PKG_BIN_OBJS ?= export/bin$(SQ_MBTYPE) export/include export/lib export/lib$(SQ_MBTYPE) export/share
gdb sql/scripts sqenvcom.sh opt tools conf src/seatrans/hbase-trx hbase_utilities/backup_and_restore
 
@@ -273,7 +274,7 @@ PKG_REGRESS_OBJS ?= $(SQL_W)/regress inc/seaquest/sqtypes.h inc/fs/feerrors.h
$(
 REGRESS_EXCLUDE_FILES = "--exclude=$(SQL_W)/regress/seabase"
 REGRESS_EXCLUDE_FILES =
 
-PKG_REGRESS_TAR ?= "../${PKG_PROD}-regress.tgz"
+PKG_REGRESS_TAR ?= "../../${DISTRIBUTION_DIR}/${PKG_PROD}-regress.tgz"
 
 
 # Package SeaMonster kernel module
@@ -281,6 +282,7 @@ SEAMONSTER_TAR ?= "seamonster_${SQ_BUILD_TYPE}-src.tar.gz"
 
 #	Targets to tar/gzip the tree
 package: pkglist-files pkglist-symlinks tmp/sqenv.sh
+	mkdir -p ../../${DISTRIBUTION_DIR}
 	chmod o-rwx $(PKG_BIN_DIRS)
 	chmod -R o-rwx $(PKG_BIN_OBJS)
 	tar --mode o-rwx --no-recursion -chf $(PKG_TAR_UN) -X build-scripts/package.exclude -X build-scripts/package.exclude.$(SQ_MBTYPE)
-T pkglist-files
@@ -326,6 +328,9 @@ srcpackage:
 package-regress:
 	tar chzf $(PKG_REGRESS_TAR) -X build-scripts/package.exclude $(REGRESS_EXCLUDE_FILES) $(PKG_REGRESS_OBJS)
 
+#	Targets to tar/gzip the phoenix tests
+package-phx:
+	tar chzf $(PKG_PHX_TAR) ../../tests/phx 
 
 #	Targets to tar/gzip the self installer with sources
 srcpackagebin:

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0b1fce25/core/sqf/sql/scripts/dcscheck
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/dcscheck b/core/sqf/sql/scripts/dcscheck
index 23a7f1e..8539786 100755
--- a/core/sqf/sql/scripts/dcscheck
+++ b/core/sqf/sql/scripts/dcscheck
@@ -20,8 +20,84 @@
 
 dcsznode=/$USER/dcs/master
 dcstmp=/tmp/dcstmp-$USER.log
+jpscmd=$JAVA_HOME/bin/jps
+cfg_mxo_cnt=0
+act_mxo_cnt=0
+down_mxo_cnt=0
+backup_dcsmaster_cnt=0
+cfg_dcsmaster_cnt=0
+actual_dcsmaster_cnt=0
+down_dcsmaster_cnt=0
+cfg_dcsserver_cnt=0
+actual_dcsserver_cnt=0
+down_dcsserver_cnt=0
 
-if [ -d $DCS_INSTALL_DIR ];then
+tmp_ps=`mktemp -t`
+if [[ $? != 0 ]]; then
+    echo "Error while getting a temporary file. Exiting."
+    exit 3
+fi
+tmp_chk=`mktemp -t`
+if [[ $? != 0 ]]; then
+    echo "Error while getting a temporary file. Exiting."
+    exit 3
+fi
+
+echo
+#Check if Trafodion is up and running
+sqcheck -f > $tmp_chk 2>&1
+sq_stat=$?
+if [[ $sq_stat == 0 ]]; then
+
+ if [ -d $DCS_INSTALL_DIR ];then
+
+### Get the configured number of DcsMaster's
+  if [ -s ${DCS_INSTALL_DIR}/conf/backup-masters ]; then
+     let backup_dcsmaster_cnt=`/bin/egrep -cv '#|^$' ${DCS_INSTALL_DIR}/conf/backup-masters`
+     let cfg_dcsmaster_cnt=$backup_dcsmaster_cnt+1
+   else
+     let cfg_dcsmaster_cnt=1
+   fi
+
+### Get the configured number of DcsServer and mxosrvr
+   if [ -f ${DCS_INSTALL_DIR}/conf/servers ]; then
+      let cfg_mxo_cnt=`cat $DCS_INSTALL_DIR/conf/servers|awk '{if ($2=="") k=1;else k=$2;cnt+=k}
END {print cnt}'`
+      let cfg_dcsserver_cnt=`cat $DCS_INSTALL_DIR/conf/servers|awk '{if ($2=="") p=1;else
p+=1;} END {print p}'`
+   fi
+
+### Check if there are any DcsMaster and DcsServer's that are started 
+   if [ -e $SQ_PDSH ]; then
+     actual_dcsmaster_cnt=`$SQ_PDSH $MY_NODES $jpscmd |grep DcsMaster |wc -l` 
+     actual_dcsserver_cnt=`$SQ_PDSH $MY_NODES $jpscmd |grep DcsServer |wc -l` 
+   else
+     actual_dcsmaster_cnt=`$jpscmd |grep DcsMaster |wc -l`
+     actual_dcsserver_cnt=`$jpscmd |grep DcsServer |wc -l`
+   fi
+
+   if ( [ "$cfg_dcsserver_cnt" '!=' "$actual_dcsserver_cnt" ] ); then
+     let down_dcsserver_cnt=cfg_dcsserver_cnt-actual_dcsserver_cnt
+   else
+     down_dcsserver_cnt=''
+   fi
+
+   if ( [ "$cfg_dcsmaster_cnt" '!=' "$actual_dcsmaster_cnt" ] ); then
+     let down_dcsmaster_cnt=cfg_dcsmaster_cnt-actual_dcsmaster_cnt
+   else
+     down_dcsmaster_cnt=''
+   fi
+
+### Get the current process status (all processes)
+  sqps > $tmp_ps 2>&1
+
+### Get the actual number of mxosrvrs
+  let act_mxo_cnt=`< $tmp_ps egrep -a -i ' mxosrvr' | wc -l`
+  if ( [ "$cfg_mxo_cnt" '!=' "$act_mxo_cnt" ] ); then 
+    let down_mxo_cnt=cfg_mxo_cnt-act_mxo_cnt
+  else
+    down_mxo_cnt=''
+  fi 
+
+  if ( [ "$actual_dcsmaster_cnt" '!=' 0 ] && [ "$actual_dcsserver_cnt" '!=' 0 ] );
then
    echo "ls $dcsznode"|$DCS_INSTALL_DIR/bin/dcs zkcli > $dcstmp
    zkport=`cat $dcstmp | /usr/bin/head -n 1 | cut -d ":" -f2`
    if [ ! -z "$zkport" ]; then
@@ -32,13 +108,28 @@ if [ -d $DCS_INSTALL_DIR ];then
    fi
    masterport=`cat $dcstmp | /usr/bin/tail -n 1 | cut -d ":" -f4`
    if [ ! -z "$masterport" ]; then
-     echo "Dcs Master is listening on port $masterport"
-   else
-     echo "Dcs Master is not started ..."
-     exit 1
+     echo "DcsMaster is listening on port $masterport"
+     echo
    fi
    rm -f $dcstmp
-else
-   echo "DCS is not installed..."
+  else
+   if ( [ "$actual_dcsmaster_cnt" '>' 0 ] || [ "$actual_dcsserver_cnt" '>' 0 ] ); then
+     echo "Partial DCS process is up and running. Please stop and restart DCS using 'dcsstop'
and 'dcsstart' command..."
+    else
+     echo "DcsMaster is not started. Please start DCS using 'dcsstart' command..."
+   fi
+   echo
+  fi
+  echo -e "Process\t\tConfigured\tActual\t\tDown"
+  echo -e "---------\t----------\t------\t\t----"
+  echo -e "DcsMaster\t$cfg_dcsmaster_cnt\t\t$actual_dcsmaster_cnt\t\t$down_dcsmaster_cnt"
+  echo -e "DcsServer\t$cfg_dcsserver_cnt\t\t$actual_dcsserver_cnt\t\t$down_dcsserver_cnt"
+  echo -e "mxosrvr\t\t$cfg_mxo_cnt\t\t$act_mxo_cnt\t\t$down_mxo_cnt\n"
+ else
+   echo "DCS is not installed. Please install and configure DCS..."
    exit 1
+ fi
+else
+ echo "Trafodion is not started..."
+ echo
 fi

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0b1fce25/core/sqf/sql/scripts/install_local_hadoop
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/install_local_hadoop b/core/sqf/sql/scripts/install_local_hadoop
index 44d2555..e789519 100755
--- a/core/sqf/sql/scripts/install_local_hadoop
+++ b/core/sqf/sql/scripts/install_local_hadoop
@@ -51,21 +51,6 @@
 # also set http_proxy and ftp_proxy if necessary, to download
 # files from repositories on the Internet
 #
-# DCS to use. This list is in order of precedent.
-# DCS_TAR - Optionally specify a local tar file to use
-# DCS_URL - Optionally specify a URL to download
-# DCS_SRC - Optionally specify a local source tree to use
-# If none specified, download latest code from github
-#
-# Trafodion REST to use. This list is in order of precedent.
-# REST_TAR - Optionally specify a local tar file to use
-# REST_URL - Optionally specify a URL to download
-# REST_SRC - Optionally specify a local source tree to use
-# If none specified, download latest code from github
-#
-# phoenix_test
-# PHX_SRC - Optionally specify a local source tree to use
-#  otherwise, download latest code from github
 ##############################################################################
 
 function usage {
@@ -1518,101 +1503,17 @@ fi
 
 cd $MY_SW_ROOT
 
-echo "Setting up DCS, REST and Phoenix tests..."
-
-#Default GIT location
-GIT_DIR="git@github.com:apache/incubator-trafodion"
-DCS_SRC=$MY_SQROOT/../../dcs
-
-if [ -d $DCS_SRC ]; then
-   TRAF_SRC=$MY_SQROOT/../../
-   # Default location of DCS code
-   DCS_SRC=$MY_SQROOT/../../dcs
-   # Default location of REST code
-   REST_SRC=$MY_SQROOT/../rest
-   # Default location for phoenix_test
-   PHX_SRC=$MY_SQROOT/../../tests/phx
-else
-   TRAF_SRC=$MY_SW_ROOT/src/incubator-trafodion
-   if [ ! -d $TRAF_SRC ]; then
-     mkdir -p $MY_SW_ROOT/src
-     cd $MY_SW_ROOT/src
-     git clone $GIT_DIR
-   fi
-   # Default location of DCS code
-   DCS_SRC=$TRAF_SRC/dcs
-   # Default location of REST code
-   REST_SRC=$TRAF_SRC/core/rest
-   # Default location for phoenix_test
-   PHX_SRC=$TRAF_SRC/tests/phx
+if [ ! -r $YARN_HOME/lib/native/libhdfs.so ]; then
+  echo "------------------------------------------------------------"
+  echo "-- WARNING: libhdfs.so is not present on this system. Please"
+  echo "--          build it, otherwise Trafodion will not compile."
+  echo "------------------------------------------------------------"
 fi
 
-echo "Default Trafodion Source directory..."
-echo "For Core... $TRAF_SRC"
-echo "For DCS... $DCS_SRC"
-echo "For REST... $REST_SRC"
-echo "For PHX... $PHX_SRC"
+echo "Setting up configuration script for dcs, rest and trafci..."
 
-if [ -d dcs-* ]; then
-  echo "DCS files already exist, skipping DCS setup"
-else
-  #####################################################
-  # four options, depend on user Env variables, as described above
-  if [[ -f $DCS_TAR ]]
-  then
-    echo "Using DCS Tar: $DCS_TAR" | tee -a ${MY_LOG_FILE}
-  elif [[ -n $DCS_URL ]]
-  then
-    echo "Downloading DCS Tar: $DCS_URL" | tee -a ${MY_LOG_FILE}
-    rm -f dcs_download.tar
-    curl ${DCS_URL} -o dcs_download.tar
-    DCS_TAR=./dcs_download.tar
-  elif [[ -d $DCS_SRC ]]
-  then
-    if [[ -f $DCS_SRC/target/dcs*tar.gz ]]
-    then
-      echo "Using DCS tar file in source tree: $DCS_SRC" | tee -a ${MY_LOG_FILE}
-    else
-      echo "No DCS tar file found, building DCS: $DCS_SRC" | tee -a ${MY_LOG_FILE}
-      echo "Building DCS Source in $DCS_SRC" | tee -a ${MY_LOG_FILE}
-      cd $DCS_SRC
-      ${MAVEN:-mvn} site package >>${MY_LOG_FILE} 2>&1
-      cd $MY_SW_ROOT
-    fi
-    DCS_TAR=$(ls $DCS_SRC/target/dcs*tar.gz)
-  fi
-  if [[ ! -f $DCS_TAR ]]
-  then
-    echo '**** ERROR:'  | tee -a ${MY_LOG_FILE}
-    echo "DCS tar file not found: $DCS_TAR"  | tee -a ${MY_LOG_FILE}
-    exit 2
-  fi
-  # install
-  echo "Installing DCS from: $DCS_TAR"  | tee -a ${MY_LOG_FILE}
-  tar xzf $DCS_TAR
-  DCS_HOME=$(ls -d $MY_SW_ROOT/dcs-*)
-
-  # configure DCS
-
-  #   use ~/.trafodion to avoid modifying sqenv*.sh in source tree
-  echo "Adding DCS_INSTALL_DIR=$DCS_INSTALL_DIR to sqenv via ~/.trafodion"  | tee -a ${MY_LOG_FILE}
-  echo "  Update it if switching between multiple local_hadoop environments"  | tee -a ${MY_LOG_FILE}
-  if [[ -f ~/.trafodion ]]
-  then
-    mv -f ~/.trafodion ~/.trafodion.orig
-    grep -v 'DCS_INSTALL_DIR=' ~/.trafodion.orig > ~/.trafodion
-  fi
-  DCSDIR=${DCS_HOME##*/}
-  echo "export DCS_INSTALL_DIR=\${MY_SQROOT}/sql/local_hadoop/$DCSDIR" >> ~/.trafodion
-
-  cd $DCS_HOME/conf/
-  mv dcs-env.sh dcs-env.sh.orig
-   # SQROOT env var does not propagate thru ssh command
-  echo "MY_SQROOT=$MY_SQROOT" > dcs-env.sh
-  sed -e "s@#[ ]*export DCS_MANAGES_ZK=true@export DCS_MANAGES_ZK=false@" dcs-env.sh.orig
>> dcs-env.sh
-  mv -f dcs-site.xml dcs-site.xml.orig
-  sed -e "s@</configuration>@@" dcs-site.xml.orig > dcs-site.xml
-  cat >>dcs-site.xml <<EOF
+# For DCS
+cat >$HOME/.dcs-site.xml-$USER <<EOF
     <property>
      <name>dcs.master.port</name> <value>$MY_DCS_MASTER_PORT</value>
     </property>
@@ -1631,137 +1532,11 @@ else
     <property>
      <name>dcs.zookeeper.property.clientPort</name> <value>$MY_HBASE_ZOOKEEPER_PROPERTY_CLIENTPORT_NUM</value>
     </property>
-  </configuration>
-EOF
-  echo "localhost 4" > servers
-
-  # Configure DCS test scripts
-  if [[ -n "$DCS_SRC" ]]
-  then
-    echo "Adding swjdbc script...." | tee -a ${MY_LOG_FILE}
-    cat <<EOF >$MY_SW_SCRIPTS_DIR/swjdbc
-#!/bin/sh
-# command to run JDBC tests
-cd $DCS_SRC/src/test/jdbc_test
-./jdbc_test.py --appid=jdbc_test --user=SOMEUSER --pw=SOMEPASSWORD --javahome=\$JAVA_HOME
\\
-  --target=localhost:$MY_DCS_MASTER_PORT \\
-  --jdbctype=T4 --jdbccp=\$MY_SQROOT/export/lib/jdbcT4.jar "\$@"
-EOF
-    chmod +x $MY_SW_SCRIPTS_DIR/swjdbc
-  fi
-fi
-# end of DCS setup
-
-# begin of trafci setup
-
-echo "Updating trafci port number" | tee -a ${MY_LOG_FILE}
-TRAFCI_BIN_DIR=$MY_SQROOT/trafci/bin
-if [[ -f $TRAFCI_BIN_DIR/trafci ]]
-then
-  mv $TRAFCI_BIN_DIR/trafci  $TRAFCI_BIN_DIR/trafci.orig | tee -a ${MY_LOG_FILE}
-  sed -e "s@localhost:23400@localhost:$MY_DCS_MASTER_PORT@" $TRAFCI_BIN_DIR/trafci.orig >>
$TRAFCI_BIN_DIR/trafci | tee -a ${MY_LOG_FILE}
-  chmod +x $TRAFCI_BIN_DIR/trafci | tee -a ${MY_LOG_FILE}
-  echo "Modified trafci port number to $MY_DCS_MASTER_PORT" | tee -a ${MY_LOG_FILE}
-else
-  echo "$TRAFCI_BIN_DIR not found" | tee -a ${MY_LOG_FILE}
-fi
-
-# end of trafci set up
-
-if [[ -d $PHX_SRC ]]; then
-  echo "Phoenix files already exist, skipping Phoenix setup" | tee -a ${MY_LOG_FILE}
-
-  #######################################################
-  # scripts to run tests
-  #######################################################
-  # adding this in this section to enable adding it to
-  # existing local_hadoop installations
-  echo "Adding swphoenix script...." | tee -a ${MY_LOG_FILE}
-  cat <<EOF >$MY_SW_SCRIPTS_DIR/swphoenix
-#!/bin/sh
-# command to run phoenix tests
-
-cd $PHX_SRC
-if [[ \$1 == "t4" ]]
-then
-  ./phoenix_test.py --target=localhost:$MY_DCS_MASTER_PORT --user=dontcare --pw=dontcare
\\
-     --targettype=TR --javahome=\$JAVA_HOME --jdbccp=\$MY_SQROOT/export/lib/jdbcT4.jar
-elif [[ \$1 == "t2" ]]
-then
-  export LD_PRELOAD=\$JAVA_HOME/jre/lib/amd64/libjsig.so:\$MY_SQROOT/export/lib\$SQ_MBTYPE/libseabasesig.so
-  ./phoenix_test.py --targettype=TR --javahome=\$JAVA_HOME \\
-     --jdbccp=\$MY_SQROOT/export/lib/jdbcT2.jar --jdbctype=T2
-else
-  echo "Usage: swphoenix (t2|t4)"
-  exit 1
-fi
 EOF
-  chmod +x $MY_SW_SCRIPTS_DIR/swphoenix
-
-fi
-# end of Phoenix setup
 
-# Begin of Trafodion REST Server setup
+# For rest
 
-if [ -d rest-* ]; then
-  echo "Trafodion REST files already exist, skipping REST setup"
-else
-  #####################################################
-  # three options, depend on user Env variables, as described above
-  if [[ -f $REST_TAR ]]
-  then
-    echo "Using REST Tar: $REST_TAR" | tee -a ${MY_LOG_FILE}
-  elif [[ -n $REST_URL ]]
-  then
-    echo "Downloading REST Tar: $REST_URL" | tee -a ${MY_LOG_FILE}
-    rm -f rest_download.tar
-    curl ${REST_URL} -o rest_download.tar
-    REST_TAR=./rest_download.tar
-  elif [[ -d $REST_SRC ]]
-  then
-    if [[ -f $REST_SRC/target/rest*tar.gz ]]
-    then
-      echo "Using REST tar file in source tree: $REST_SRC" | tee -a ${MY_LOG_FILE}
-    else
-      echo "No REST tar file found, building REST: $REST_SRC" | tee -a ${MY_LOG_FILE}
-      echo "Building REST Source in $REST_SRC" | tee -a ${MY_LOG_FILE}
-      cd $REST_SRC
-      ${MAVEN:-mvn} site package >>${MY_LOG_FILE} 2>&1
-      cd $MY_SW_ROOT
-    fi
-    REST_TAR=$(ls $REST_SRC/target/rest*tar.gz)
-  fi
-  if [[ ! -f $REST_TAR ]]
-  then
-    echo '**** ERROR:'  | tee -a ${MY_LOG_FILE}
-    echo "REST tar file not found: $REST_TAR"  | tee -a ${MY_LOG_FILE}
-    exit 2
-  fi
-  # install
-  echo "Installing REST from: $REST_TAR"  | tee -a ${MY_LOG_FILE}
-  tar xzf $REST_TAR
-  REST_HOME=$(ls -d $MY_SW_ROOT/rest-*)
-
-  # configure REST
-
-  #   use ~/.trafodion to avoid modifying sqenv*.sh in source tree
-  echo "Adding REST_INSTALL_DIR=$REST_INSTALL_DIR to sqenv via ~/.trafodion"  | tee -a ${MY_LOG_FILE}
-  echo "  Update it if switching between multiple local_hadoop environments"  | tee -a ${MY_LOG_FILE}
-  if [[ -f ~/.trafodion ]]
-  then
-    mv -f ~/.trafodion ~/.trafodion.orig
-    grep -v 'REST_INSTALL_DIR=' ~/.trafodion.orig >> ~/.trafodion
-  fi
-  RESTDIR=${REST_HOME##*/}
-  echo "export REST_INSTALL_DIR=\${MY_SQROOT}/sql/local_hadoop/$RESTDIR" >> ~/.trafodion
-  cd $REST_HOME/conf/
-  mv rest-env.sh rest-env.sh.orig
-   # SQROOT env var does not propagate thru ssh command
-  echo "MY_SQROOT=$MY_SQROOT" > rest-env.sh
-  sed -e "s@#[ ]*export REST_MANAGES_ZK=true@export REST_MANAGES_ZK=false@" rest-env.sh.orig
>> rest-env.sh
-  mv -f rest-site.xml rest-site.xml.orig
-  sed -e "s@</configuration>@@" rest-site.xml.orig > rest-site.xml
-  cat >>rest-site.xml <<EOF
+cat >$HOME/.rest-site.xml-$USER <<EOF
     <property>
      <name>rest.port</name> <value>$MY_REST_SERVER_PORT</value>
     </property>
@@ -1777,18 +1552,12 @@ else
     <property>
      <name>rest.zookeeper.property.clientPort</name> <value>$MY_HBASE_ZOOKEEPER_PROPERTY_CLIENTPORT_NUM</value>
     </property>
-  </configuration>
 EOF
-fi
-
-# End of Trafodion REST Server setup
 
-if [ ! -r $YARN_HOME/lib/native/libhdfs.so ]; then
-  echo "------------------------------------------------------------"
-  echo "-- WARNING: libhdfs.so is not present on this system. Please"
-  echo "--          build it, otherwise Trafodion will not compile."
-  echo "------------------------------------------------------------"
-fi
+#For clients
+cat >$HOME/.dcs-masterport-$USER <<EOF
+$MY_DCS_MASTER_PORT
+EOF
 
 echo
 echo "Installed directory size and name = $(du -sh $MY_SW_ROOT)" | tee -a ${MY_LOG_FILE}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0b1fce25/core/sqf/sql/scripts/install_traf_components
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/install_traf_components b/core/sqf/sql/scripts/install_traf_components
new file mode 100755
index 0000000..1b32db8
--- /dev/null
+++ b/core/sqf/sql/scripts/install_traf_components
@@ -0,0 +1,349 @@
+#!/bin/bash
+
+#### Script to install and configure DCS, REST and Phoenix tests...
+
+# Location of hadoop install
+MY_SW_ROOT=$MY_SQROOT/sql/local_hadoop
+MY_LOG_FILE=$MY_SW_ROOT/log/install_traf_components_$(date +%F_%T).log
+
+# Default location of Trafodion, DCS, REST and Phoenix src folders
+TRAF_SRC=$MY_SQROOT/../../
+DCS_SRC=$MY_SQROOT/../../dcs
+REST_SRC=$MY_SQROOT/../rest
+PHX_SRC=$MY_SQROOT/../../tests/phx
+TRAF_TARS=$MY_SQROOT/../../distribution
+
+MY_DCS_MASTER_PORT=`cat $HOME/.dcs-masterport-$USER`
+
+if [ -z "$DCS_TAR" ]; then
+  DCS_TAR=$TRAF_TARS/dcs*tar.gz 
+fi
+
+if [ -z "$REST_TAR" ]; then
+  REST_TAR=$TRAF_TARS/rest*tar.gz
+fi
+
+if [ -z "$PHX_TAR" ]; then
+    PHX_TAR=$TRAF_TARS/phoenix*.tgz
+fi
+
+if [ -z "$CLIENT_TAR" ]; then
+    CLIENT_TAR=$TRAF_TARS/*clients*.tgz
+fi
+
+if [ -f "$CLIENT_TAR" ]; then
+   cd $MY_SW_ROOT
+   tar -xzf $CLIENT_TAR *Linux*
+   tar -xzf $CLIENT_TAR *odb*
+   LNXDRVR_TAR=$MY_SW_ROOT/clients/*Linux*.gz
+   ODB_TAR=$MY_SW_ROOT/clients/*odb*.gz
+fi
+
+echo | tee ${MY_LOG_FILE}
+echo "Installing and configuring DCS, REST, TRAFCI & Phoenix tests for Trafodion..."
| tee -a ${MY_LOG_FILE}
+
+echo | tee -a ${MY_LOG_FILE}
+echo "Environment used for core, DCS, REST and Phonenix ..." | tee -a ${MY_LOG_FILE}
+echo | tee -a ${MY_LOG_FILE}
+
+if [ ! -d "$DCS_SRC" ]; then
+  echo "Using only tar distribution and does not include source..."
+  echo | tee -a ${MY_LOG_FILE}
+else
+  echo "   For Core... $TRAF_SRC" | tee -a ${MY_LOG_FILE}
+  echo "   For DCS... $DCS_SRC" | tee -a ${MY_LOG_FILE}
+  echo "   For REST... $REST_SRC" | tee -a ${MY_LOG_FILE}
+  echo "   For PHX... $PHX_SRC" | tee -a ${MY_LOG_FILE}
+fi
+
+echo "   For local hadoop... $MY_SW_ROOT" | tee -a ${MY_LOG_FILE}
+echo "   For DCS_TAR... $DCS_TAR" | tee -a ${MY_LOG_FILE}
+echo "   For REST_TAR... $REST_TAR" | tee -a ${MY_LOG_FILE}
+
+if [ -f "$PHX_TAR" ]; then
+  echo "   For PHX_TAR... $PHX_TAR" | tee -a ${MY_LOG_FILE}
+fi
+
+if [ -f "$CLIENT_TAR" ]; then
+  echo "   For CLIENT_TAR... $CLIENT_TAR" | tee -a ${MY_LOG_FILE}
+  echo "      For ODB_TAR... $ODB_TAR" | tee -a ${MY_LOG_FILE}
+  echo "      For LNXDRVR_TAR... $LNXDRVR_TAR" | tee -a ${MY_LOG_FILE}
+fi
+
+cd $MY_SW_ROOT
+
+echo | tee -a ${MY_LOG_FILE}
+# Begin set up of DCS
+
+if [ -d dcs-* ]; then
+  echo "DCS files already exist, skipping DCS setup" | tee -a ${MY_LOG_FILE}
+else
+  if [ -n "$DCS_URL" ]; then 
+    echo "Downloading DCS Tar: $DCS_URL" | tee -a ${MY_LOG_FILE}
+    rm -f dcs_download.tar
+    curl ${DCS_URL} -o dcs_download.tar
+    DCS_TAR=./dcs_download.tar
+  else
+    if [ -f "$DCS_TAR" ]; then
+      echo "Using DCS Tar: $DCS_TAR" | tee -a ${MY_LOG_FILE}
+    elif [ -d "$DCS_SRC" ]; then
+      echo "DCS tar file was not found in $TRAF_TARS" | tee -a ${MY_LOG_FILE}
+      echo "Building DCS tar file" | tee -a ${MY_LOG_FILE}
+      if [ -f "$MY_SQROOT/export/lib/jdbcT4.jar" ]; then
+         echo "JDBCT4 jar file exist. Proceeding to build DCS from $DCS_SRC" | tee -a ${MY_LOG_FILE}
+         cd $DCS_SRC
+         ${MAVEN:-mvn} clean site package >>${MY_LOG_FILE} 2>&1
+         mv $DCS_SRC/target/dcs*.gz $TRAF_TARS
+         cd $MY_SW_ROOT
+      else
+         echo "JDBCT4 jar file does not exist $MY_SQROOT/export/lib folder. " | tee -a ${MY_LOG_FILE}
+         echo "Please build the core Trafodion component"  | tee -a ${MY_LOG_FILE}
+         exit 2
+      fi
+    fi
+  fi
+
+# Install DCS
+  echo "Installing DCS from: $DCS_TAR"  | tee -a ${MY_LOG_FILE}
+  tar xzf $DCS_TAR | tee -a ${MY_LOG_FILE}
+  DCS_HOME=$(/bin/ls -d $MY_SW_ROOT/dcs-*)
+
+# Configure DCS
+  echo "Adding DCS_INSTALL_DIR=$DCS_INSTALL_DIR to ~/.trafodion"  | tee -a ${MY_LOG_FILE}
+  if [[ -f ~/.trafodion ]]
+  then
+    mv -f ~/.trafodion ~/.trafodion.orig
+    grep -v 'DCS_INSTALL_DIR=' ~/.trafodion.orig > ~/.trafodion
+  fi
+  DCSDIR=${DCS_HOME##*/}
+  echo "export DCS_INSTALL_DIR=\${MY_SQROOT}/sql/local_hadoop/$DCSDIR" >> ~/.trafodion
| tee -a ${MY_LOG_FILE}
+
+  echo "Setting DCS env and site.xml file" | tee -a ${MY_LOG_FILE}
+  cd $DCS_HOME/conf/
+  mv dcs-env.sh dcs-env.sh.orig
+  echo "MY_SQROOT=$MY_SQROOT" > dcs-env.sh
+  sed -e "s@#[ ]*export DCS_MANAGES_ZK=true@export DCS_MANAGES_ZK=false@" dcs-env.sh.orig
>> dcs-env.sh
+  mv -f dcs-site.xml dcs-site.xml.orig
+  sed -e "s@</configuration>@@" dcs-site.xml.orig > dcs-site.xml
+  cat $HOME/.dcs-site.xml-$USER >> $DCS_HOME/conf/dcs-site.xml
+  echo "</configuration>" >> $DCS_HOME/conf/dcs-site.xml
+
+  echo "Configured $DCS_HOME/conf/dcs-site.xml" | tee -a ${MY_LOG_FILE}
+
+  echo "localhost 4" > servers
+  echo "Configured $DCS_HOME/conf/servers" | tee -a ${MY_LOG_FILE}
+
+# Configure DCS test scripts
+  if [[ -n "$DCS_SRC" ]]
+  then
+    echo "Adding swjdbc script...." | tee -a ${MY_LOG_FILE}
+    cat <<EOF >$MY_SQROOT/sql/scripts/swjdbc
+#!/bin/sh
+# command to run JDBC tests
+cd $DCS_SRC/src/test/jdbc_test
+./jdbc_test.py --appid=jdbc_test --user=SOMEUSER --pw=SOMEPASSWORD --javahome=\$JAVA_HOME
\\
+  --target=localhost:$MY_DCS_MASTER_PORT \\
+  --jdbctype=T4 --jdbccp=\$MY_SQROOT/export/lib/jdbcT4.jar "\$@"
+EOF
+    chmod +x $MY_SQROOT/sql/scripts/swjdbc
+  fi
+fi
+
+# End of DCS setup
+
+cd $MY_SW_ROOT
+
+echo | tee -a ${MY_LOG_FILE}
+# Begin setup of REST Server 
+
+if [ -d rest-* ]; then
+  echo "REST files already exist, skipping REST setup"
+else
+  if [ -n "$REST_URL" ]; then
+    echo "Downloading REST Tar: $REST_URL" | tee -a ${MY_LOG_FILE}
+    rm -f rest_download.tar
+    curl ${REST_URL} -o rest_download.tar
+    REST_TAR=./rest_download.tar
+  else
+    if [ -f "$REST_TAR" ]; then
+        echo "Using REST Tar: $REST_TAR" | tee -a ${MY_LOG_FILE}
+    elif [ -d "$REST_SRC" ]; then
+      echo "REST tar file was not found in $TRAF_TARS" | tee -a ${MY_LOG_FILE}
+      echo "Building REST tar file" | tee -a ${MY_LOG_FILE}
+      if [ -f $MY_SQROOT/export/lib/jdbcT4.jar ]; then
+         echo "JDBCT4 jar file exist. Proceeding to build REST from $REST_SRC" | tee -a ${MY_LOG_FILE}
+         cd $REST_SRC
+         ${MAVEN:-mvn} clean site package >>${MY_LOG_FILE} 2>&1
+         mv $REST_SRC/target/rest*.gz $TRAF_TARS
+         cd $MY_SW_ROOT
+       else
+         echo "JDBCT4 jar file does not exist $MY_SQROOT/export/lib folder. Please build
the core Trafodion components" | tee -a ${MY_LOG_FILE}
+       exit 2
+      fi
+    fi
+  fi
+
+# Install REST
+  echo "Installing REST from: $REST_TAR"  | tee -a ${MY_LOG_FILE}
+  tar xzf $REST_TAR | tee -a ${MY_LOG_FILE}
+  REST_HOME=$(/bin/ls -d $MY_SW_ROOT/rest-*)
+
+# Configure REST
+  echo "Adding REST_INSTALL_DIR=$REST_INSTALL_DIR to via ~/.trafodion"  | tee -a ${MY_LOG_FILE}
+  if [[ -f ~/.trafodion ]]
+  then
+    mv -f ~/.trafodion ~/.trafodion.orig
+    grep -v 'REST_INSTALL_DIR=' ~/.trafodion.orig >> ~/.trafodion
+  fi
+  RESTDIR=${REST_HOME##*/}
+  echo "export REST_INSTALL_DIR=\${MY_SQROOT}/sql/local_hadoop/$RESTDIR" >> ~/.trafodion
 | tee -a ${MY_LOG_FILE}
+  echo "Setting REST env and site.xml "  | tee -a ${MY_LOG_FILE}
+  cd $REST_HOME/conf/
+  mv rest-env.sh rest-env.sh.orig
+
+  echo "MY_SQROOT=$MY_SQROOT" > rest-env.sh
+  sed -e "s@#[ ]*export REST_MANAGES_ZK=true@export REST_MANAGES_ZK=false@" rest-env.sh.orig
>> rest-env.sh
+  mv -f rest-site.xml rest-site.xml.orig
+  sed -e "s@</configuration>@@" rest-site.xml.orig > rest-site.xml
+  cat $HOME/.rest-site.xml-$USER >> $REST_HOME/conf/rest-site.xml
+  echo "</configuration>" >> $REST_HOME/conf/rest-site.xml
+
+  echo "Configured $REST_HOME/conf/rest-site.xml" | tee -a ${MY_LOG_FILE}
+fi
+
+# End of setup for REST
+
+cd $MY_SW_ROOT
+
+echo | tee -a ${MY_LOG_FILE}
+# Begin setup of TRAFCI
+
+echo "Configuring TRAFCI " | tee -a ${MY_LOG_FILE}
+TRAFCI_BIN_DIR=$MY_SQROOT/trafci/bin
+if [[ -f $TRAFCI_BIN_DIR/trafci ]]
+then
+  mv $TRAFCI_BIN_DIR/trafci  $TRAFCI_BIN_DIR/trafci.orig | tee -a ${MY_LOG_FILE}
+  sed -e "s@localhost:23400@localhost:$MY_DCS_MASTER_PORT@" $TRAFCI_BIN_DIR/trafci.orig >>
$TRAFCI_BIN_DIR/trafci | tee -a ${MY_LOG_FILE}
+  chmod +x $TRAFCI_BIN_DIR/trafci | tee -a ${MY_LOG_FILE}
+  echo "Adding swtrafci script..." | tee -a ${MY_LOG_FILE}
+  cat <<EOF >$MY_SQROOT/sql/scripts/swtrafci
+#!/bin/sh
+# command to run trafci
+HNAME=localhost:$MY_DCS_MASTER_PORT
+UNAME=zz
+PWORD=zz
+
+$MY_SQROOT/trafci/bin/trafci.sh -h $HNAME -u $UNAME -p $PWORD
+EOF
+  chmod +x $MY_SQROOT/sql/scripts/swtrafci
+else
+  echo "$TRAFCI_BIN_DIR not found" | tee -a ${MY_LOG_FILE}
+fi
+
+# End setup for TRAFCI
+
+echo | tee -a ${MY_LOG_FILE}
+# Begin setup of Phoenix test
+
+PHXDIR=$MY_SW_ROOT/tests/phx
+
+if [ -d "$PHXDIR" ]; then
+  echo "Phoenix tests already exist $PHXDIR, skipping Phoenix test setup" | tee -a ${MY_LOG_FILE}
+else
+  if [ -f "$PHX_TAR" ]; then
+    echo "Installing Phoenix tests $PHX_TAR"| tee -a ${MY_LOG_FILE}
+    tar -xzf $PHX_TAR | tee -a ${MY_LOG_FILE}
+    echo "Successfully installed Phoenix tests "| tee -a ${MY_LOG_FILE}
+  elif [ -d "$PHX_SRC" ]; then
+     echo "Phoenix files already exist $PHX_SRC skipping Phoenix setup" | tee -a ${MY_LOG_FILE}
+     PHXDIR=$PHX_SRC
+  fi
+
+echo "Adding swphoenix script..." | tee -a ${MY_LOG_FILE}
+  cat <<EOF >$MY_SQROOT/sql/scripts/swphoenix
+#!/bin/sh
+# command to run phoenix tests
+
+cd $PHXDIR
+if [[ \$1 == "t4" ]]
+then
+  ./phoenix_test.py --target=localhost:$MY_DCS_MASTER_PORT --user=dontcare --pw=dontcare
\\
+     --targettype=TR --javahome=\$JAVA_HOME --jdbccp=\$MY_SQROOT/export/lib/jdbcT4.jar
+elif [[ \$1 == "t2" ]]
+then
+  export LD_PRELOAD=\$JAVA_HOME/jre/lib/amd64/libjsig.so:\$MY_SQROOT/export/lib\$SQ_MBTYPE/libseabasesig.so
+  ./phoenix_test.py --targettype=TR --javahome=\$JAVA_HOME \\
+     --jdbccp=\$MY_SQROOT/export/lib/jdbcT2.jar --jdbctype=T2
+else
+  echo "Usage: swphoenix (t2|t4)"
+  exit 1
+fi
+EOF
+
+  chmod +x $MY_SQROOT/sql/scripts/swphoenix
+fi
+
+# End of Phoenix setup
+
+cd $MY_SW_ROOT
+
+echo | tee -a ${MY_LOG_FILE}
+# Begin setup of Linux driver
+
+LNXDRVR=$MY_SW_ROOT/lnxdrvr
+
+if [ -d $LNXDRVR ]; then
+  echo "Linux driver files already exist $LNXDRVR, skipping Linux Driver setup" | tee -a
${MY_LOG_FILE}
+else
+  if [ -f "$LNXDRVR_TAR" ]; then
+     echo "Installing Linux driver: $LNXDRV"| tee -a ${MY_LOG_FILE}
+     mkdir -p $LNXDRVR | tee -a ${MY_LOG_FILE}
+     cd $LNXDRVR 
+     tar -xzf $LNXDRVR_TAR | tee -a ${MY_LOG_FILE} 
+     cd PkgTmp 
+     ./install.sh <<EOF | tee -a ${MY_LOG_FILE}
+YES
+../
+../
+../
+EOF
+    cd .. | tee -a ${MY_LOG_FILE}
+    mv TRAFDSN TRAFDSN.orig | tee -a ${MY_LOG_FILE}
+    sed -e "s@TCP:1.2.3.4:23400@TCP:localhost:$MY_DCS_MASTER_PORT@" TRAFDSN.orig >>
TRAFDSN | tee -a ${MY_LOG_FILE}
+    echo "Successfully installed linux driver in $LNXDRVR"| tee -a ${MY_LOG_FILE}
+  else
+    echo "Linux driver tar file not found. Please install it manually..." | tee -a ${MY_LOG_FILE}
+  fi
+fi
+
+# End setup of Linux driver
+
+cd $MY_SW_ROOT
+
+echo | tee -a ${MY_LOG_FILE}
+# Begin setup of ODB load tool
+
+ODBLOC=$MY_SW_ROOT/odb
+
+if [ -d $ODBLOC ]; then
+  echo "ODB files already exist $ODBLOC, skipping ODB setup" | tee -a ${MY_LOG_FILE}
+else
+  if [ -f "$ODB_TAR" ]; then
+    echo "Installing ODB tool: $ODBLOC"| tee -a ${MY_LOG_FILE}
+    mkdir -p $ODBLOC | tee -a ${MY_LOG_FILE}
+    cd $ODBLOC 
+    tar -xzf $ODB_TAR | tee -a ${MY_LOG_FILE}
+    echo "Successfully installed ODB tool in $ODBLOC"| tee -a ${MY_LOG_FILE}
+  else
+    echo "ODB tar file not found. Please install it manually after installing linux odbc
driver..." | tee -a ${MY_LOG_FILE}
+  fi
+fi
+
+# End setup of ODB load told
+
+echo | tee -a ${MY_LOG_FILE}
+echo "Configuration scripts for DCS, REST, TRAFCI and Phoenix test are set up " | tee -a
${MY_LOG_FILE}
+
+echo | tee -a ${MY_LOG_FILE}
+echo "   Open a new session and start Trafodion by executing sqgen and sqstart scripts" |
tee -a ${MY_LOG_FILE}
+echo | tee -a ${MY_LOG_FILE}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0b1fce25/env.sh
----------------------------------------------------------------------
diff --git a/env.sh b/env.sh
new file mode 100755
index 0000000..28191e0
--- /dev/null
+++ b/env.sh
@@ -0,0 +1,3 @@
+cd core/sqf
+. ./sqenv.sh
+cd ../..



Mime
View raw message