1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-07 09:01:10 +03:00

Merge pull request #559 from mariadb-corporation/MCOL-1699

MCOL-1699 - fix iss with adddbroot amazon
This commit is contained in:
benthompson15
2018-09-13 11:22:47 -05:00
committed by GitHub
3 changed files with 25 additions and 18 deletions

View File

@ -7713,7 +7713,7 @@ namespace oam
// run script to get Instance status and IP Address // run script to get Instance status and IP Address
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh getInstance > /tmp/getInstanceInfo_" + name; string cmd = InstallDir + "/bin/MCSInstanceCmds.sh getInstance > /tmp/getInstanceInfo_" + name;
int status = system(cmd.c_str()); int status = system(cmd.c_str());
if (WEXITSTATUS(status) != 0 ) if (WEXITSTATUS(status) == 1 )
return "failed"; return "failed";
// get Instance Name // get Instance Name
@ -7744,7 +7744,7 @@ namespace oam
// run script to get Instance status and IP Address // run script to get Instance status and IP Address
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh getType > /tmp/getInstanceType_" + name; string cmd = InstallDir + "/bin/MCSInstanceCmds.sh getType > /tmp/getInstanceType_" + name;
int status = system(cmd.c_str()); int status = system(cmd.c_str());
if (WEXITSTATUS(status) != 0 ) if (WEXITSTATUS(status) == 1 )
return "failed"; return "failed";
// get Instance Name // get Instance Name
@ -7775,7 +7775,7 @@ namespace oam
// run script to get Instance Subnet // run script to get Instance Subnet
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh getSubnet > /tmp/getInstanceSubnet_" + name; string cmd = InstallDir + "/bin/MCSInstanceCmds.sh getSubnet > /tmp/getInstanceSubnet_" + name;
int status = system(cmd.c_str()); int status = system(cmd.c_str());
if (WEXITSTATUS(status) != 0 ) if (WEXITSTATUS(status) == 1 )
return "failed"; return "failed";
// get Instance Name // get Instance Name
@ -7807,7 +7807,7 @@ namespace oam
// run script to get Instance status and IP Address // run script to get Instance status and IP Address
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh launchInstance " + IPAddress + " " + type + " " + group + " > /tmp/getInstance_" + name; string cmd = InstallDir + "/bin/MCSInstanceCmds.sh launchInstance " + IPAddress + " " + type + " " + group + " > /tmp/getInstance_" + name;
int status = system(cmd.c_str()); int status = system(cmd.c_str());
if (WEXITSTATUS(status) != 0 ) if (WEXITSTATUS(status) == 1 )
return "failed"; return "failed";
if (checkLogStatus("/tmp/getInstance", "Required") ) if (checkLogStatus("/tmp/getInstance", "Required") )
@ -7883,7 +7883,7 @@ namespace oam
// run script to get Instance status and IP Address // run script to get Instance status and IP Address
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh startInstance " + instanceName + " > /tmp/startEC2Instance_" + instanceName; string cmd = InstallDir + "/bin/MCSInstanceCmds.sh startInstance " + instanceName + " > /tmp/startEC2Instance_" + instanceName;
int ret = system(cmd.c_str()); int ret = system(cmd.c_str());
if (WEXITSTATUS(ret) != 0 ) if (WEXITSTATUS(ret) == 1 )
return false; return false;
return true; return true;
@ -7902,7 +7902,7 @@ namespace oam
// run script to get Instance status and IP Address // run script to get Instance status and IP Address
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh assignElasticIP " + instanceName + " " + IpAddress + " > /tmp/assignElasticIP_" + instanceName; string cmd = InstallDir + "/bin/MCSInstanceCmds.sh assignElasticIP " + instanceName + " " + IpAddress + " > /tmp/assignElasticIP_" + instanceName;
int ret = system(cmd.c_str()); int ret = system(cmd.c_str());
if (WEXITSTATUS(ret) != 0 ) if (WEXITSTATUS(ret) == 1 )
exceptionControl("assignElasticIP", oam::API_FAILURE); exceptionControl("assignElasticIP", oam::API_FAILURE);
return true; return true;
@ -7921,7 +7921,7 @@ namespace oam
// run script to get Instance status and IP Address // run script to get Instance status and IP Address
string cmd = InstallDir + "/bin/MCSInstanceCmds.sh deassignElasticIP " + IpAddress + " > /tmp/deassignElasticIP_" + IpAddress; string cmd = InstallDir + "/bin/MCSInstanceCmds.sh deassignElasticIP " + IpAddress + " > /tmp/deassignElasticIP_" + IpAddress;
int ret = system(cmd.c_str()); int ret = system(cmd.c_str());
if (WEXITSTATUS(ret) != 0 ) if (WEXITSTATUS(ret) == 1 )
exceptionControl("deassignElasticIP", oam::API_FAILURE); exceptionControl("deassignElasticIP", oam::API_FAILURE);
return true; return true;
@ -7940,8 +7940,9 @@ namespace oam
// run script to get Volume Status // run script to get Volume Status
string cmd = InstallDir + "/bin/MCSVolumeCmds.sh describe " + volumeName + " > /tmp/getVolumeStatus_" + volumeName; string cmd = InstallDir + "/bin/MCSVolumeCmds.sh describe " + volumeName + " > /tmp/getVolumeStatus_" + volumeName;
int ret = system(cmd.c_str()); int ret = system(cmd.c_str());
if (WEXITSTATUS(ret) != 0 ) if (WEXITSTATUS(ret) == 1 ){
return "failed"; return "failed";
}
// get status // get status
string status; string status;
@ -7971,7 +7972,7 @@ namespace oam
// run script to get Volume Status // run script to get Volume Status
string cmd = InstallDir + "/bin/MCSVolumeCmds.sh create " + size + " " + name + " > /tmp/createVolumeStatus_" + name; string cmd = InstallDir + "/bin/MCSVolumeCmds.sh create " + size + " " + name + " > /tmp/createVolumeStatus_" + name;
int ret = system(cmd.c_str()); int ret = system(cmd.c_str());
if (WEXITSTATUS(ret) != 0 ) if (WEXITSTATUS(ret) == 1 )
return "failed"; return "failed";
// get status // get status
@ -8016,11 +8017,15 @@ namespace oam
string cmd = InstallDir + "/bin/MCSVolumeCmds.sh attach " + volumeName + " " + instanceName + " " + deviceName + " > /tmp/attachVolumeStatus_" + volumeName; string cmd = InstallDir + "/bin/MCSVolumeCmds.sh attach " + volumeName + " " + instanceName + " " + deviceName + " > /tmp/attachVolumeStatus_" + volumeName;
ret = system(cmd.c_str()); ret = system(cmd.c_str());
if (WEXITSTATUS(ret) == 0 ) if (WEXITSTATUS(ret) == 1 )
{
//failing to attach, dettach and retry
writeLog("attachEC2Volume: Attach failed, call detach:" + volumeName + " " + instanceName + " " + deviceName, LOG_TYPE_ERROR );
detachEC2Volume(volumeName);
}
else
return true; return true;
//failing to attach, dettach and retry
detachEC2Volume(volumeName);
} }
if (ret == 0 ) if (ret == 0 )
@ -8042,7 +8047,7 @@ namespace oam
// run script to attach Volume // run script to attach Volume
string cmd = InstallDir + "/bin/MCSVolumeCmds.sh detach " + volumeName + " > /tmp/detachVolumeStatus_" + volumeName; string cmd = InstallDir + "/bin/MCSVolumeCmds.sh detach " + volumeName + " > /tmp/detachVolumeStatus_" + volumeName;
int ret = system(cmd.c_str()); int ret = system(cmd.c_str());
if (WEXITSTATUS(ret) != 0 ) if (WEXITSTATUS(ret) == 1 )
return false; return false;
return true; return true;
@ -8061,7 +8066,7 @@ namespace oam
// run script to delete Volume // run script to delete Volume
string cmd = InstallDir + "/bin/MCSVolumeCmds.sh delete " + volumeName + " > /tmp/deleteVolumeStatus_" + volumeName; string cmd = InstallDir + "/bin/MCSVolumeCmds.sh delete " + volumeName + " > /tmp/deleteVolumeStatus_" + volumeName;
int ret = system(cmd.c_str()); int ret = system(cmd.c_str());
if (WEXITSTATUS(ret) != 0 ) if (WEXITSTATUS(ret) == 1 )
return false; return false;
return true; return true;
@ -8080,7 +8085,7 @@ namespace oam
// run script to create a tag // run script to create a tag
string cmd = InstallDir + "/bin/MCSVolumeCmds.sh createTag " + resourceName + " " + tagName + " " + tagValue + " > /tmp/createTagStatus_" + resourceName; string cmd = InstallDir + "/bin/MCSVolumeCmds.sh createTag " + resourceName + " " + tagName + " " + tagValue + " > /tmp/createTagStatus_" + resourceName;
int ret = system(cmd.c_str()); int ret = system(cmd.c_str());
if (WEXITSTATUS(ret) != 0 ) if (WEXITSTATUS(ret) == 1 )
return false; return false;
return true; return true;

