Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
a926d832
Commit
a926d832
authored
Aug 27, 2004
by
tomas@poseidon.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
see respective file
parent
1192517a
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
91 additions
and
30 deletions
+91
-30
ndb/src/common/mgmcommon/Makefile.am
ndb/src/common/mgmcommon/Makefile.am
+1
-13
ndb/src/mgmclient/CommandInterpreter.cpp
ndb/src/mgmclient/CommandInterpreter.cpp
+60
-0
ndb/src/mgmclient/CommandInterpreter.hpp
ndb/src/mgmclient/CommandInterpreter.hpp
+1
-0
ndb/src/mgmsrv/Config.cpp
ndb/src/mgmsrv/Config.cpp
+0
-1
ndb/src/mgmsrv/Config.hpp
ndb/src/mgmsrv/Config.hpp
+1
-1
ndb/src/mgmsrv/ConfigInfo.cpp
ndb/src/mgmsrv/ConfigInfo.cpp
+8
-8
ndb/src/mgmsrv/ConfigInfo.hpp
ndb/src/mgmsrv/ConfigInfo.hpp
+0
-0
ndb/src/mgmsrv/InitConfigFileParser.cpp
ndb/src/mgmsrv/InitConfigFileParser.cpp
+0
-0
ndb/src/mgmsrv/InitConfigFileParser.hpp
ndb/src/mgmsrv/InitConfigFileParser.hpp
+0
-0
ndb/src/mgmsrv/Makefile.am
ndb/src/mgmsrv/Makefile.am
+13
-0
ndb/test/include/NdbBackup.hpp
ndb/test/include/NdbBackup.hpp
+1
-1
ndb/test/ndbapi/testDict.cpp
ndb/test/ndbapi/testDict.cpp
+1
-1
ndb/test/src/NdbBackup.cpp
ndb/test/src/NdbBackup.cpp
+5
-5
No files found.
ndb/src/common/mgmcommon/Makefile.am
View file @
a926d832
MYSQLDATAdir
=
$(localstatedir)
MYSQLSHAREdir
=
$(pkgdatadir)
MYSQLBASEdir
=
$(prefix)
noinst_LTLIBRARIES
=
libmgmsrvcommon.la
libmgmsrvcommon_la_SOURCES
=
\
LocalConfig.cpp
\
Config.cpp
\
ConfigInfo.cpp
\
ConfigRetriever.cpp
\
InitConfigFileParser.cpp
\
IPCConfig.cpp NdbConfig.c
INCLUDES_LOC
=
-I
$(top_srcdir)
/ndb/src/mgmapi
DEFS_LOC
=
-DDEFAULT_MYSQL_HOME
=
"
\"
$(MYSQLBASEdir)
\"
"
\
-DDATADIR
=
"
\"
$(MYSQLDATAdir)
\"
"
\
-DSHAREDIR
=
"
\"
$(MYSQLSHAREdir)
\"
"
\
-DNDB_BASE_PORT
=
"
\"
@ndb_port_base@
\"
"
INCLUDES_LOC
=
-I
$(top_srcdir)
/ndb/src/mgmapi
-I
$(top_srcdir)
/ndb/src/mgmsrv
include
$(top_srcdir)/ndb/config/common.mk.am
include
$(top_srcdir)/ndb/config/type_ndbapi.mk.am
...
...
ndb/src/mgmclient/CommandInterpreter.cpp
View file @
a926d832
...
...
@@ -47,10 +47,13 @@ static const char* helpText =
"HELP DEBUG Help for debug compiled version
\n
"
#endif
"SHOW Print information about cluster
\n
"
#if 0
"SHOW CONFIG Print configuration\n"
"SHOW PARAMETERS Print configuration parameters\n"
#endif
"START BACKUP Start backup
\n
"
"ABORT BACKUP <backup id> Abort backup
\n
"
"SHUTDOWN Shutdown all processed in cluster and quit
\n
"
"CLUSTERLOG ON Enable Cluster logging
\n
"
"CLUSTERLOG OFF Disable Cluster logging
\n
"
"CLUSTERLOG FILTER <severity> Toggle severity filter on/off
\n
"
...
...
@@ -62,7 +65,9 @@ static const char* helpText =
"EXIT SINGLE USER MODE Exit single user mode
\n
"
"<id> STATUS Print status
\n
"
"<id> CLUSTERLOG {<category>=<level>}+ Set log level for cluster log
\n
"
#ifdef HAVE_GLOBAL_REPLICATION
"REP CONNECT <host:port> Connect to REP server on host:port
\n
"
#endif
"QUIT Quit management client
\n
"
;
...
...
@@ -299,6 +304,10 @@ CommandInterpreter::readAndExecute(int _try_reconnect)
executeShow
(
allAfterFirstToken
);
return
true
;
}
else
if
(
strcmp
(
firstToken
,
"SHUTDOWN"
)
==
0
)
{
executeShutdown
(
allAfterFirstToken
);
return
true
;
}
else
if
(
strcmp
(
firstToken
,
"CLUSTERLOG"
)
==
0
){
executeClusterLog
(
allAfterFirstToken
);
return
true
;
...
...
@@ -628,6 +637,57 @@ CommandInterpreter::executeHelp(char* parameters)
}
/*****************************************************************************
* SHUTDOWN
*****************************************************************************/
void
CommandInterpreter
::
executeShutdown
(
char
*
parameters
)
{
connect
();
ndb_mgm_cluster_state
*
state
=
ndb_mgm_get_status
(
m_mgmsrv
);
if
(
state
==
NULL
)
{
ndbout_c
(
"Could not get status"
);
printError
();
return
;
}
int
result
=
0
;
result
=
ndb_mgm_stop
(
m_mgmsrv
,
0
,
0
);
if
(
result
<=
0
)
{
ndbout
<<
"Shutdown failed."
<<
endl
;
printError
();
return
;
}
ndbout
<<
"NDB Cluster storage node(s) have shutdown."
<<
endl
;
int
mgm_id
=
0
;
for
(
int
i
=
0
;
i
<
state
->
no_of_nodes
;
i
++
)
{
if
(
state
->
node_states
[
i
].
node_type
==
NDB_MGM_NODE_TYPE_MGM
&&
state
->
node_states
[
i
].
version
!=
0
){
if
(
mgm_id
==
0
)
mgm_id
=
state
->
node_states
[
i
].
node_id
;
else
{
ndbout
<<
"Unable to locate management server, shutdown manually with #STOP"
<<
endl
;
}
}
}
result
=
0
;
result
=
ndb_mgm_stop
(
m_mgmsrv
,
1
,
&
mgm_id
);
if
(
result
<=
0
)
{
ndbout
<<
"Shutdown failed."
<<
endl
;
printError
();
return
;
}
ndbout
<<
"NDB Cluster management server shutdown."
<<
endl
;
exit
(
0
);
}
/*****************************************************************************
* SHOW
*****************************************************************************/
...
...
ndb/src/mgmclient/CommandInterpreter.hpp
View file @
a926d832
...
...
@@ -127,6 +127,7 @@ private:
*/
void
executeHelp
(
char
*
parameters
);
void
executeShow
(
char
*
parameters
);
void
executeShutdown
(
char
*
parameters
);
void
executeRun
(
char
*
parameters
);
void
executeInfo
(
char
*
parameters
);
void
executeClusterLog
(
char
*
parameters
);
...
...
ndb/src/
common/mgmcommon
/Config.cpp
→
ndb/src/
mgmsrv
/Config.cpp
View file @
a926d832
...
...
@@ -19,7 +19,6 @@
#include <string.h>
#include "MgmtErrorReporter.hpp"
#include <Properties.hpp>
#include "ConfigInfo.hpp"
//*****************************************************************************
// Ctor / Dtor
...
...
ndb/src/
common/mgmcommon
/Config.hpp
→
ndb/src/
mgmsrv
/Config.hpp
View file @
a926d832
...
...
@@ -24,7 +24,7 @@
#include <NdbOut.hpp>
#include <ndb_limits.h>
#include <Properties.hpp>
#include
"ConfigInfo.hpp"
#include
<ConfigInfo.hpp>
class
ConfigInfo
;
...
...
ndb/src/
common/mgmcommon
/ConfigInfo.cpp
→
ndb/src/
mgmsrv
/ConfigInfo.cpp
View file @
a926d832
...
...
@@ -33,15 +33,15 @@
* Section names
****************************************************************************/
#define DB_TOKEN "
NDBD
"
#define MGM_TOKEN "
NDB_MGMD
"
#define API_TOKEN "
MYSQLD
"
#define DB_TOKEN "
DB
"
#define MGM_TOKEN "
MGM
"
#define API_TOKEN "
API
"
const
ConfigInfo
::
AliasPair
ConfigInfo
::
m_sectionNameAliases
[]
=
{
{
API_TOKEN
,
"
API
"
},
{
DB_TOKEN
,
"
DB
"
},
{
MGM_TOKEN
,
"
MGM
"
},
{
API_TOKEN
,
"
MYSQLD
"
},
{
DB_TOKEN
,
"
NDBD
"
},
{
MGM_TOKEN
,
"
NDB_MGMD
"
},
{
0
,
0
}
};
...
...
@@ -975,7 +975,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo
::
USED
,
false
,
ConfigInfo
::
STRING
,
DATA
DIR
,
MYSQLCLUSTER
DIR
,
0
,
0
},
{
...
...
@@ -1349,7 +1349,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo
::
USED
,
false
,
ConfigInfo
::
STRING
,
DATA
DIR
,
MYSQLCLUSTER
DIR
,
0
,
0
},
{
...
...
ndb/src/
common/mgmcommon
/ConfigInfo.hpp
→
ndb/src/
mgmsrv
/ConfigInfo.hpp
View file @
a926d832
File moved
ndb/src/
common/mgmcommon
/InitConfigFileParser.cpp
→
ndb/src/
mgmsrv
/InitConfigFileParser.cpp
View file @
a926d832
File moved
ndb/src/
common/mgmcommon
/InitConfigFileParser.hpp
→
ndb/src/
mgmsrv
/InitConfigFileParser.hpp
View file @
a926d832
File moved
ndb/src/mgmsrv/Makefile.am
View file @
a926d832
MYSQLDATAdir
=
$(localstatedir)
MYSQLSHAREdir
=
$(pkgdatadir)
MYSQLBASEdir
=
$(prefix)
MYSQLCLUSTERdir
=
$(prefix)
/mysql-cluster
ndbbin_PROGRAMS
=
ndb_mgmd
...
...
@@ -11,6 +15,9 @@ ndb_mgmd_SOURCES = \
NodeLogLevelList.cpp
\
SignalQueue.cpp
\
MgmtSrvrConfig.cpp
\
ConfigInfo.cpp
\
InitConfigFileParser.cpp
\
Config.cpp
\
CommandInterpreter.cpp
INCLUDES_LOC
=
-I
$(top_srcdir)
/ndb/src/ndbapi
\
...
...
@@ -24,6 +31,12 @@ LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \
$(top_builddir)
/strings/libmystrings.a
@TERMCAP_LIB@
DEFS_LOC
=
-DDEFAULT_MYSQL_HOME
=
"
\"
$(MYSQLBASEdir)
\"
"
\
-DDATADIR
=
"
\"
$(MYSQLDATAdir)
\"
"
\
-DSHAREDIR
=
"
\"
$(MYSQLSHAREdir)
\"
"
\
-DMYSQLCLUSTERDIR
=
"
\"
$(MYSQLCLUSTERdir)
\"
"
\
-DNDB_BASE_PORT
=
"
\"
@ndb_port_base@
\"
"
include
$(top_srcdir)/ndb/config/common.mk.am
include
$(top_srcdir)/ndb/config/type_ndbapi.mk.am
...
...
ndb/test/include/NdbBackup.hpp
View file @
a926d832
...
...
@@ -47,7 +47,7 @@ private:
int
_node_id
,
unsigned
_backup_id
);
const
char
*
get
FileSystemPath
ForNode
(
int
_node_id
);
const
char
*
get
BackupDataDir
ForNode
(
int
_node_id
);
};
...
...
ndb/test/ndbapi/testDict.cpp
View file @
a926d832
...
...
@@ -1305,7 +1305,7 @@ runTableRenameNF(NDBT_Context* ctx, NDBT_Step* step){
const
int
numNodes
=
restarter
.
getNumDbNodes
();
for
(
int
i
=
0
;
i
<
numNodes
;
i
++
){
int
nodeId
=
restarter
.
getDbNodeId
(
i
);
int
error
=
NF_codes
[
i
];
int
error
=
NF_codes
[
i
]
.
error_id
;
g_info
<<
"NF1: node = "
<<
nodeId
<<
" error code = "
<<
error
<<
endl
;
...
...
ndb/test/src/NdbBackup.cpp
View file @
a926d832
...
...
@@ -64,7 +64,7 @@ NdbBackup::start(unsigned int & _backup_id){
const
char
*
NdbBackup
::
get
FileSystemPath
ForNode
(
int
_node_id
){
NdbBackup
::
get
BackupDataDir
ForNode
(
int
_node_id
){
/**
* Fetch configuration from management server
...
...
@@ -106,8 +106,8 @@ NdbBackup::getFileSystemPathForNode(int _node_id){
}
const
char
*
path
;
if
(
iter
.
get
(
CFG_DB_
FILESYSTEM_PATH
,
&
path
)){
ndbout
<<
"
FileSystemPath
not found"
<<
endl
;
if
(
iter
.
get
(
CFG_DB_
BACKUP_DATADIR
,
&
path
)){
ndbout
<<
"
BackupDataDir
not found"
<<
endl
;
return
NULL
;
}
...
...
@@ -123,9 +123,9 @@ NdbBackup::execRestore(bool _restore_data,
const
int
buf_len
=
1000
;
char
buf
[
buf_len
];
ndbout
<<
"get
FileSystemPathForNode
"
<<
_node_id
<<
endl
;
ndbout
<<
"get
BackupDataDir
"
<<
_node_id
<<
endl
;
const
char
*
path
=
get
FileSystemPath
ForNode
(
_node_id
);
const
char
*
path
=
get
BackupDataDir
ForNode
(
_node_id
);
if
(
path
==
NULL
)
return
-
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment