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