View File

@ -210,7 +210,7 @@ int main(int argc, char **argv)
} }
catch(...) {} catch(...) {}
if ( cloud == "amazon-ec2" ) { if ( cloud == "amazon-ec2" || cloud == "amazon-vpc" ) {
if(!aMonitor.amazonIPCheck()) { if(!aMonitor.amazonIPCheck()) {
log.writeLog(__LINE__, "ERROR: amazonIPCheck failed, exiting", LOG_TYPE_CRITICAL); log.writeLog(__LINE__, "ERROR: amazonIPCheck failed, exiting", LOG_TYPE_CRITICAL);
sleep(2); sleep(2);

View File

@ -5491,7 +5491,6 @@ bool ProcessMonitor::amazonIPCheck()
log.writeLog(__LINE__, "Assign Elastic IP Address failed : '" + moduleName + "' / '" + ELIPaddress, LOG_TYPE_ERROR); log.writeLog(__LINE__, "Assign Elastic IP Address failed : '" + moduleName + "' / '" + ELIPaddress, LOG_TYPE_ERROR);
break; break;
} }
break; break;
} }
@ -5653,8 +5652,11 @@ bool ProcessMonitor::amazonVolumeCheck(int dbrootID)
{} {}
if (oam.attachEC2Volume(volumeName, deviceName, instanceName)) { if (oam.attachEC2Volume(volumeName, deviceName, instanceName)) {
log.writeLog(__LINE__, "amazonVolumeCheck function , volume to attached: " + volumeName, LOG_TYPE_DEBUG);
string cmd = "mount " + startup::StartUp::installDir() + "/data" + oam.itoa(dbrootID) + " > /dev/null"; string cmd = "mount " + startup::StartUp::installDir() + "/data" + oam.itoa(dbrootID) + " > /dev/null";
system(cmd.c_str()); system(cmd.c_str());
log.writeLog(__LINE__, "amazonVolumeCheck function , volume to mounted: " + volumeName, LOG_TYPE_DEBUG);
return true; return true;
} }
else else