1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-16 20:23:18 +03:00

ndb cluster config fixes, se respective files

mysql-test/ndb/ndb_config_2_node.ini:
  added new config parameter datadir
ndb/include/mgmapi/mgmapi_config_parameters.h:
  added new config parameter datadir and backup data dir
ndb/include/mgmcommon/ConfigRetriever.hpp:
  changed verify config so that it can be used by mgmt srvr
ndb/include/mgmcommon/NdbConfig.h:
  added option to set path for ndb files
ndb/src/common/mgmcommon/ConfigInfo.cpp:
  changed token names for DB, MGM and API
  added config parametsers for datadir and backup data dir
ndb/src/common/mgmcommon/ConfigRetriever.cpp:
  changed verify config so that it can be used by mgmt srvr
ndb/src/common/mgmcommon/InitConfigFileParser.cpp:
  no need anymore to make uppercase
ndb/src/common/mgmcommon/NdbConfig.c:
  bugfix+
  added method to set datadir
ndb/src/kernel/Makefile.am:
  added debug libs to ndbd
ndb/src/kernel/vm/Configuration.cpp:
  added debug libs to ndbd
ndb/src/mgmsrv/MgmtSrvr.cpp:
  added verify config to mgmt srvr
ndb/src/mgmsrv/main.cpp:
  .
This commit is contained in:
unknown
2004-08-26 14:35:33 +00:00
parent e387719d46
commit c42ce28591
12 changed files with 339 additions and 208 deletions

View File

@@ -154,7 +154,7 @@ ConfigRetriever::getConfig() {
if(p == 0)
return 0;
if(!verifyConfig(p)){
if(!verifyConfig(p, _ownNodeId)){
free(p);
p= 0;
}
@@ -239,7 +239,7 @@ ConfigRetriever::setConnectString(const char * connectString) {
}
bool
ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){
ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf, Uint32 nodeid){
char buf[255];
ndb_mgm_configuration_iterator * it;
@@ -253,8 +253,8 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){
}
NdbAutoPtr<ndb_mgm_configuration_iterator> ptr(it);
if(ndb_mgm_find(it, CFG_NODE_ID, _ownNodeId) != 0){
snprintf(buf, 255, "Unable to find node with id: %d", _ownNodeId);
if(ndb_mgm_find(it, CFG_NODE_ID, nodeid) != 0){
snprintf(buf, 255, "Unable to find node with id: %d", nodeid);
setError(CR_ERROR, buf);
return false;
}
@@ -266,6 +266,11 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){
return false;
}
const char * datadir;
if(!ndb_mgm_get_string_parameter(it, CFG_NODE_DATADIR, &datadir)){
NdbConfig_SetPath(datadir);
}
char localhost[MAXHOSTNAMELEN];
if(NdbHost_GetHostName(localhost) != 0){
snprintf(buf, 255, "Unable to get own hostname");
@@ -332,8 +337,8 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){
if(iter.get(CFG_CONNECTION_NODE_1, &nodeId1)) continue;
if(iter.get(CFG_CONNECTION_NODE_2, &nodeId2)) continue;
if(nodeId1 != _ownNodeId && nodeId2 != _ownNodeId) continue;
remoteNodeId = (_ownNodeId == nodeId1 ? nodeId2 : nodeId1);
if(nodeId1 != nodeid && nodeId2 != nodeid) continue;
remoteNodeId = (nodeid == nodeId1 ? nodeId2 : nodeId1);
const char * name;
struct in_addr addr;
@@ -342,7 +347,7 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){
if(Ndb_getInAddr(&addr, name) != 0){
tmp.assfmt("Unable to lookup/illegal hostname %s, "
"connection from node %d to node %d",
name, _ownNodeId, remoteNodeId);
name, nodeid, remoteNodeId);
setError(CR_ERROR, tmp.c_str());
return false;
}
@@ -352,7 +357,7 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){
if(Ndb_getInAddr(&addr, name) != 0){
tmp.assfmt("Unable to lookup/illegal hostname %s, "
"connection from node %d to node %d",
name, _ownNodeId, remoteNodeId);
name, nodeid, remoteNodeId);
setError(CR_ERROR, tmp.c_str());
return false;
}