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" ]
|
if [ -z "$USE_RUNNING_NDBCLUSTER" ]
|
||||||
then
|
then
|
||||||
# Kill any running ndbcluster stuff
|
# Kill any running ndbcluster stuff
|
||||||
./ndb/stop_ndbcluster
|
./ndb/ndbcluster --stop
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -1438,7 +1438,7 @@ then
|
|||||||
if [ -z "$USE_RUNNING_NDBCLUSTER" ]
|
if [ -z "$USE_RUNNING_NDBCLUSTER" ]
|
||||||
then
|
then
|
||||||
echo "Starting ndbcluster"
|
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`
|
export NDB_CONNECTSTRING=`cat Ndb.cfg`
|
||||||
else
|
else
|
||||||
export NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER"
|
export NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER"
|
||||||
@ -1538,7 +1538,7 @@ then
|
|||||||
if [ -z "$USE_RUNNING_NDBCLUSTER" ]
|
if [ -z "$USE_RUNNING_NDBCLUSTER" ]
|
||||||
then
|
then
|
||||||
# Kill any running ndbcluster stuff
|
# Kill any running ndbcluster stuff
|
||||||
./ndb/stop_ndbcluster
|
./ndb/ndbcluster --stop
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -2,13 +2,9 @@
|
|||||||
benchdir_root= $(prefix)
|
benchdir_root= $(prefix)
|
||||||
testdir = $(benchdir_root)/mysql-test/ndb
|
testdir = $(benchdir_root)/mysql-test/ndb
|
||||||
|
|
||||||
test_SCRIPTS = \
|
test_SCRIPTS = ndbcluster
|
||||||
install_ndbcluster \
|
|
||||||
stop_ndbcluster
|
|
||||||
|
|
||||||
EXTRA_SCRIPTS = \
|
EXTRA_SCRIPTS = ndbcluster.sh
|
||||||
install_ndbcluster.sh \
|
|
||||||
stop_ndbcluster.sh
|
|
||||||
|
|
||||||
test_DATA = ndb_config_2_node.ini
|
test_DATA = ndb_config_2_node.ini
|
||||||
|
|
||||||
|
@ -19,28 +19,34 @@ cd $CWD
|
|||||||
if [ -d ../sql ] ; then
|
if [ -d ../sql ] ; then
|
||||||
SOURCE_DIST=1
|
SOURCE_DIST=1
|
||||||
ndbtop=$BASEDIR/ndb
|
ndbtop=$BASEDIR/ndb
|
||||||
exec_ndb=$ndbtop/src/kernel/ndb-main/ndb
|
exec_ndb=$ndbtop/src/kernel/ndb-main/ndbd
|
||||||
exec_mgmtsrvr=$ndbtop/src/mgmsrv/mgmtsrvr
|
exec_mgmtsrvr=$ndbtop/src/mgmsrv/ndb_mgmd
|
||||||
exec_waiter=$ndbtop/tools/ndb_waiter
|
exec_waiter=$ndbtop/tools/ndb_waiter
|
||||||
exec_mgmtclient=$ndbtop/src/mgmclient/mgmtclient
|
exec_mgmtclient=$ndbtop/src/mgmclient/ndb_mgmclient
|
||||||
else
|
else
|
||||||
BINARY_DIST=1
|
BINARY_DIST=1
|
||||||
if test -x "$BASEDIR/libexec/ndb"
|
if test -x "$BASEDIR/libexec/ndbd"
|
||||||
then
|
then
|
||||||
exec_ndb=$BASEDIR/libexec/ndb
|
exec_ndb=$BASEDIR/libexec/ndbd
|
||||||
exec_mgmtsrvr=$BASEDIR/libexec/mgmtsrvr
|
exec_mgmtsrvr=$BASEDIR/libexec/ndb_mgmd
|
||||||
else
|
else
|
||||||
exec_ndb=$BASEDIR/bin/ndb
|
exec_ndb=$BASEDIR/bin/ndbd
|
||||||
exec_mgmtsrvr=$BASEDIR/bin/mgmtsrvr
|
exec_mgmtsrvr=$BASEDIR/bin/ndb_mgmd
|
||||||
fi
|
fi
|
||||||
exec_waiter=$BASEDIR/bin/ndb_waiter
|
exec_waiter=$BASEDIR/bin/ndb_waiter
|
||||||
exec_mgmtclient=$BASEDIR/bin/mgmtclient
|
exec_mgmtclient=$BASEDIR/bin/ndb_mgmclient
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pidfile=ndbcluster.pid
|
pidfile=ndbcluster.pid
|
||||||
|
cfgfile=Ndb.cfg
|
||||||
|
stop_ndb=
|
||||||
|
initial_ndb=
|
||||||
|
|
||||||
while test $# -gt 0; do
|
while test $# -gt 0; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
--stop)
|
||||||
|
stop_ndb=1
|
||||||
|
;;
|
||||||
--initial)
|
--initial)
|
||||||
flags_ndb=$flags_ndb" -i"
|
flags_ndb=$flags_ndb" -i"
|
||||||
initial_ndb=1
|
initial_ndb=1
|
||||||
@ -123,7 +129,7 @@ sed \
|
|||||||
> "$fs_mgm_1/config.ini"
|
> "$fs_mgm_1/config.ini"
|
||||||
fi
|
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`"
|
echo "Unable to start $exec_mgmtsrvr from `pwd`"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -134,7 +140,7 @@ cat `find $fs_ndb -name 'node*.pid'` > $pidfile
|
|||||||
|
|
||||||
NDB_ID="2"
|
NDB_ID="2"
|
||||||
NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
|
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
|
cat `find $fs_ndb -name 'node*.pid'` > $pidfile
|
||||||
|
|
||||||
@ -142,7 +148,7 @@ cat `find $fs_ndb -name 'node*.pid'` > $pidfile
|
|||||||
|
|
||||||
NDB_ID="3"
|
NDB_ID="3"
|
||||||
NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
|
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
|
cat `find $fs_ndb -name 'node*.pid'` > $pidfile
|
||||||
|
|
||||||
@ -160,11 +166,45 @@ if ( $exec_waiter ) | grep "NDBT_ProgramExit: 0 - OK"; then :; else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $NDB_CONNECTSTRING > Ndb.cfg
|
echo $NDB_CONNECTSTRING > $cfgfile
|
||||||
|
|
||||||
cat `find $fs_ndb -name 'node*.pid'` > $pidfile
|
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
|
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
|
|
@ -2,9 +2,9 @@ SUBDIRS = error blocks vm
|
|||||||
|
|
||||||
include $(top_srcdir)/ndb/config/common.mk.am
|
include $(top_srcdir)/ndb/config/common.mk.am
|
||||||
|
|
||||||
ndbbin_PROGRAMS = ndb
|
ndbbin_PROGRAMS = ndbd
|
||||||
|
|
||||||
ndb_SOURCES = Main.cpp SimBlockList.cpp
|
ndbd_SOURCES = Main.cpp SimBlockList.cpp
|
||||||
|
|
||||||
include $(top_srcdir)/ndb/config/type_kernel.mk.am
|
include $(top_srcdir)/ndb/config/type_kernel.mk.am
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
ndbtools_PROGRAMS = restore
|
ndbtools_PROGRAMS = ndb_restore
|
||||||
|
|
||||||
restore_SOURCES = main.cpp Restore.cpp
|
ndb_restore_SOURCES = main.cpp Restore.cpp
|
||||||
|
|
||||||
LDADD_LOC = $(top_srcdir)/ndb/src/libndbclient.la
|
LDADD_LOC = $(top_srcdir)/ndb/src/libndbclient.la
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
ndbtools_PROGRAMS = mgmtclient
|
ndbtools_PROGRAMS = ndb_mgm
|
||||||
|
|
||||||
mgmtclient_SOURCES = \
|
ndb_mgm_SOURCES = \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
CommandInterpreter.cpp \
|
CommandInterpreter.cpp \
|
||||||
CpcClient.cpp
|
CpcClient.cpp
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
ndbbin_PROGRAMS = mgmtsrvr
|
ndbbin_PROGRAMS = ndb_mgmd
|
||||||
|
|
||||||
mgmtsrvr_SOURCES = \
|
ndb_mgmd_SOURCES = \
|
||||||
MgmtSrvr.cpp \
|
MgmtSrvr.cpp \
|
||||||
MgmtSrvrGeneralSignalHandling.cpp \
|
MgmtSrvrGeneralSignalHandling.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
|
@ -1,14 +1,22 @@
|
|||||||
|
|
||||||
ndbtools_PROGRAMS = ndb_waiter drop_tab delete_all desc drop_index list_tables select_all select_count
|
ndbtools_PROGRAMS = \
|
||||||
|
ndb_waiter \
|
||||||
|
ndb_drop_table \
|
||||||
|
ndb_delete_all \
|
||||||
|
ndb_desc \
|
||||||
|
ndb_drop_index \
|
||||||
|
ndb_show_tables \
|
||||||
|
ndb_select_all \
|
||||||
|
ndb_select_count
|
||||||
|
|
||||||
ndb_waiter_SOURCES = waiter.cpp
|
ndb_waiter_SOURCES = waiter.cpp
|
||||||
delete_all_SOURCES = delete_all.cpp
|
ndb_delete_all_SOURCES = delete_all.cpp
|
||||||
desc_SOURCES = desc.cpp
|
ndb_desc_SOURCES = desc.cpp
|
||||||
drop_index_SOURCES = drop_index.cpp
|
ndb_drop_index_SOURCES = drop_index.cpp
|
||||||
drop_tab_SOURCES = drop_tab.cpp
|
ndb_drop_table_SOURCES = drop_tab.cpp
|
||||||
list_tables_SOURCES = listTables.cpp
|
ndb_show_tables_SOURCES = listTables.cpp
|
||||||
select_all_SOURCES = select_all.cpp
|
ndb_select_all_SOURCES = select_all.cpp
|
||||||
select_count_SOURCES = select_count.cpp
|
ndb_select_count_SOURCES = select_count.cpp
|
||||||
|
|
||||||
include $(top_srcdir)/ndb/config/common.mk.am
|
include $(top_srcdir)/ndb/config/common.mk.am
|
||||||
include $(top_srcdir)/ndb/config/type_ndbapitools.mk.am
|
include $(top_srcdir)/ndb/config/type_ndbapitools.mk.am
|
||||||
|
Reference in New Issue
Block a user