Commit b6ed85ba authored by unknown's avatar unknown
Browse files

added configure switch for ndb port number

    added new variable for ndb port 1186
    changed meaning of ndb_port_base to be default tcp port setting
    changed to use split between port and port_base for ndbcluster
    so that ndb_port and ndb_port_base are propagated to startscript for ndbcluster
    added larger space to pid print
    moved readAndExecute out of CommandInterpreter to avoid linking lib with readline
    added c-api to Ndb_mgmclient
    pass also ndb_port to make


acinclude.m4:
  added configure switch for ndb port number
configure.in:
  added new variable for ndb port 1186
  changed meaning of ndb_port_base to be default tcp port setting
mysql-test/mysql-test-run.sh:
  changed to use split between port and port_base for ndbcluster
mysql-test/ndb/Makefile.am:
  so that ndb_port and ndb_port_base are propagated to startscript for ndbcluster
mysql-test/ndb/ndbcluster.sh:
  so that ndb_port and ndb_port_base are propagated to startscript for ndbcluster
ndb/src/common/mgmcommon/LocalConfig.cpp:
  so that ndb_port and ndb_port_base are propagated to startscript for ndbcluster
ndb/src/common/mgmcommon/Makefile.am:
  so that ndb_port and ndb_port_base are propagated to startscript for ndbcluster
ndb/src/common/mgmcommon/NdbConfig.c:
  added larger space to pid print
ndb/src/mgmclient/CommandInterpreter.cpp:
  moved readAndExecute out of CommandInterpreter to avoid linking lib with readline
  added c-api to Ndb_mgmclient
ndb/src/mgmclient/main.cpp:
  moved readAndExecute out of CommandInterpreter to avoid linking lib with readline
ndb/src/mgmclient/ndb_mgmclient.hpp:
  moved readAndExecute out of CommandInterpreter to avoid linking lib with readline
ndb/src/mgmsrv/ConfigInfo.cpp:
  moved readAndExecute out of CommandInterpreter to avoid linking lib with readline
ndb/src/mgmsrv/Makefile.am:
  pass also ndb_port to make
parent a12d6fd6
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1614,9 +1614,14 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
  --with-ndb-docs       Include the NDB Cluster ndbapi and mgmapi documentation],
              [ndb_docs="$withval"],
              [ndb_docs=no])
  AC_ARG_WITH([ndb-port],
              [
  --with-ndb-port       Port for NDB Cluster management server],
              [ndb_port="$withval"],
              [ndb_port="default"])
  AC_ARG_WITH([ndb-port-base],
              [
  --with-ndb-port-base  Base port for NDB Cluster],
  --with-ndb-port-base  Base port for NDB Cluster transporters],
              [ndb_port_base="$withval"],
              [ndb_port_base="default"])
                                                                                
+7 −1
Original line number Diff line number Diff line
@@ -3052,9 +3052,15 @@ AC_SUBST([NDB_DEFS])
AC_SUBST([ndb_cxxflags_fix])


if test X"$ndb_port" = Xdefault
then
  ndb_port="1186"
fi
AC_SUBST([ndb_port])

if test X"$ndb_port_base" = Xdefault
then
  ndb_port_base="2200"
  ndb_port_base="2202"
fi
AC_SUBST([ndb_port_base])

+7 −4
Original line number Diff line number Diff line
@@ -457,6 +457,9 @@ SMALL_SERVER="--key_buffer_size=1M --sort_buffer=256K --max_heap_table_size=1M"

export MASTER_MYPORT MASTER_MYPORT1 SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MASTER_MYSOCK1

NDBCLUSTER_BASE_PORT=`expr $NDBCLUSTER_PORT + 2`
NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --port-base=$NDBCLUSTER_BASE_PORT --data-dir=$MYSQL_TEST_DIR/var"

if [ x$SOURCE_DIST = x1 ] ; then
 MY_BASEDIR=$MYSQL_TEST_DIR
