moved default setting to config.ini to MgmtSrvr

only try to connect to other ndb_mgmd if connect_string explicitly given or config_file not given
parent 3d6e811e
...@@ -432,15 +432,20 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server, ...@@ -432,15 +432,20 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server,
theFacade = 0; theFacade = 0;
m_newConfig = NULL; m_newConfig = NULL;
m_configFilename.assign(config_filename); if (config_filename)
m_configFilename.assign(config_filename);
else
m_configFilename.assign("config.ini");
m_nextConfigGenerationNumber = 0; m_nextConfigGenerationNumber = 0;
m_config_retriever= new ConfigRetriever(connect_string, m_config_retriever= new ConfigRetriever(connect_string,
NDB_VERSION, NDB_MGM_NODE_TYPE_MGM); NDB_VERSION, NDB_MGM_NODE_TYPE_MGM);
// if connect_string explicitly given or
// no config filename is given then
// first try to allocate nodeid from another management server // first try to allocate nodeid from another management server
if(m_config_retriever->do_connect(0,0,0) == 0) if ((connect_string || config_filename == NULL) &&
(m_config_retriever->do_connect(0,0,0) == 0))
{ {
int tmp_nodeid= 0; int tmp_nodeid= 0;
tmp_nodeid= m_config_retriever->allocNodeId(0 /*retry*/,0 /*delay*/); tmp_nodeid= m_config_retriever->allocNodeId(0 /*retry*/,0 /*delay*/);
......
...@@ -188,7 +188,6 @@ int main(int argc, char** argv) ...@@ -188,7 +188,6 @@ int main(int argc, char** argv)
#endif #endif
global_mgmt_server_check = 1; global_mgmt_server_check = 1;
glob.config_filename= "config.ini";
const char *load_default_groups[]= { "mysql_cluster","ndb_mgmd",0 }; const char *load_default_groups[]= { "mysql_cluster","ndb_mgmd",0 };
load_defaults("my",load_default_groups,&argc,&argv); load_defaults("my",load_default_groups,&argc,&argv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment