summaryrefslogtreecommitdiff
path: root/mysql-test/ndb
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2004-06-02 10:37:42 +0000
committerunknown <tomas@poseidon.ndb.mysql.com>2004-06-02 10:37:42 +0000
commit9f7c48604435cf6254da7816810575b2a03695b0 (patch)
tree81ae58f3861a002e1f60ae8d1622efbf7a91a950 /mysql-test/ndb
parentfa0df3e336bb98acaad72f48ab82a706c73b56bc (diff)
downloadmariadb-git-9f7c48604435cf6254da7816810575b2a03695b0.tar.gz
collapsed ndb start/stop scripts in mysql-test-run + ndb bin name changes
BitKeeper/deleted/.del-stop_ndbcluster.sh~b3b9e9505384aca1: Delete: mysql-test/ndb/stop_ndbcluster.sh mysql-test/mysql-test-run.sh: collapsed ndb start/stop scripts mysql-test/ndb/Makefile.am: collapsed ndb start/stop scripts mysql-test/ndb/ndbcluster.sh: collapsed ndb start/stop scripts + ndb bin name changes ndb/src/kernel/Makefile.am: ndb bin name changes ndb/src/kernel/blocks/backup/restore/Makefile.am: ndb bin name changes ndb/src/mgmclient/Makefile.am: ndb bin name changes ndb/src/mgmsrv/Makefile.am: ndb bin name changes ndb/tools/Makefile.am: ndb bin name changes
Diffstat (limited to 'mysql-test/ndb')
-rw-r--r--mysql-test/ndb/Makefile.am8
-rwxr-xr-xmysql-test/ndb/ndbcluster.sh (renamed from mysql-test/ndb/install_ndbcluster.sh)68
-rwxr-xr-xmysql-test/ndb/stop_ndbcluster.sh82
3 files changed, 56 insertions, 102 deletions
diff --git a/mysql-test/ndb/Makefile.am b/mysql-test/ndb/Makefile.am
index 9ab785346da..44627c85bb5 100644
--- a/mysql-test/ndb/Makefile.am
+++ b/mysql-test/ndb/Makefile.am
@@ -2,13 +2,9 @@
benchdir_root= $(prefix)
testdir = $(benchdir_root)/mysql-test/ndb
-test_SCRIPTS = \
-install_ndbcluster \
-stop_ndbcluster
+test_SCRIPTS = ndbcluster
-EXTRA_SCRIPTS = \
-install_ndbcluster.sh \
-stop_ndbcluster.sh
+EXTRA_SCRIPTS = ndbcluster.sh
test_DATA = ndb_config_2_node.ini
diff --git a/mysql-test/ndb/install_ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh
index 00e341e8563..c894885360e 100755
--- a/mysql-test/ndb/install_ndbcluster.sh
+++ b/mysql-test/ndb/ndbcluster.sh
@@ -19,28 +19,34 @@ cd $CWD
if [ -d ../sql ] ; then
SOURCE_DIST=1
ndbtop=$BASEDIR/ndb
- exec_ndb=$ndbtop/src/kernel/ndb-main/ndb
- exec_mgmtsrvr=$ndbtop/src/mgmsrv/mgmtsrvr
+ exec_ndb=$ndbtop/src/kernel/ndb-main/ndbd
+ exec_mgmtsrvr=$ndbtop/src/mgmsrv/ndb_mgmd
exec_waiter=$ndbtop/tools/ndb_waiter
- exec_mgmtclient=$ndbtop/src/mgmclient/mgmtclient
+ exec_mgmtclient=$ndbtop/src/mgmclient/ndb_mgmclient
else
BINARY_DIST=1
- if test -x "$BASEDIR/libexec/ndb"
+ if test -x "$BASEDIR/libexec/ndbd"
then
- exec_ndb=$BASEDIR/libexec/ndb
- exec_mgmtsrvr=$BASEDIR/libexec/mgmtsrvr
+ exec_ndb=$BASEDIR/libexec/ndbd
+ exec_mgmtsrvr=$BASEDIR/libexec/ndb_mgmd
else
- exec_ndb=$BASEDIR/bin/ndb
- exec_mgmtsrvr=$BASEDIR/bin/mgmtsrvr
+ exec_ndb=$BASEDIR/bin/ndbd
+ exec_mgmtsrvr=$BASEDIR/bin/ndb_mgmd
fi
exec_waiter=$BASEDIR/bin/ndb_waiter
- exec_mgmtclient=$BASEDIR/bin/mgmtclient
+ exec_mgmtclient=$BASEDIR/bin/ndb_mgmclient
fi
pidfile=ndbcluster.pid
+cfgfile=Ndb.cfg
+stop_ndb=
+initial_ndb=
while test $# -gt 0; do
case "$1" in
+ --stop)
+ stop_ndb=1
+ ;;
--initial)
flags_ndb=$flags_ndb" -i"
initial_ndb=1
@@ -123,7 +129,7 @@ sed \
> "$fs_mgm_1/config.ini"
fi
-if ( cd $fs_mgm_1 ; echo $NDB_CONNECTSTRING > Ndb.cfg ; $exec_mgmtsrvr -d -c config.ini ) ; then :; else
+if ( cd $fs_mgm_1 ; echo $NDB_CONNECTSTRING > $cfgfile ; $exec_mgmtsrvr -d -c config.ini ) ; then :; else
echo "Unable to start $exec_mgmtsrvr from `pwd`"
exit 1
fi
@@ -134,7 +140,7 @@ cat `find $fs_ndb -name 'node*.pid'` > $pidfile
NDB_ID="2"
NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
-( cd $fs_ndb_2 ; echo $NDB_CONNECTSTRING > Ndb.cfg ; $exec_ndb -d $flags_ndb & )
+( cd $fs_ndb_2 ; echo $NDB_CONNECTSTRING > $cfgfile ; $exec_ndb -d $flags_ndb & )
cat `find $fs_ndb -name 'node*.pid'` > $pidfile
@@ -142,7 +148,7 @@ cat `find $fs_ndb -name 'node*.pid'` > $pidfile
NDB_ID="3"
NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
-( cd $fs_ndb_3 ; echo $NDB_CONNECTSTRING > Ndb.cfg ; $exec_ndb -d $flags_ndb & )
+( cd $fs_ndb_3 ; echo $NDB_CONNECTSTRING > $cfgfile ; $exec_ndb -d $flags_ndb & )
cat `find $fs_ndb -name 'node*.pid'` > $pidfile
@@ -160,11 +166,45 @@ if ( $exec_waiter ) | grep "NDBT_ProgramExit: 0 - OK"; then :; else
exit 1
fi
-echo $NDB_CONNECTSTRING > Ndb.cfg
+echo $NDB_CONNECTSTRING > $cfgfile
cat `find $fs_ndb -name 'node*.pid'` > $pidfile
}
-start_default_ndbcluster
+stop_default_ndbcluster() {
+
+#if [ ! -f $pidfile ] ; then
+# exit 0
+#fi
+
+if [ ! -f $cfgfile ] ; then
+ echo "$cfgfile missing"
+ exit 1
+fi
+
+ndb_host=`cat $cfgfile | sed -e "s,.*host=\(.*\)\:.*,\1,1"`
+ndb_port=`cat $cfgfile | sed -e "s,.*host=$ndb_host\:\([0-9]*\).*,\1,1"`
+
+# Start management client
+
+exec_mgmtclient="$exec_mgmtclient --try-reconnect=1 $ndb_host $ndb_port"
+
+echo "$exec_mgmtclient"
+echo "all stop" | $exec_mgmtclient
+
+sleep 5
+
+if [ -f $pidfile ] ; then
+ kill `cat $pidfile`
+ rm $pidfile
+fi
+
+}
+
+if [ $stop_ndb ] ; then
+ stop_default_ndbcluster
+else
+ start_default_ndbcluster
+fi
exit 0
diff --git a/mysql-test/ndb/stop_ndbcluster.sh b/mysql-test/ndb/stop_ndbcluster.sh
deleted file mode 100755
index 50fd755169d..00000000000
--- a/mysql-test/ndb/stop_ndbcluster.sh
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2004 MySQL AB
-# For a more info consult the file COPYRIGHT distributed with this file
-
-# This scripts stops the table handler ndbcluster
-
-#BASEDIR is always one above mysql-test directory
-CWD=`pwd`
-cd ..
-BASEDIR=`pwd`
-cd $CWD
-
-# Are we using a source or a binary distribution?
-if [ -d ../sql ] ; then
- SOURCE_DIST=1
- ndbtop=$BASEDIR/ndb
- exec_ndb=$ndbtop/src/kernel/ndb-main/ndb
- exec_mgmtsrvr=$ndbtop/src/mgmsrv/mgmtsrvr
- exec_waiter=$ndbtop/tools/ndb_waiter
- exec_mgmtclient=$ndbtop/src/mgmclient/mgmtclient
-else
- BINARY_DIST=1
- if test -x "$BASEDIR/libexec/ndb"
- then
- exec_ndb=$BASEDIR/libexec/ndb
- exec_mgmtsrvr=$BASEDIR/libexec/mgmtsrvr
- else
- exec_ndb=$BASEDIR/bin/ndb
- exec_mgmtsrvr=$BASEDIR/bin/mgmtsrvr
- fi
- exec_waiter=$BASEDIR/bin/ndb_waiter
- exec_mgmtclient=$BASEDIR/bin/mgmtclient
-fi
-
-pidfile=ndbcluster.pid
-cfgfile=Ndb.cfg
-
-while test $# -gt 0; do
- case "$1" in
- --port-base=*)
- port_base=`echo "$1" | sed -e "s;--port-base=;;"`
- ;;
- -- ) shift; break ;;
- --* ) $ECHO "Unrecognized option: $1"; exit 1 ;;
- * ) break ;;
- esac
- shift
-done
-
-stop_default_ndbcluster() {
-
-#if [ ! -f $pidfile ] ; then
-# exit 0
-#fi
-
-if [ ! -f $cfgfile ] ; then
- echo "$cfgfile missing"
- exit 1
-fi
-
-ndb_host=`cat $cfgfile | sed -e "s,.*host=\(.*\)\:.*,\1,1"`
-ndb_port=`cat $cfgfile | sed -e "s,.*host=$ndb_host\:\([0-9]*\).*,\1,1"`
-
-# Start management client
-
-exec_mgmtclient="$exec_mgmtclient --try-reconnect=1 $ndb_host $ndb_port"
-
-echo "$exec_mgmtclient"
-echo "all stop" | $exec_mgmtclient
-
-sleep 5
-
-if [ -f $pidfile ] ; then
- kill `cat $pidfile`
- rm $pidfile
-fi
-
-}
-
-stop_default_ndbcluster
-
-exit 0