else
@@ -939,11 +942,11 @@ start_ndbcluster()
    echo "Starting ndbcluster"
    if [ "$DO_BENCH" = 1 ]
    then
      NDBCLUSTER_OPTS=""
      NDBCLUSTER_EXTRA_OPTS=""
    else
      NDBCLUSTER_OPTS="--small"
      NDBCLUSTER_EXTRA_OPTS="--small"
    fi
    ./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT $NDBCLUSTER_OPTS --diskless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1
    ./ndb/ndbcluster $NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --diskless --initial || exit 1
    NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT"
  else
    NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER"
@@ -961,7 +964,7 @@ stop_ndbcluster()
 if [ -z "$USE_RUNNING_NDBCLUSTER" ]
 then
   # Kill any running ndbcluster stuff
   ./ndb/ndbcluster --data-dir=$MYSQL_TEST_DIR/var --port-base=$NDBCLUSTER_PORT --stop
   ./ndb/ndbcluster $NDBCLUSTER_OPTS --stop
 fi
 fi
}
+2 −0
Original line number Diff line number Diff line
@@ -13,6 +13,8 @@ SUFFIXES = .sh
.sh:
	@RM@ -f $@ $@-t
	@SED@ \
	  -e 's!@''ndb_port''@!$(ndb_port)!g' \
	  -e 's!@''ndb_port_base''@!$(ndb_port_base)!g' \
	  -e 's!@''ndbbindir''@!$(ndbbindir)!g' \
	  -e 's!@''ndbtoolsdir''@!$(ndbtoolsdir)!g' \
	  $< > $@-t
+8 −8
Original line number Diff line number Diff line
@@ -5,7 +5,8 @@
# This scripts starts the table handler ndbcluster

# configurable parameters, make sure to change in mysqlcluterd as well
port_base="2200"
port=@ndb_port@
port_base=@ndb_port_base@
fsdir=`pwd`
# end configurable parameters

@@ -84,6 +85,9 @@ while test $# -gt 0; do
    --data-dir=*)
     fsdir=`echo "$1" | sed -e "s;--data-dir=;;"`
     ;;
    --port=*)
     port=`echo "$1" | sed -e "s;--port=;;"`
     ;;
    --port-base=*)
     port_base=`echo "$1" | sed -e "s;--port-base=;;"`
     ;;
@@ -94,7 +98,7 @@ while test $# -gt 0; do
  shift
done

fs_ndb="$fsdir/ndbcluster-$port_base"
fs_ndb="$fsdir/ndbcluster-$port"

NDB_HOME=
if [ ! -x "$fsdir" ]; then
@@ -120,7 +124,7 @@ exec_ndb="$exec_ndb --no-defaults"
exec_waiter="$exec_waiter --no-defaults"

ndb_host="localhost"
ndb_mgmd_port=$port_base
ndb_mgmd_port=$port
NDB_CONNECTSTRING="host=$ndb_host:$ndb_mgmd_port"
export NDB_CONNECTSTRING

@@ -158,10 +162,6 @@ if [ -d "$fs_ndb" ]; then :; else
  exit 1
fi

# set som help variables

port_transporter=`expr $ndb_mgmd_port + 2`

# Start management server as deamon

# Edit file system path and ports in config file
@@ -176,7 +176,7 @@ sed \
    -e s,"CHOOSE_HOSTNAME_".*,"$ndb_host",g \
    -e s,"CHOOSE_FILESYSTEM","$fs_ndb",g \
    -e s,"CHOOSE_PORT_MGM","$ndb_mgmd_port",g \
    -e s,"CHOOSE_PORT_TRANSPORTER","$port_transporter",g \
    -e s,"CHOOSE_PORT_TRANSPORTER","$port_base",g \
    < ndb/ndb_config_2_node.ini \
    > "$fs_ndb/config.ini"
fi
Loading