You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by mb...@apache.org on 2016/07/27 04:52:10 UTC

asterixdb git commit: Add Non-Managix Sample Local Cluster Scripts

Repository: asterixdb
Updated Branches:
  refs/heads/master c8c067c58 -> 8ac413693


Add Non-Managix Sample Local Cluster Scripts

Change-Id: I036fd27141721012d5c6486a73400678d824c741
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1023
Reviewed-by: Till Westmann <ti...@apache.org>
Sonar-Qube: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/8ac41369
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/8ac41369
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/8ac41369

Branch: refs/heads/master
Commit: 8ac413693ef64a455a05b3d610f3257039d56a7d
Parents: c8c067c
Author: Michael Blow <mb...@apache.org>
Authored: Wed Jul 27 00:00:15 2016 -0400
Committer: Michael Blow <mb...@apache.org>
Committed: Tue Jul 26 21:51:38 2016 -0700

----------------------------------------------------------------------
 .../src/main/assembly/binary-assembly.xml       |  1 +
 .../samples/local/bin/start-sample-cluster.sh   | 69 ++++++++++++++++++++
 .../samples/local/bin/stop-sample-cluster.sh    | 43 ++++++++++++
 .../main/resources/samples/local/conf/blue.conf |  2 +
 .../main/resources/samples/local/conf/cc.conf   | 18 +++++
 5 files changed, 133 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/8ac41369/asterixdb/asterix-server/src/main/assembly/binary-assembly.xml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/assembly/binary-assembly.xml b/asterixdb/asterix-server/src/main/assembly/binary-assembly.xml
index 85acd62..379a6f2 100644
--- a/asterixdb/asterix-server/src/main/assembly/binary-assembly.xml
+++ b/asterixdb/asterix-server/src/main/assembly/binary-assembly.xml
@@ -44,6 +44,7 @@
       <outputDirectory>.</outputDirectory>
       <includes>
         <include>LICENSE*</include>
