1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-20 01:42:27 +03:00

MCOL-770 - change non-distrubute install to not do any ssh betweeen pm1 at startup

This commit is contained in:
david hill
2017-06-16 16:53:48 -05:00
parent 08ed507640
commit ebaf24473c
3 changed files with 616 additions and 647 deletions

View File

@@ -2737,7 +2737,7 @@ int main(int argc, char *argv[])
// determine package type // determine package type
string EEPackageType; string EEPackageType;
if (!rootUser || nonDistribute) if (!rootUser)
EEPackageType = "binary"; EEPackageType = "binary";
else else
{ {
@@ -2798,6 +2798,9 @@ int main(int argc, char *argv[])
if ( install == "y" ) { if ( install == "y" ) {
//skip interface with remote servers and perform install
if ( !nonDistribute )
{
SystemSoftware systemsoftware; SystemSoftware systemsoftware;
try try
@@ -2815,8 +2818,7 @@ int main(int argc, char *argv[])
string version = systemsoftware.Version + "-" + systemsoftware.Release; string version = systemsoftware.Version + "-" + systemsoftware.Release;
string installType = "initial"; string installType = "initial";
if ( !nonDistribute )
{
if ( EEPackageType == "rpm" ) if ( EEPackageType == "rpm" )
{ {
cout << "Performing an MariaDB ColumnStore System install using RPM packages" << endl; cout << "Performing an MariaDB ColumnStore System install using RPM packages" << endl;
@@ -2848,13 +2850,6 @@ int main(int argc, char *argv[])
if( !pkgCheck(columnstorePackage) ) if( !pkgCheck(columnstorePackage) )
exit(1); exit(1);
}
else
{
EEPackageType = "binary";
installType = "nonDistribute";
columnstorePackage = HOME + "/" + "mariadb-columnstore-" + version + "*.bin.tar.gz";
}
if ( password.empty() ) if ( password.empty() )
{ {
@@ -2935,9 +2930,6 @@ int main(int argc, char *argv[])
string logfile; string logfile;
if ( remote_installer_debug == "1" ) { if ( remote_installer_debug == "1" ) {
logfile = "/tmp/"; logfile = "/tmp/";
if ( nonDistribute )
logfile += remoteModuleName + "_nondistributed_install.log";
else
logfile += remoteModuleName + "_" + EEPackageType + "_install.log"; logfile += remoteModuleName + "_" + EEPackageType + "_install.log";
debug_logfile = " > " + logfile; debug_logfile = " > " + logfile;
} }
@@ -2946,35 +2938,6 @@ int main(int argc, char *argv[])
(remoteModuleType == "pm" && IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM) || (remoteModuleType == "pm" && IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM) ||
(remoteModuleType == "pm" && pmwithum) ) (remoteModuleType == "pm" && pmwithum) )
{ {
if ( nonDistribute )
{
cout << endl << "----- Performing Non-Distrubuted Install on '" + remoteModuleName + " / " + remoteHostName + "' -----" << endl << endl;
//check of post-install file exist, which shows package is installed
string cmd = installDir + "/bin/remote_command.sh " + remoteModuleIP + " " + password + " 'ls " + installDir + "/bin/post-install' > /tmp/install_check.log";
int rtnCode = system(cmd.c_str());
if (WEXITSTATUS(rtnCode) != 0) {
cout << "Error: MariaDB ColumnStore not installed on " + remoteModuleName + " / " + remoteHostName << endl;
cout << "Install and re-run postConfigure. Exiting..." << endl << endl;
exit(1);
}
//check version that is installed
cmd = installDir + "/bin/remote_scp_get.sh " + remoteModuleIP + " " + password + " " + installDir + "/releasenum > /dev/null 2>&1";
rtnCode = system(cmd.c_str());
if (WEXITSTATUS(rtnCode) != 0) {
cout << "Error: MariaDB ColumnStore not installed on " + remoteModuleName + " / " + remoteHostName << endl;
cout << "Install and re-run postConfigure. Exiting..." << endl << endl;
exit(1);
}
cmd = "diff " + installDir + "/releasenum releasenum > /dev/null 2>&1";
rtnCode = system(cmd.c_str());
if (WEXITSTATUS(rtnCode) != 0) {
cout << "Error: Local version of MariaDB ColumnStore doesn't match installed version on " + remoteModuleName + " / " + remoteHostName << endl;
cout << "Install matching version and re-run postConfigure. Exiting..." << endl << endl;
exit(1);
}
}
else
cout << endl << "----- Performing Install on '" + remoteModuleName + " / " + remoteHostName + "' -----" << endl << endl; cout << endl << "----- Performing Install on '" + remoteModuleName + " / " + remoteHostName + "' -----" << endl << endl;
if ( remote_installer_debug == "1" ) if ( remote_installer_debug == "1" )
@@ -3125,35 +3088,6 @@ int main(int argc, char *argv[])
if ( (remoteModuleType == "pm" && IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM) || if ( (remoteModuleType == "pm" && IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM) ||
(remoteModuleType == "pm" && !pmwithum ) ) (remoteModuleType == "pm" && !pmwithum ) )
{ {
if ( nonDistribute )
{
cout << endl << "----- Performing Non-Distrubuted Install on '" + remoteModuleName + " / " + remoteHostName + "' -----" << endl << endl;
//check of releasenum file exist, which shows package is installed
string cmd = installDir + "/bin/remote_command.sh " + remoteModuleIP + " " + password + " 'ls " + installDir + "/bin/post-install' > /tmp/install_check.log";
int rtnCode = system(cmd.c_str());
if (WEXITSTATUS(rtnCode) != 0) {
cout << endl << "Error: MariaDB ColumnStore not installed on " + remoteModuleName + " / " + remoteHostName << endl;
cout << "Install and re-run postConfigure. Exiting..." << endl << endl;
exit(1);
}
//check version that is installed
cmd = installDir + "/bin/remote_scp_get.sh " + remoteModuleIP + " " + password + " " + installDir + "/releasenum > /dev/null 2>&1";
rtnCode = system(cmd.c_str());
if (WEXITSTATUS(rtnCode) != 0) {
cout << "Error: MariaDB ColumnStore not installed on " + remoteModuleName + " / " + remoteHostName << endl;
cout << "Install and re-run postConfigure. Exiting..." << endl << endl;
exit(1);
}
cmd = "diff " + installDir + "/releasenum releasenum > /dev/null 2>&1";
rtnCode = system(cmd.c_str());
if (WEXITSTATUS(rtnCode) != 0) {
cout << "Error: Local version of MariaDB ColumnStore doesn't match installed version on " + remoteModuleName + " / " + remoteHostName << endl;
cout << "Install matching version and re-run postConfigure. Exiting..." << endl << endl;
exit(1);
}
}
else
cout << endl << "----- Performing Install on '" + remoteModuleName + " / " + remoteHostName + "' -----" << endl << endl; cout << endl << "----- Performing Install on '" + remoteModuleName + " / " + remoteHostName + "' -----" << endl << endl;
if ( remote_installer_debug == "1" ) if ( remote_installer_debug == "1" )
@@ -3236,6 +3170,7 @@ int main(int argc, char *argv[])
} }
} }
} }
}
//configure data redundancy //configure data redundancy
string glusterconfig = installDir + "/bin/glusterconf"; string glusterconfig = installDir + "/bin/glusterconf";
@@ -3301,6 +3236,7 @@ int main(int argc, char *argv[])
else else
cout << "The MariaDB ColumnStore system logging is setup and working on local server" << endl; cout << "The MariaDB ColumnStore system logging is setup and working on local server" << endl;
if ( nonDistribute )
cout << endl << "MariaDB ColumnStore System Configuration and Installation is Completed" << endl; cout << endl << "MariaDB ColumnStore System Configuration and Installation is Completed" << endl;
// //
@@ -3336,7 +3272,7 @@ int main(int argc, char *argv[])
if ( start == "y" ) { if ( start == "y" ) {
if (hdfs) if (hdfs && !nonDistribute )
{ {
cout << endl << "----- Starting MariaDB ColumnStore Service on all Modules -----" << endl << endl; cout << endl << "----- Starting MariaDB ColumnStore Service on all Modules -----" << endl << endl;
string cmd = "pdsh -a '" + installDir + "/bin/columnstore restart' > /tmp/postConfigure.pdsh 2>&1"; string cmd = "pdsh -a '" + installDir + "/bin/columnstore restart' > /tmp/postConfigure.pdsh 2>&1";
@@ -3347,6 +3283,8 @@ int main(int argc, char *argv[])
} }
} }
else else
{
if ( !nonDistribute )
{ {
if ( password.empty() ) { if ( password.empty() ) {
while(true) while(true)
@@ -3415,6 +3353,7 @@ int main(int argc, char *argv[])
else else
cout << "MariaDB ColumnStore successfully started" << endl; cout << "MariaDB ColumnStore successfully started" << endl;
} }
}
//start MariaDB ColumnStore on local server //start MariaDB ColumnStore on local server
cout << endl << "----- Starting MariaDB ColumnStore on local server -----" << endl << endl; cout << endl << "----- Starting MariaDB ColumnStore on local server -----" << endl << endl;

View File

@@ -4983,6 +4983,8 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
} }
} }
if ( DistributedInstall == "y" ) {
//PMwithUM config //PMwithUM config
string PMwithUM = "n"; string PMwithUM = "n";
try { try {
@@ -5347,6 +5349,7 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
log.writeLog(__LINE__, "addModule - sleep 30 - give ProcMon time to start on new Instance", LOG_TYPE_DEBUG); log.writeLog(__LINE__, "addModule - sleep 30 - give ProcMon time to start on new Instance", LOG_TYPE_DEBUG);
sleep(30); sleep(30);
} }
}
//distribute config file //distribute config file
distributeConfigFile("system"); distributeConfigFile("system");

View File

@@ -331,9 +331,16 @@ int main(int argc, char **argv)
} }
else else
{ {
bool fresh = false;
// not active Parent, get updated Columnstore.xml, retry in case ProcMgr isn't up yet // not active Parent, get updated Columnstore.xml, retry in case ProcMgr isn't up yet
if (!HDFS) if (!HDFS)
{ {
//check if this is a fresh install, meaning the Columnstore.xml file is not setup
string procmgrIpadd = sysConfig->getConfig("ProcMgr", "IPAddr");
if ( procmgrIpadd == "0.0.0.0" )
fresh = true;
int count = 0; int count = 0;
while(true) while(true)
{ {
@@ -360,6 +367,26 @@ int main(int argc, char **argv)
MonitorConfig config; MonitorConfig config;
} }
//get Distributed Install
string DistributedInstall = "y";
try
{
oam.getSystemConfig("DistributedInstall", DistributedInstall);
}
catch (...)
{
log.writeLog(__LINE__, "addModule - ERROR: get DistributedInstall", LOG_TYPE_ERROR);
}
//check for a fresh install on a non-distrubuted install setup
if ( DistributedInstall == "n" && fresh )
{
//run the module install script
string cmd = startup::StartUp::installDir() + "/bin/module_installer.sh " + " --installdir=" + startup::StartUp::installDir() + " --module=" + config.moduleType() + " > /dev/null 2>&1";
system(cmd.c_str());
}
// not OAM parent module, delay starting until a successful get status is performed // not OAM parent module, delay starting until a successful get status is performed
// makes sure the Parent OAM ProcMon is fully ready // makes sure the Parent OAM ProcMon is fully ready
while(true) while(true)