mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
collapsed ndb start/stop scripts in mysql-test-run + ndb bin name changes
This commit is contained in:
@ -1417,7 +1417,7 @@ then
|
||||
if [ -z "$USE_RUNNING_NDBCLUSTER" ]
|
||||
then
|
||||
# Kill any running ndbcluster stuff
|
||||
./ndb/stop_ndbcluster
|
||||
./ndb/ndbcluster --stop
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -1438,7 +1438,7 @@ then
|
||||
if [ -z "$USE_RUNNING_NDBCLUSTER" ]
|
||||
then
|
||||
echo "Starting ndbcluster"
|
||||
./ndb/install_ndbcluster --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1
|
||||
./ndb/ndbcluster --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1
|
||||
export NDB_CONNECTSTRING=`cat Ndb.cfg`
|
||||
else
|
||||
export NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER"
|
||||
@ -1538,7 +1538,7 @@ then
|
||||
if [ -z "$USE_RUNNING_NDBCLUSTER" ]
|
||||
then
|
||||
# Kill any running ndbcluster stuff
|
||||
./ndb/stop_ndbcluster
|
||||
./ndb/ndbcluster --stop
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
@ -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
|
Reference in New Issue
Block a user