+        <include>samples/**</include>
       </includes>
     </fileSet>
     <fileSet>

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/8ac41369/asterixdb/asterix-server/src/main/resources/samples/local/bin/start-sample-cluster.sh
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/resources/samples/local/bin/start-sample-cluster.sh b/asterixdb/asterix-server/src/main/resources/samples/local/bin/start-sample-cluster.sh
new file mode 100755
index 0000000..eb26384
--- /dev/null
+++ b/asterixdb/asterix-server/src/main/resources/samples/local/bin/start-sample-cluster.sh
@@ -0,0 +1,69 @@
+#!/bin/bash
+# ----------------------------------------------------------------------------
+#  Copyright 2001-2006 The Apache Software Foundation.
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+# ----------------------------------------------------------------------------
+#
+#   Copyright (c) 2001-2006 The Apache Software Foundation.  All rights
+#   reserved.
+
+if [ -z "$JAVA_HOME" -a -x /usr/libexec/java_home ]; then
+  JAVA_HOME=$(/usr/libexec/java_home)
+  export JAVA_HOME
+fi
+
+[ -z "$JAVA_HOME" ] && {
+  echo "JAVA_HOME not set"
+  exit 1
+}
+"$JAVA_HOME/bin/java" -version || {
+  echo "JAVA_HOME not valid"
+  exit 2
+}
+
+DIRNAME=$(dirname $0)
+[ $(echo $DIRNAME | wc -l) -ne 1 ] && {
+  echo "Paths with spaces are not supported"
+  exit 3
+}
+
+CLUSTERDIR=$(cd $DIRNAME/..; echo $PWD)
+CBASDIR=$(cd $CLUSTERDIR/../..; echo $PWD)
+LOGSDIR=$CLUSTERDIR/logs
+
+echo "CLUSTERDIR=$CLUSTERDIR"
+echo "CBASDIR=$CBASDIR"
+
+cd $CLUSTERDIR
+mkdir -p $LOGSDIR
+
+(
+  echo "--------------------------"
+  date
+  echo "--------------------------"
+) | tee -a $LOGSDIR/blue-service.log | tee -a $LOGSDIR/red-service.log >> $LOGSDIR/cc.log
+
+$CBASDIR/bin/asterixncservice -logdir - -config-file $CLUSTERDIR/conf/blue.conf >> $LOGSDIR/blue-service.log 2>&1 &
+$CBASDIR/bin/asterixncservice -logdir - >> $LOGSDIR/red-service.log 2>&1 &
+$CBASDIR/bin/asterixcc -config-file $CLUSTERDIR/conf/cc.conf >> $LOGSDIR/cc.log 2>&1 &
+
+echo -n "Waiting for cluster to start."
+while [ 1 ]; do
+  curl -s -o /dev/null http://localhost:19002 && break
+  echo -n "."
+  sleep 1s
+done
+echo ".done"
+echo
+echo "See output in $LOGSDIR/"

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/8ac41369/asterixdb/asterix-server/src/main/resources/samples/local/bin/stop-sample-cluster.sh
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/resources/samples/local/bin/stop-sample-cluster.sh b/asterixdb/asterix-server/src/main/resources/samples/local/bin/stop-sample-cluster.sh
new file mode 100755
index 0000000..4a64553
--- /dev/null
+++ b/asterixdb/asterix-server/src/main/resources/samples/local/bin/stop-sample-cluster.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+# ----------------------------------------------------------------------------
+#  Copyright 2001-2006 The Apache Software Foundation.
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+# ----------------------------------------------------------------------------
+#
+#   Copyright (c) 2001-2006 The Apache Software Foundation.  All rights
+#   reserved.
+
+if [ -z "$JAVA_HOME" -a -x /usr/libexec/java_home ]; then
+  JAVA_HOME=$(/usr/libexec/java_home)
+  export JAVA_HOME
+fi
+
+[ -z "$JAVA_HOME" ] && {
+  echo "JAVA_HOME not set"
+  exit 1
+}
+"$JAVA_HOME/bin/java" -version || {
+  echo "JAVA_HOME not valid"
+  exit 2
+}
+
+curl -X POST http://localhost:19002/admin/shutdown
+$JAVA_HOME/bin/jps | awk '/NCService/ { print $1 }' | xargs kill
+echo
+echo -n "Waiting for CCDriver to terminate."
+while [ -n "$($JAVA_HOME/bin/jps | awk '/CCDriver/')" ]; do
+  sleep 2s
+  echo -n .
+done
+echo ".done."

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/8ac41369/asterixdb/asterix-server/src/main/resources/samples/local/conf/blue.conf
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/resources/samples/local/conf/blue.conf b/asterixdb/asterix-server/src/main/resources/samples/local/conf/blue.conf
new file mode 100644
index 0000000..1dcedc8
--- /dev/null
+++ b/asterixdb/asterix-server/src/main/resources/samples/local/conf/blue.conf
@@ -0,0 +1,2 @@
+[ncservice]
+port=9091

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/8ac41369/asterixdb/asterix-server/src/main/resources/samples/local/conf/cc.conf
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/resources/samples/local/conf/cc.conf b/asterixdb/asterix-server/src/main/resources/samples/local/conf/cc.conf
new file mode 100644
index 0000000..9fadb37
--- /dev/null
+++ b/asterixdb/asterix-server/src/main/resources/samples/local/conf/cc.conf
@@ -0,0 +1,18 @@
+[nc/red]
+txnlogdir=data/red/txnlog
+coredumpdir=data/red/coredump
+iodevices=data/red
+
+[nc/blue]
+port=9091
+txnlogdir=data/blue/txnlog
+coredumpdir=data/blue/coredump
+iodevices=data/blue
+
+[nc]
+storagedir=storage
+address=127.0.0.1
+command=asterixnc
+
+[cc]
+cluster.address = 127.0.0.1