From 480860f3de0e1652609c504b5efb7ae3048ccaf3 Mon Sep 17 00:00:00 2001 From: Gang Liao Date: Tue, 1 Oct 2019 14:36:25 -0400 Subject: [PATCH] [AWS] support the public/private ip --- test.sh | 14 ++++++++++---- voltdb/clean_procedures.sh | 4 ++-- voltdb/create_procedures.sh | 8 ++++---- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/test.sh b/test.sh index 2d5716b9945..5cbee178306 100644 --- a/test.sh +++ b/test.sh @@ -1,15 +1,21 @@ # copy the following command lines into test.sh set -xe -kill $(jps | grep 'NameNode' | awk '{print $1}') || true -kill $(jps | grep 'DataNode' | awk '{print $1}') || true +./sbin/stop-dfs.sh export DATABASE="VOLT" +if [ -z "$1" ] +then + IP="localhost" +else + IP=$1 +fi + # compile stored procedures -cd ~/hadoop/voltdb && bash clean_procedures.sh +cd ~/hadoop/voltdb && bash clean_procedures.sh $IP cd .. && javac HdfsMetaInfoSchema.java && java HdfsMetaInfoSchema -cd ~/hadoop/voltdb && bash create_procedures.sh +cd ~/hadoop/voltdb && bash create_procedures.sh $IP # restart hadoop hdfs cd $HADOOP_HOME diff --git a/voltdb/clean_procedures.sh b/voltdb/clean_procedures.sh index b3acd36aa48..71721d5a8a1 100644 --- a/voltdb/clean_procedures.sh +++ b/voltdb/clean_procedures.sh @@ -9,13 +9,13 @@ Removing the Exist Stored Procedures ... EOF -EXISTS_PRCEDURES=$(echo "show procedures" | sqlcmd | sed '1,/^--- User Procedures ------------------------------------------$/d' | awk '{print $1}') +EXISTS_PRCEDURES=$(echo "show procedures" | sqlcmd --servers=$1 | sed '1,/^--- User Procedures ------------------------------------------$/d' | awk '{print $1}') for procedure in $VOLTDB_PROCEDURES do if [[ $EXISTS_PRCEDURES == *"$procedure"* ]]; then - echo "DROP PROCEDURE $procedure;" | sqlcmd; + echo "DROP PROCEDURE $procedure;" | sqlcmd --servers=$1; fi done diff --git a/voltdb/create_procedures.sh b/voltdb/create_procedures.sh index b721b1bce81..a9817e61436 100644 --- a/voltdb/create_procedures.sh +++ b/voltdb/create_procedures.sh @@ -9,13 +9,13 @@ Removing the Exist Stored Procedures ... EOF -EXISTS_PRCEDURES=$(echo "show procedures" | sqlcmd | sed '1,/^--- User Procedures ------------------------------------------$/d' | awk '{print $1}') +EXISTS_PRCEDURES=$(echo "show procedures" | sqlcmd --servers=$1 | sed '1,/^--- User Procedures ------------------------------------------$/d' | awk '{print $1}') for procedure in $VOLTDB_PROCEDURES do if [[ $EXISTS_PRCEDURES == *"$procedure"* ]]; then - echo "DROP PROCEDURE $procedure;" | sqlcmd; + echo "DROP PROCEDURE $procedure;" | sqlcmd --servers=$1; fi done @@ -30,7 +30,7 @@ EOF rm -rf *.class javac *.java jar cvf storedprocs.jar *.class -echo "LOAD CLASSES storedprocs.jar;" | sqlcmd +echo "LOAD CLASSES storedprocs.jar;" | sqlcmd --servers=$1 cat <