You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-1523
This commit is contained in:
@ -10,5 +10,8 @@ alias core='cd /var/log/mariadb/columnstore/corefiles'
|
|||||||
alias tmsg='tail -f /var/log/messages'
|
alias tmsg='tail -f /var/log/messages'
|
||||||
alias tdebug='tail -f /var/log/mariadb/columnstore/debug.log'
|
alias tdebug='tail -f /var/log/mariadb/columnstore/debug.log'
|
||||||
alias tinfo='tail -f /var/log/mariadb/columnstore/info.log'
|
alias tinfo='tail -f /var/log/mariadb/columnstore/info.log'
|
||||||
|
alias terror='tail -f /var/log/mariadb/columnstore/err.log'
|
||||||
|
alias twarning='tail -f /var/log/mariadb/columnstore/warning.log'
|
||||||
|
alias tcrit='tail -f /var/log/mariadb/columnstore/crit.log'
|
||||||
alias dbrm='cd /usr/local/mariadb/columnstore/data1/systemFiles/dbrm'
|
alias dbrm='cd /usr/local/mariadb/columnstore/data1/systemFiles/dbrm'
|
||||||
alias module='cat /usr/local/mariadb/columnstore/local/module'
|
alias module='cat /usr/local/mariadb/columnstore/local/module'
|
||||||
|
@ -7036,15 +7036,33 @@ int processCommand(string* arguments)
|
|||||||
if (systemstatus.SystemOpState == oam::ACTIVE ) {
|
if (systemstatus.SystemOpState == oam::ACTIVE ) {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
cout << endl << " Starting Modules" << endl;
|
// cout << endl << " Starting Modules" << endl;
|
||||||
oam.startModule(devicenetworklist, ackTemp);
|
// oam.startModule(devicenetworklist, ackTemp);
|
||||||
|
|
||||||
//reload DBRM with new configuration, needs to be done here after startModule
|
//reload DBRM with new configuration, needs to be done here after startModule
|
||||||
cmd = startup::StartUp::installDir() + "/bin/dbrmctl reload > /dev/null 2>&1";
|
// cmd = startup::StartUp::installDir() + "/bin/dbrmctl reload > /dev/null 2>&1";
|
||||||
system(cmd.c_str());
|
// system(cmd.c_str());
|
||||||
sleep(15);
|
// sleep(15);
|
||||||
|
|
||||||
cout << " Successful start of Modules " << endl;
|
// cout << " Successful start of Modules " << endl;
|
||||||
|
|
||||||
|
cout << endl << " Restarting System ";
|
||||||
|
int returnStatus = oam.restartSystem(gracefulTemp, ackTemp);
|
||||||
|
switch (returnStatus)
|
||||||
|
{
|
||||||
|
case API_SUCCESS:
|
||||||
|
if ( waitForActive() )
|
||||||
|
cout << endl << " Successful restart of System " << endl << endl;
|
||||||
|
else
|
||||||
|
cout << endl << "**** restartSystem Failed : check log files" << endl;
|
||||||
|
break;
|
||||||
|
case API_CANCELLED:
|
||||||
|
cout << endl << " Restart of System canceled" << endl << endl;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
cout << endl << "**** restartSystem Failed : Check system logs" << endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (exception& e)
|
catch (exception& e)
|
||||||
{
|
{
|
||||||
|
@ -1247,26 +1247,16 @@ int main(int argc, char *argv[])
|
|||||||
//amazon install setup check
|
//amazon install setup check
|
||||||
bool amazonInstall = false;
|
bool amazonInstall = false;
|
||||||
string cloud = oam::UnassignedName;
|
string cloud = oam::UnassignedName;
|
||||||
system("aws --version > /tmp/amazon.log 2>&1");
|
|
||||||
|
if (!multi_server_quick_install)
|
||||||
ifstream in("/tmp/amazon.log");
|
|
||||||
|
|
||||||
in.seekg(0, std::ios::end);
|
|
||||||
int size = in.tellg();
|
|
||||||
if ( size == 0 || oam.checkLogStatus("/tmp/amazon.log", "not found"))
|
|
||||||
{
|
{
|
||||||
// not running on amazon with ec2-api-tools
|
system("aws --version > /tmp/amazon.log 2>&1");
|
||||||
if (amazon_quick_install)
|
|
||||||
{
|
|
||||||
cout << "ERROR: Amazon Quick Installer was specified, bu the AMazon CLI API packages isnt installed, exiting" << endl;
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
amazonInstall = false;
|
ifstream in("/tmp/amazon.log");
|
||||||
}
|
|
||||||
else
|
in.seekg(0, std::ios::end);
|
||||||
{
|
int size = in.tellg();
|
||||||
if ( size == 0 || oam.checkLogStatus("/tmp/amazon.log", "not installed"))
|
if ( size == 0 || oam.checkLogStatus("/tmp/amazon.log", "not found"))
|
||||||
{
|
{
|
||||||
// not running on amazon with ec2-api-tools
|
// not running on amazon with ec2-api-tools
|
||||||
if (amazon_quick_install)
|
if (amazon_quick_install)
|
||||||
@ -1278,9 +1268,23 @@ int main(int argc, char *argv[])
|
|||||||
amazonInstall = false;
|
amazonInstall = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
amazonInstall = true;
|
{
|
||||||
}
|
if ( size == 0 || oam.checkLogStatus("/tmp/amazon.log", "not installed"))
|
||||||
|
{
|
||||||
|
// not running on amazon with ec2-api-tools
|
||||||
|
if (amazon_quick_install)
|
||||||
|
{
|
||||||
|
cout << "ERROR: Amazon Quick Installer was specified, bu the AMazon CLI API packages isnt installed, exiting" << endl;
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
amazonInstall = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
amazonInstall = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
cloud = sysConfig->getConfig(InstallSection, "Cloud");
|
cloud = sysConfig->getConfig(InstallSection, "Cloud");
|
||||||
}
|
}
|
||||||
@ -3090,7 +3094,9 @@ int main(int argc, char *argv[])
|
|||||||
//check if dbrm data resides in older directory path and inform user if it does
|
//check if dbrm data resides in older directory path and inform user if it does
|
||||||
dbrmDirCheck();
|
dbrmDirCheck();
|
||||||
|
|
||||||
if ( IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM && pmNumber == 1) {
|
if ( ( IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM ) ||
|
||||||
|
( (IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM) && pmwithum ) )
|
||||||
|
{
|
||||||
//run the mysql / mysqld setup scripts
|
//run the mysql / mysqld setup scripts
|
||||||
cout << endl << "===== Running the MariaDB ColumnStore MariaDB Server setup scripts =====" << endl << endl;
|
cout << endl << "===== Running the MariaDB ColumnStore MariaDB Server setup scripts =====" << endl << endl;
|
||||||
|
|
||||||
@ -3098,7 +3104,57 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// call the mysql setup scripts
|
// call the mysql setup scripts
|
||||||
mysqlSetup();
|
mysqlSetup();
|
||||||
sleep(5);
|
sleep(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM ||
|
||||||
|
pmNumber > 1 )
|
||||||
|
{
|
||||||
|
if ( password.empty() )
|
||||||
|
{
|
||||||
|
cout << endl;
|
||||||
|
cout << "Next step is to enter the password to access the other Servers." << endl;
|
||||||
|
cout << "This is either your password or you can default to using a ssh key" << endl;
|
||||||
|
cout << "If using a password, the password needs to be the same on all Servers." << endl << endl;
|
||||||
|
|
||||||
|
if ( noPrompting ) {
|
||||||
|
cout << "Enter password, hit 'enter' to default to using a ssh key, or 'exit' > " << endl;
|
||||||
|
password = "ssh";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while(true)
|
||||||
|
{
|
||||||
|
char *pass1, *pass2;
|
||||||
|
|
||||||
|
pass1=getpass("Enter password, hit 'enter' to default to using a ssh key, or 'exit' > ");
|
||||||
|
if ( strcmp(pass1, "") == 0 ) {
|
||||||
|
password = "ssh";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
string p1 = pass1;
|
||||||
|
if ( p1 == "exit")
|
||||||
|
exit(0);
|
||||||
|
|
||||||
|
pass2=getpass("Confirm password > ");
|
||||||
|
string p2 = pass2;
|
||||||
|
if ( p1 == p2 ) {
|
||||||
|
password = p2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
cout << "Password mismatch, please re-enter" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
//add single quote for special characters
|
||||||
|
if ( password != "ssh" )
|
||||||
|
{
|
||||||
|
password = "'" + password + "'";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int thread_id = 0;
|
int thread_id = 0;
|
||||||
@ -3116,7 +3172,7 @@ int main(int argc, char *argv[])
|
|||||||
//skip interface with remote servers and perform install
|
//skip interface with remote servers and perform install
|
||||||
if ( !nonDistribute )
|
if ( !nonDistribute )
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// perform remote install of other servers in the system
|
// perform remote install of other servers in the system
|
||||||
//
|
//
|
||||||
cout << endl << "===== System Installation =====" << endl << endl;
|
cout << endl << "===== System Installation =====" << endl << endl;
|
||||||
@ -3173,67 +3229,8 @@ int main(int argc, char *argv[])
|
|||||||
if( !pkgCheck(columnstorePackage) )
|
if( !pkgCheck(columnstorePackage) )
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
if ( password.empty() )
|
|
||||||
{
|
|
||||||
cout << endl;
|
|
||||||
cout << "Next step is to enter the password to access the other Servers." << endl;
|
|
||||||
cout << "This is either your password or you can default to using a ssh key" << endl;
|
|
||||||
cout << "If using a password, the password needs to be the same on all Servers." << endl << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
while(true)
|
|
||||||
{
|
|
||||||
char *pass1, *pass2;
|
|
||||||
|
|
||||||
if ( noPrompting ) {
|
|
||||||
cout << "Enter password, hit 'enter' to default to using a ssh key, or 'exit' > " << endl;
|
|
||||||
if ( password.empty() )
|
|
||||||
password = "ssh";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
//check for command line option password
|
|
||||||
if ( !password.empty() )
|
|
||||||
break;
|
|
||||||
|
|
||||||
pass1=getpass("Enter password, hit 'enter' to default to using a ssh key, or 'exit' > ");
|
|
||||||
if ( strcmp(pass1, "") == 0 ) {
|
|
||||||
password = "ssh";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( pass1 == "exit")
|
|
||||||
exit(0);
|
|
||||||
|
|
||||||
string p1 = pass1;
|
|
||||||
pass2=getpass("Confirm password > ");
|
|
||||||
string p2 = pass2;
|
|
||||||
if ( p1 == p2 ) {
|
|
||||||
password = p2;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
cout << "Password mismatch, please re-enter" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
//add single quote for special characters
|
|
||||||
if ( password != "ssh" )
|
|
||||||
{
|
|
||||||
password = "'" + password + "'";
|
|
||||||
}
|
|
||||||
|
|
||||||
checkSystemMySQLPort(mysqlPort, sysConfig, USER, password, childmodulelist, IserverTypeInstall, pmwithum);
|
checkSystemMySQLPort(mysqlPort, sysConfig, USER, password, childmodulelist, IserverTypeInstall, pmwithum);
|
||||||
|
|
||||||
if ( ( IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM ) ||
|
|
||||||
( (IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM) && pmwithum ) )
|
|
||||||
{
|
|
||||||
cout << endl << "===== Running the MariaDB ColumnStore MariaDB ColumnStore setup scripts =====" << endl << endl;
|
|
||||||
|
|
||||||
// call the mysql setup scripts
|
|
||||||
mysqlSetup();
|
|
||||||
sleep(5);
|
|
||||||
}
|
|
||||||
|
|
||||||
string AmazonInstall = "0";
|
string AmazonInstall = "0";
|
||||||
if ( amazonInstall )
|
if ( amazonInstall )
|
||||||
AmazonInstall = "1";
|
AmazonInstall = "1";
|
||||||
@ -3411,19 +3408,7 @@ int main(int argc, char *argv[])
|
|||||||
cout << " DONE" << endl;
|
cout << " DONE" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( ( IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM ) ||
|
|
||||||
( (IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM) && pmwithum ) )
|
|
||||||
{
|
|
||||||
cout << endl << "===== Running the MariaDB ColumnStore MariaDB ColumnStore setup scripts =====" << endl << endl;
|
|
||||||
|
|
||||||
// call the mysql setup scripts
|
|
||||||
mysqlSetup();
|
|
||||||
sleep(5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//configure data redundancy
|
//configure data redundancy
|
||||||
if (DataRedundancy)
|
if (DataRedundancy)
|
||||||
{
|
{
|
||||||
@ -3641,9 +3626,6 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
//set mysql replication, if wasn't setup before on system
|
//set mysql replication, if wasn't setup before on system
|
||||||
// if ( ( mysqlRep && pmwithum ) ||
|
|
||||||
// ( mysqlRep && (umNumber > 1) ) ||
|
|
||||||
// ( mysqlRep && (pmNumber > 1) && (IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM) ) )
|
|
||||||
if ( mysqlRep )
|
if ( mysqlRep )
|
||||||
{
|
{
|
||||||
cout << endl << "Run MariaDB ColumnStore Replication Setup.. ";
|
cout << endl << "Run MariaDB ColumnStore Replication Setup.. ";
|
||||||
@ -3665,7 +3647,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
cout << "Enter the following command to define MariaDB ColumnStore Alias Commands" << endl << endl;
|
cout << "Enter the following command to define MariaDB ColumnStore Alias Commands" << endl << endl;
|
||||||
|
|
||||||
cout << ". " + installDir + "/bin/columnstoreAlias" << endl << endl;
|
if ( !rootUser )
|
||||||
|
cout << ". /etc/profile.d/columnstoreEnv.sh" << endl;
|
||||||
|
|
||||||
|
cout << ". /etc/profile.d/columnstoreAlias.sh" << endl << endl;
|
||||||
|
|
||||||
cout << "Enter 'mcsmysql' to access the MariaDB ColumnStore SQL console" << endl;
|
cout << "Enter 'mcsmysql' to access the MariaDB ColumnStore SQL console" << endl;
|
||||||
cout << "Enter 'mcsadmin' to access the MariaDB ColumnStore Admin console" << endl << endl;
|
cout << "Enter 'mcsadmin' to access the MariaDB ColumnStore Admin console" << endl << endl;
|
||||||
@ -3682,7 +3667,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
cout << "Enter the following command to define MariaDB ColumnStore Alias Commands" << endl << endl;
|
cout << "Enter the following command to define MariaDB ColumnStore Alias Commands" << endl << endl;
|
||||||
|
|
||||||
cout << ". " + installDir + "/bin/columnstoreAlias" << endl << endl;
|
if ( !rootUser )
|
||||||
|
cout << ". /etc/profile.d/columnstoreEnv.sh" << endl;
|
||||||
|
|
||||||
|
cout << ". /etc/profile.d/columnstoreAlias.sh" << endl << endl;
|
||||||
|
|
||||||
cout << "Enter 'mcsmysql' to access the MariaDB ColumnStore SQL console" << endl;
|
cout << "Enter 'mcsmysql' to access the MariaDB ColumnStore SQL console" << endl;
|
||||||
cout << "Enter 'mcsadmin' to access the MariaDB ColumnStore Admin console" << endl << endl;
|
cout << "Enter 'mcsadmin' to access the MariaDB ColumnStore Admin console" << endl << endl;
|
||||||
|
@ -575,10 +575,12 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
|
|
||||||
if ( count > 0 ) {
|
if ( count > 0 ) {
|
||||||
|
|
||||||
|
string module = oam::UnassignedName;
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
msg >> value;
|
msg >> value;
|
||||||
devicenetworkconfig.DeviceName = value;
|
devicenetworkconfig.DeviceName = value;
|
||||||
|
module = value;
|
||||||
msg >> value;
|
msg >> value;
|
||||||
devicenetworkconfig.UserTempDeviceName = value;
|
devicenetworkconfig.UserTempDeviceName = value;
|
||||||
msg >> value;
|
msg >> value;
|
||||||
@ -606,11 +608,24 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( status == API_SUCCESS) {
|
if( status == API_SUCCESS) {
|
||||||
|
processManager.setSystemState(oam::BUSY_INIT);
|
||||||
|
|
||||||
|
//set query system state not ready
|
||||||
|
processManager.setQuerySystemState(false);
|
||||||
|
|
||||||
|
//set recycle process
|
||||||
|
processManager.recycleProcess(target, true);
|
||||||
|
|
||||||
//distribute config file
|
//distribute config file
|
||||||
processManager.distributeConfigFile("system");
|
processManager.distributeConfigFile("system");
|
||||||
|
|
||||||
|
processManager.setSystemState(oam::ACTIVE);
|
||||||
|
|
||||||
|
//set query system state ready
|
||||||
|
processManager.setQuerySystemState(true);
|
||||||
|
|
||||||
//call dbrm control
|
//call dbrm control
|
||||||
oam.dbrmctl("halt");
|
/* oam.dbrmctl("halt");
|
||||||
log.writeLog(__LINE__, "'dbrmctl halt' done", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "'dbrmctl halt' done", LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
oam.dbrmctl("reload");
|
oam.dbrmctl("reload");
|
||||||
@ -618,13 +633,7 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
|
|
||||||
oam.dbrmctl("resume");
|
oam.dbrmctl("resume");
|
||||||
log.writeLog(__LINE__, "'dbrmctl resume' done", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "'dbrmctl resume' done", LOG_TYPE_DEBUG);
|
||||||
|
*/ }
|
||||||
// processManager.restartProcessType("ExeMgr");
|
|
||||||
|
|
||||||
//setup MySQL Replication for started modules
|
|
||||||
// log.writeLog(__LINE__, "Setup MySQL Replication for module being started", LOG_TYPE_DEBUG);
|
|
||||||
// processManager.setMySQLReplication(startdevicenetworklist);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -829,8 +838,10 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
if (opState == oam::MAN_OFFLINE || opState == oam::MAN_DISABLED
|
if (opState == oam::MAN_OFFLINE || opState == oam::MAN_DISABLED
|
||||||
|| opState == oam::AUTO_DISABLED || opState == oam::AUTO_OFFLINE) {
|
|| opState == oam::AUTO_DISABLED || opState == oam::AUTO_OFFLINE) {
|
||||||
|
|
||||||
oam.dbrmctl("halt");
|
processManager.setSystemState(oam::BUSY_INIT);
|
||||||
log.writeLog(__LINE__, "'dbrmctl halt' done", LOG_TYPE_DEBUG);
|
|
||||||
|
//set query system state not ready
|
||||||
|
processManager.setQuerySystemState(false);
|
||||||
|
|
||||||
status = processManager.disableModule(moduleName, true);
|
status = processManager.disableModule(moduleName, true);
|
||||||
log.writeLog(__LINE__, "Disable Module Completed on " + moduleName, LOG_TYPE_INFO);
|
log.writeLog(__LINE__, "Disable Module Completed on " + moduleName, LOG_TYPE_INFO);
|
||||||
@ -839,14 +850,11 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
|
|
||||||
//check for SIMPLEX Processes on mate might need to be started
|
//check for SIMPLEX Processes on mate might need to be started
|
||||||
processManager.checkSimplexModule(moduleName);
|
processManager.checkSimplexModule(moduleName);
|
||||||
|
|
||||||
|
processManager.setSystemState(oam::ACTIVE);
|
||||||
|
|
||||||
//call dbrm control
|
//set query system state ready
|
||||||
// oam.dbrmctl("reload");
|
processManager.setQuerySystemState(true);
|
||||||
// log.writeLog(__LINE__, "'dbrmctl reload' done", LOG_TYPE_DEBUG);
|
|
||||||
|
|
||||||
// resume the dbrm
|
|
||||||
oam.dbrmctl("resume");
|
|
||||||
log.writeLog(__LINE__, "'dbrmctl resume' done", LOG_TYPE_DEBUG);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -910,7 +918,7 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
|
|
||||||
DeviceNetworkList::iterator listPT = devicenetworklist.begin();
|
DeviceNetworkList::iterator listPT = devicenetworklist.begin();
|
||||||
|
|
||||||
//stopModules being removed with the REMOVE option, which will stop process
|
// do stopmodule then enable
|
||||||
for( ; listPT != devicenetworklist.end() ; listPT++)
|
for( ; listPT != devicenetworklist.end() ; listPT++)
|
||||||
{
|
{
|
||||||
string moduleName = (*listPT).DeviceName;
|
string moduleName = (*listPT).DeviceName;
|
||||||
@ -933,6 +941,9 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (opState == oam::MAN_DISABLED) {
|
if (opState == oam::MAN_DISABLED) {
|
||||||
|
processManager.stopModule(moduleName, graceful, manualFlag);
|
||||||
|
log.writeLog(__LINE__, "stop Module Completed on " + moduleName, LOG_TYPE_INFO);
|
||||||
|
|
||||||
status = processManager.enableModule(moduleName, oam::MAN_OFFLINE);
|
status = processManager.enableModule(moduleName, oam::MAN_OFFLINE);
|
||||||
log.writeLog(__LINE__, "Enable Module Completed on " + moduleName, LOG_TYPE_INFO);
|
log.writeLog(__LINE__, "Enable Module Completed on " + moduleName, LOG_TYPE_INFO);
|
||||||
}
|
}
|
||||||
@ -1246,6 +1257,9 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
log.writeLog(__LINE__, "STOPSYSTEM: ACK back to sender");
|
log.writeLog(__LINE__, "STOPSYSTEM: ACK back to sender");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//set query system state ready
|
||||||
|
processManager.setQuerySystemState(true);
|
||||||
|
|
||||||
startsystemthreadStop = false;
|
startsystemthreadStop = false;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -2758,9 +2772,6 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
log.writeLog(__LINE__, "MSG RECEIVED: Process Restarted on " + moduleName + "/" + processName);
|
log.writeLog(__LINE__, "MSG RECEIVED: Process Restarted on " + moduleName + "/" + processName);
|
||||||
|
|
||||||
//set query system states not ready
|
//set query system states not ready
|
||||||
BRM::DBRM dbrm;
|
|
||||||
dbrm.setSystemQueryReady(false);
|
|
||||||
|
|
||||||
processManager.setQuerySystemState(false);
|
processManager.setQuerySystemState(false);
|
||||||
|
|
||||||
processManager.setSystemState(oam::BUSY_INIT);
|
processManager.setSystemState(oam::BUSY_INIT);
|
||||||
@ -2841,12 +2852,14 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
break;
|
break;
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
dbrm.setSystemQueryReady(true);
|
processManager.setQuerySystemState(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if a DDLProc was restarted, reinit DMLProc
|
// if a DDLProc was restarted, reinit DMLProc
|
||||||
if( processName == "DDLProc") {
|
if( processName == "DDLProc") {
|
||||||
processManager.reinitProcessType("DMLProc");
|
processManager.reinitProcessType("DMLProc");
|
||||||
|
processManager.setQuerySystemState(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//only run on auto process restart
|
//only run on auto process restart
|
||||||
@ -2893,9 +2906,7 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//enable query stats
|
//set query system states ready
|
||||||
dbrm.setSystemQueryReady(true);
|
|
||||||
|
|
||||||
processManager.setQuerySystemState(true);
|
processManager.setQuerySystemState(true);
|
||||||
|
|
||||||
processManager.setSystemState(oam::ACTIVE);
|
processManager.setSystemState(oam::ACTIVE);
|
||||||
@ -3386,7 +3397,7 @@ int ProcessManager::disableModule(string target, bool manualFlag)
|
|||||||
/******************************************************************************************
|
/******************************************************************************************
|
||||||
* @brief recycleProcess
|
* @brief recycleProcess
|
||||||
*
|
*
|
||||||
* purpose: recyle process, generally after some disable module is run
|
* purpose: recyle process, done after disable/enable module
|
||||||
*
|
*
|
||||||
******************************************************************************************/
|
******************************************************************************************/
|
||||||
void ProcessManager::recycleProcess(string module, bool enableModule)
|
void ProcessManager::recycleProcess(string module, bool enableModule)
|
||||||
@ -3410,48 +3421,65 @@ void ProcessManager::recycleProcess(string module, bool enableModule)
|
|||||||
//recycle DBRM processes in all cases
|
//recycle DBRM processes in all cases
|
||||||
restartProcessType("DBRMControllerNode");
|
restartProcessType("DBRMControllerNode");
|
||||||
restartProcessType("DBRMWorkerNode");
|
restartProcessType("DBRMWorkerNode");
|
||||||
|
sleep(5);
|
||||||
|
|
||||||
restartProcessType("DMLProc");
|
restartProcessType("DMLProc");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//recycle DBRM processes in all cases
|
//recycle DBRM processes in all cases
|
||||||
restartProcessType("DBRMControllerNode", module);
|
// restartProcessType("DBRMControllerNode", module);
|
||||||
restartProcessType("DBRMWorkerNode");
|
// restartProcessType("DBRMWorkerNode");
|
||||||
|
|
||||||
|
// only recycle ddl/dmlproc, if down/up module is non-parent UM
|
||||||
// only recycle dmlproc, if down/up module is non-parent UM
|
/* if ( ( moduleType == "um" ) &&
|
||||||
if ( ( moduleType == "um" ) &&
|
if ( PrimaryUMModuleName != module)
|
||||||
( PrimaryUMModuleName != module) )
|
|
||||||
{
|
{
|
||||||
|
restartProcessType("DDLProc",module);
|
||||||
restartProcessType("DMLProc",module);
|
restartProcessType("DMLProc",module);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
if( PrimaryUMModuleName == module)
|
// if( PrimaryUMModuleName == module)
|
||||||
{
|
// {
|
||||||
stopProcessType("DDLProc");
|
// stopProcessType("DDLProc");
|
||||||
stopProcessType("DMLProc");
|
// stopProcessType("DMLProc");
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
stopProcessType("WriteEngineServer");
|
||||||
|
|
||||||
stopProcessType("ExeMgr");
|
stopProcessType("ExeMgr");
|
||||||
|
|
||||||
|
stopProcessType("PrimProc");
|
||||||
|
|
||||||
restartProcessType("PrimProc");
|
stopProcessType("DBRMControllerNode");
|
||||||
sleep(1);
|
stopProcessType("DBRMWorkerNode");
|
||||||
|
|
||||||
|
stopProcessType("DDLProc");
|
||||||
|
stopProcessType("DMLProc");
|
||||||
|
|
||||||
restartProcessType("mysqld");
|
stopProcessType("mysqld");
|
||||||
|
|
||||||
restartProcessType("WriteEngineServer");
|
// restartProcessType("mysqld");
|
||||||
sleep(1);
|
|
||||||
|
startProcessType("DBRMControllerNode");
|
||||||
|
startProcessType("DBRMWorkerNode");
|
||||||
|
|
||||||
|
startProcessType("PrimProc");
|
||||||
|
sleep(5);
|
||||||
|
|
||||||
|
startProcessType("WriteEngineServer");
|
||||||
|
sleep(3);
|
||||||
|
|
||||||
startProcessType("ExeMgr");
|
startProcessType("ExeMgr");
|
||||||
sleep(1);
|
|
||||||
|
|
||||||
startProcessType("DDLProc");
|
startProcessType("DDLProc");
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
|
||||||
startProcessType("DMLProc");
|
startProcessType("DMLProc");
|
||||||
|
|
||||||
|
startProcessType("mysqld");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3500,8 +3528,8 @@ int ProcessManager::enableModule(string target, int state, bool failover)
|
|||||||
setStandbyModule(newStandbyModule);
|
setStandbyModule(newStandbyModule);
|
||||||
|
|
||||||
//set recycle process
|
//set recycle process
|
||||||
if (!failover)
|
// if (!failover)
|
||||||
recycleProcess(target);
|
// recycleProcess(target);
|
||||||
|
|
||||||
log.writeLog(__LINE__, "enableModule request for " + target + " completed", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "enableModule request for " + target + " completed", LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
@ -3774,6 +3802,7 @@ void ProcessManager::setSystemState(uint16_t state)
|
|||||||
Oam oam;
|
Oam oam;
|
||||||
ALARMManager aManager;
|
ALARMManager aManager;
|
||||||
Configuration config;
|
Configuration config;
|
||||||
|
ProcessManager processManager(config, log);
|
||||||
|
|
||||||
log.writeLog(__LINE__, "Set System State = " + oamState[state], LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "Set System State = " + oamState[state], LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
@ -3794,6 +3823,9 @@ void ProcessManager::setSystemState(uint16_t state)
|
|||||||
// Process Alarms
|
// Process Alarms
|
||||||
string system = "System";
|
string system = "System";
|
||||||
if( state == oam::ACTIVE ) {
|
if( state == oam::ACTIVE ) {
|
||||||
|
//set query system states ready
|
||||||
|
processManager.setQuerySystemState(true);
|
||||||
|
|
||||||
//clear alarms if set
|
//clear alarms if set
|
||||||
aManager.sendAlarmReport(system.c_str(), SYSTEM_DOWN_AUTO, CLEAR);
|
aManager.sendAlarmReport(system.c_str(), SYSTEM_DOWN_AUTO, CLEAR);
|
||||||
aManager.sendAlarmReport(system.c_str(), SYSTEM_DOWN_MANUAL, CLEAR);
|
aManager.sendAlarmReport(system.c_str(), SYSTEM_DOWN_MANUAL, CLEAR);
|
||||||
@ -6244,7 +6276,7 @@ int ProcessManager::sendMsgProcMon( std::string module, ByteStream msg, int requ
|
|||||||
string IPAddr = sysConfig->getConfig(msgPort, "IPAddr");
|
string IPAddr = sysConfig->getConfig(msgPort, "IPAddr");
|
||||||
|
|
||||||
if ( IPAddr == oam::UnassignedIpAddr ) {
|
if ( IPAddr == oam::UnassignedIpAddr ) {
|
||||||
log.writeLog(__LINE__, "sendMsgProcMon ping failure", LOG_TYPE_ERROR);
|
log.writeLog(__LINE__, "sendMsgProcMon ping failure " + module + " " + IPAddr, LOG_TYPE_ERROR);
|
||||||
return oam::API_SUCCESS;
|
return oam::API_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6253,7 +6285,7 @@ int ProcessManager::sendMsgProcMon( std::string module, ByteStream msg, int requ
|
|||||||
string cmd = cmdLine + IPAddr + cmdOption;
|
string cmd = cmdLine + IPAddr + cmdOption;
|
||||||
if ( system(cmd.c_str()) != 0) {
|
if ( system(cmd.c_str()) != 0) {
|
||||||
//ping failure
|
//ping failure
|
||||||
log.writeLog(__LINE__, "sendMsgProcMon ping failure", LOG_TYPE_ERROR);
|
log.writeLog(__LINE__, "sendMsgProcMon ping failure " + module + " " + IPAddr, LOG_TYPE_ERROR);
|
||||||
return oam::API_SUCCESS;
|
return oam::API_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6490,12 +6522,22 @@ void ProcessManager::setQuerySystemState(bool set)
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
dbrm.setSystemQueryReady(set);
|
dbrm.setSystemQueryReady(set);
|
||||||
log.writeLog(__LINE__, "setQuerySystemState successful", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "setSystemQueryReady successful", LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
|
try {
|
||||||
|
dbrm.setSystemReady(set);
|
||||||
|
log.writeLog(__LINE__, "setSystemReady successful", LOG_TYPE_DEBUG);
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
|
{
|
||||||
|
log.writeLog(__LINE__, "setSystemReady failed", LOG_TYPE_DEBUG);
|
||||||
|
log.writeLog(__LINE__, "setSystemReady failed", LOG_TYPE_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
log.writeLog(__LINE__, "setQuerySystemState failed", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "setSystemQueryReady failed", LOG_TYPE_DEBUG);
|
||||||
log.writeLog(__LINE__, "setQuerySystemState failed", LOG_TYPE_ERROR);
|
log.writeLog(__LINE__, "setSystemQueryReady failed", LOG_TYPE_ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6993,7 +7035,7 @@ void startSystemThread(oam::DeviceNetworkList Devicenetworklist)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//set query system state not ready
|
//set query system state not ready
|
||||||
processManager.setQuerySystemState(true);
|
processManager.setQuerySystemState(false);
|
||||||
|
|
||||||
// Bug 4554: Wait until DMLProc is finished with rollback
|
// Bug 4554: Wait until DMLProc is finished with rollback
|
||||||
if (status == oam::API_SUCCESS)
|
if (status == oam::API_SUCCESS)
|
||||||
@ -7062,6 +7104,9 @@ void startSystemThread(oam::DeviceNetworkList Devicenetworklist)
|
|||||||
processManager.setSystemState(rtn);
|
processManager.setSystemState(rtn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//set query system state ready
|
||||||
|
processManager.setQuerySystemState(true);
|
||||||
|
|
||||||
// exit thread
|
// exit thread
|
||||||
log.writeLog(__LINE__, "startSystemThread Exit", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "startSystemThread Exit", LOG_TYPE_DEBUG);
|
||||||
startsystemthreadStatus = status;
|
startsystemthreadStatus = status;
|
||||||
|
Reference in New Issue
Block a user