You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-05 15:41:14 +03:00
MCOL-522 changes
This commit is contained in:
@ -465,6 +465,7 @@
|
||||
<MySQLPort>3306</MySQLPort>
|
||||
<MySQLPasswordConfig>unassigned</MySQLPasswordConfig>
|
||||
<AmazonDeviceName>/dev/xvd</AmazonDeviceName>
|
||||
<DistributedInstall>y</DistributedInstall>
|
||||
</Installation>
|
||||
<ExtentMap>
|
||||
<!--
|
||||
|
@ -169,6 +169,7 @@ string glusterInstalled = "n";
|
||||
string hadoopInstalled = "n";
|
||||
string mysqlPort = oam::UnassignedName;
|
||||
string systemName;
|
||||
string DistributedInstall = "n";
|
||||
|
||||
bool noPrompting = false;
|
||||
bool rootUser = true;
|
||||
@ -536,6 +537,26 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
catch(...) {}
|
||||
|
||||
if ( nonDistribute )
|
||||
{
|
||||
try {
|
||||
oam.setSystemConfig("DistributedInstall", "n");
|
||||
}
|
||||
catch(...) {}
|
||||
}
|
||||
else
|
||||
{
|
||||
//get Distributed Install
|
||||
try {
|
||||
DistributedInstall = sysConfig->getConfig(InstallSection, "DistributedInstall");
|
||||
}
|
||||
catch(...)
|
||||
{}
|
||||
|
||||
if ( DistributedInstall == "n" )
|
||||
nonDistribute = true;
|
||||
}
|
||||
|
||||
cout << endl;
|
||||
|
||||
cout << "===== Setup System Server Type Configuration =====" << endl << endl;
|
||||
@ -2891,7 +2912,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
cout << endl << "----- Performing Install Check on '" + remoteModuleName + " / " + remoteHostName + "' -----" << endl << endl;
|
||||
|
||||
//check of releasenum file exist, which shows package is installed
|
||||
//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) {
|
||||
|
@ -4490,6 +4490,18 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
|
||||
log.writeLog(__LINE__, "addModule - ERROR: get EEPackageType", LOG_TYPE_ERROR);
|
||||
}
|
||||
|
||||
//get Distributed Install
|
||||
string DistributedInstall = "y";
|
||||
|
||||
try
|
||||
{
|
||||
oam.getSystemConfig("DistributedInstall", DistributedInstall);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
log.writeLog(__LINE__, "addModule - ERROR: get DistributedInstall", LOG_TYPE_ERROR);
|
||||
}
|
||||
|
||||
//
|
||||
// check for RPM package
|
||||
//
|
||||
@ -4507,8 +4519,6 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
|
||||
return API_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
//check if pkgs are located in /root directory
|
||||
string homedir = "/root";
|
||||
if (!rootUser) {
|
||||
char* p= getenv("HOME");
|
||||
@ -4524,6 +4534,9 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
|
||||
else
|
||||
calpontPackage = homedir + "/mariadb-columnstore*" + systemsoftware.Version + "-" + systemsoftware.Release + "*.bin.tar.gz";
|
||||
|
||||
if ( DistributedInstall == "n" )
|
||||
{
|
||||
//check if pkgs are located in /root directory
|
||||
string cmd = "ls " + calpontPackage + " > /dev/null 2>&1";
|
||||
int rtnCode = system(cmd.c_str());
|
||||
if (WEXITSTATUS(rtnCode) != 0) {
|
||||
@ -4532,6 +4545,7 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
|
||||
return API_FILE_OPEN_ERROR;
|
||||
}
|
||||
log.writeLog(__LINE__, "addModule - Calpont Package found:" + calpontPackage, LOG_TYPE_DEBUG);
|
||||
}
|
||||
|
||||
//
|
||||
// Verify Host IP and Password
|
||||
@ -5048,6 +5062,20 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
|
||||
//default
|
||||
string binaryInstallDir = installDir;
|
||||
|
||||
string installType = "initial";
|
||||
if ( DistributedInstall == "n" ) {
|
||||
installType = "nonDistribute";
|
||||
|
||||
//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) {
|
||||
log.writeLog(__LINE__, "addModule - ERROR: MariaDB ColumnStore not installed on " + remoteModuleName + " / " + remoteHostName , LOG_TYPE_ERROR);
|
||||
pthread_mutex_unlock(&THREAD_LOCK);
|
||||
return API_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
//run installer on remote module
|
||||
if ( remoteModuleType == "um" ||
|
||||
( remoteModuleType == "pm" && config.ServerInstallType() == oam::INSTALL_COMBINE_DM_UM_PM ) ||
|
||||
@ -5101,7 +5129,7 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
|
||||
string binservertype = oam.itoa(config.ServerInstallType());
|
||||
if ( PMwithUM == "y" )
|
||||
binservertype = "pmwithum";
|
||||
string cmd = installDir + "/bin/binary_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + calpontPackage + " " + remoteModuleType + " initial " + binservertype + " " + MySQLPort + " 1 " + binaryInstallDir + " > /tmp/binary_installer.log";
|
||||
string cmd = installDir + "/bin/binary_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + calpontPackage + " " + remoteModuleType + " " + installType + " " + binservertype + " " + MySQLPort + " 1 " + binaryInstallDir + " > /tmp/binary_installer.log";
|
||||
|
||||
log.writeLog(__LINE__, "addModule - " + cmd, LOG_TYPE_DEBUG);
|
||||
|
||||
@ -5192,7 +5220,7 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
|
||||
if ( PMwithUM == "y" )
|
||||
binservertype = "pmwithum";
|
||||
|
||||
string cmd = installDir + "/bin/binary_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + calpontPackage + " " + remoteModuleType + " initial " + binservertype + " " + MySQLPort + " 1 " + binaryInstallDir + " > /tmp/binary_installer.log";
|
||||
string cmd = installDir + "/bin/binary_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + calpontPackage + " " + remoteModuleType + " " + installType + " " + binservertype + " " + MySQLPort + " 1 " + binaryInstallDir + " > /tmp/binary_installer.log";
|
||||
|
||||
log.writeLog(__LINE__, "addModule - " + cmd, LOG_TYPE_DEBUG);
|
||||
|
||||
|
@ -913,9 +913,20 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
|
||||
|
||||
log.writeLog(__LINE__, "STOPALL: ACK back to ProcMgr, return status = " + oam.itoa((int) requestStatus));
|
||||
|
||||
//Remove Calpont RPM on REMOVE option
|
||||
if ( actIndicator == oam::REMOVE ) {
|
||||
log.writeLog(__LINE__, "STOPALL: uninstall Calpont RPMs", LOG_TYPE_DEBUG);
|
||||
//Remove MariaDB ColumnStore PGK on REMOVE option if distubuted install
|
||||
string DistributedInstall = "y";
|
||||
|
||||
try
|
||||
{
|
||||
oam.getSystemConfig("DistributedInstall", DistributedInstall);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
log.writeLog(__LINE__, "addModule - ERROR: get DistributedInstall", LOG_TYPE_ERROR);
|
||||
}
|
||||
|
||||
if ( actIndicator == oam::REMOVE && ( DistributedInstall == "y" )) {
|
||||
log.writeLog(__LINE__, "STOPALL: uninstall MariaDB ColumnStore PGKs", LOG_TYPE_DEBUG);
|
||||
if ( config.moduleType() == "um" ) {
|
||||
system("rpm -e --nodeps $(rpm -qa | grep '^mariadb-columnstore')");
|
||||
system("dpkg -P $(dpkg --get-selections | grep '^mariadb-columnstore')");
|
||||
|
@ -1843,6 +1843,24 @@ int main(int argc, char *argv[])
|
||||
catch(...)
|
||||
{}
|
||||
|
||||
try {
|
||||
string DistributedInstall = sysConfigOld->getConfig("Installation", "DistributedInstall");
|
||||
|
||||
if ( !DistributedInstall.empty() )
|
||||
{
|
||||
try {
|
||||
sysConfigNew->setConfig("Installation", "DistributedInstall", DistributedInstall);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
cout << "ERROR: Problem setting DistributedInstall in the Calpont System Configuration file" << endl;
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(...)
|
||||
{}
|
||||
|
||||
//Write out Updated System Configuration File
|
||||
sysConfigNew->write();
|
||||
}
|
||||
|
Reference in New Issue
Block a user