Michael Blow has uploaded a new change for review.
https://asterix-gerrit.ics.uci.edu/1023
Change subject: Add Non-Managix Sample Local Cluster Scripts
......................................................................
Add Non-Managix Sample Local Cluster Scripts
Change-Id: I036fd27141721012d5c6486a73400678d824c741
---
M asterixdb/asterix-server/src/main/assembly/binary-assembly.xml
A
asterixdb/asterix-server/src/main/resources/samples/local/bin/start-sample-cluster.sh
A
asterixdb/asterix-server/src/main/resources/samples/local/bin/stop-sample-cluster.sh
A asterixdb/asterix-server/src/main/resources/samples/local/conf/blue.conf
A asterixdb/asterix-server/src/main/resources/samples/local/conf/cc.conf
5 files changed, 128 insertions(+), 0 deletions(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb
refs/changes/23/1023/1
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>
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..fbbdba6
--- /dev/null
+++
b/asterixdb/asterix-server/src/main/resources/samples/local/bin/start-sample-cluster.sh
@@ -0,0 +1,63 @@
+#!/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 &
+
+sleep 1s
+echo
+echo "Local sample cluster started, see output in $LOGSDIR/"
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..24325fe
--- /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."
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
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..72ab8fd
--- /dev/null
+++ b/asterixdb/asterix-server/src/main/resources/samples/local/conf/cc.conf
@@ -0,0 +1,19 @@
+[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]
+#app.class=org.apache.asterix.hyracks.bootstrap.NCApplicationEntryPoint
+storagedir=storage
+address=127.0.0.1
+command=asterixnc
+
+[cc]
+cluster.address = 127.0.0.1
--
To view, visit https://asterix-gerrit.ics.uci.edu/1023
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I036fd27141721012d5c6486a73400678d824c741
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <[email protected]>