1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

add in storage type

This commit is contained in:
david hill
2016-05-04 17:55:24 -05:00
parent 511e8ab542
commit 319cea322b
3 changed files with 256 additions and 13 deletions

View File

@ -453,8 +453,12 @@
<UMInstanceType>unassigned</UMInstanceType>
<UMSecurityGroup>unassigned</UMSecurityGroup>
<UMVolumeSize>unassigned</UMVolumeSize>
<UMVolumeType>standard</UMVolumeType>
<UMVolumeIOPS>unassigned</UMVolumeiops>
<PMInstanceType>unassigned</PMInstanceType>
<PMVolumeSize>unassigned</PMVolumeSize>
<PMVolumeType>standard</PMVolumeType>
<PMVolumeIOPS>unassigned</PMVolumeiops>
<AmazonPMFailover>y</AmazonPMFailover>
<AmazonAutoTagging>y</AmazonAutoTagging>
<AmazonElasticIPCount>0</AmazonElasticIPCount>

View File

@ -139,6 +139,11 @@ string UMStorageType;
string PMVolumeSize = oam::UnassignedName;
string UMVolumeSize = oam::UnassignedName;
string UMVolumeType = "standard";
string PMVolumeType = "standard";
string PMVolumeIOPS = oam::UnassignedName;
string UMVolumeIOPS = oam::UnassignedName;
int DBRootCount;
string deviceName;
@ -4325,6 +4330,46 @@ bool storageSetup(bool amazonInstall)
{
UMStorageType = "external";
cout << endl;
try {
oam.getSystemConfig("UMVolumeType", UMVolumeType);
}
catch(...)
{}
if ( UMVolumeType.empty() || UMVolumeType == "")
UMVolumeType = "standard";
while(true)
{
string prompt = "Enter EBS Volume Type (standard, gp2, io1) : (" + UMVolumeType + ") > ";
pcommand = callReadline(prompt);
if (pcommand)
{
if (strlen(pcommand) > 0) UMVolumeType = pcommand;
callFree(pcommand);
}
if ( UMVolumeType == "standard" || UMVolumeType == "gp2" || UMVolumeType == "io1" )
break;
else
{
cout << endl << "Invalid Entry, please re-enter" << endl << endl;
if ( noPrompting )
exit(1);
}
}
//set UMVolumeType
try {
sysConfig->setConfig(InstallSection, "UMVolumeType", UMVolumeType);
}
catch(...)
{
cout << "ERROR: Problem setting UMVolumeType in the InfiniDB System Configuration file" << endl;
return false;
}
cout << endl;
try {
oam.getSystemConfig("UMVolumeSize", UMVolumeSize);
@ -4335,15 +4380,33 @@ bool storageSetup(bool amazonInstall)
if ( UMVolumeSize.empty() || UMVolumeSize == "")
UMVolumeSize = oam::UnassignedName;
string prompt = "Enter EBS Volume storage size in GB: (" + UMVolumeSize + ") > ";
pcommand = callReadline(prompt);
if (pcommand)
string minSize = "1";
string maxSize = "16384";
if (UMVolumeType == "io1")
minSize = "4";
while(true)
{
if (strlen(pcommand) > 0) UMVolumeSize = pcommand;
callFree(pcommand);
string prompt = "Enter EBS Volume storage size in GB: [" + minSize + "," + maxSize + "] (" + UMVolumeSize + ") > ";
pcommand = callReadline(prompt);
if (pcommand)
{
if (strlen(pcommand) > 0) UMVolumeSize = pcommand;
callFree(pcommand);
}
if ( atoi(UMVolumeSize.c_str()) < atoi(minSize.c_str()) || atoi(UMVolumeSize.c_str()) > atoi(maxSize.c_str()) )
{
cout << endl << "Invalid Entry, please re-enter" << endl << endl;
if ( noPrompting )
exit(1);
}
else
break;
}
//set DBRootStorageType
//set UMVolumeSize
try {
sysConfig->setConfig(InstallSection, "UMVolumeSize", UMVolumeSize);
}
@ -4352,9 +4415,55 @@ bool storageSetup(bool amazonInstall)
cout << "ERROR: Problem setting UMVolumeSize in the InfiniDB System Configuration file" << endl;
return false;
}
}
if ( UMVolumeType == "io1" )
{
string minIOPS = UMVolumeSize;
string maxIOPS = oam.itoa(atoi(UMVolumeSize.c_str()) * 30);
cout << endl;
try {
oam.getSystemConfig("UMVolumeIOPS", UMVolumeIOPS);
}
catch(...)
{}
if ( UMVolumeIOPS.empty() || UMVolumeIOPS == "")
UMVolumeIOPS = maxIOPS;
while(true)
{
string prompt = "Enter EBS Volume IOPS: [" + minIOPS + "," + maxIOPS + "] (" + UMVolumeIOPS + ") > ";
pcommand = callReadline(prompt);
if (pcommand)
{
if (strlen(pcommand) > 0) UMVolumeSize = pcommand;
callFree(pcommand);
}
if ( atoi(UMVolumeSize.c_str()) < atoi(minIOPS.c_str()) || atoi(UMVolumeSize.c_str()) > atoi(maxIOPS.c_str()) )
{
cout << endl << "Invalid Entry, please re-enter" << endl << endl;
if ( noPrompting )
exit(1);
}
else
break;
}
//set UMVolumeIOPS
try {
sysConfig->setConfig(InstallSection, "UMVolumeIOPS", UMVolumeIOPS);
}
catch(...)
{
cout << "ERROR: Problem setting UMVolumeIOPS in the InfiniDB System Configuration file" << endl;
return false;
}
}
}
try {
sysConfig->setConfig(InstallSection, "UMStorageType", UMStorageType);
}
@ -4554,6 +4663,46 @@ bool storageSetup(bool amazonInstall)
// if external and amazon, prompt for storage size
if ( storageType == "2" && amazonInstall)
{
cout << endl;
try {
oam.getSystemConfig("PMVolumeType", PMVolumeType);
}
catch(...)
{}
if ( PMVolumeType.empty() || PMVolumeType == "")
PMVolumeType = "standard";
while(true)
{
string prompt = "Enter EBS Volume Type (standard, gp2, io1) : (" + PMVolumeType + ") > ";
pcommand = callReadline(prompt);
if (pcommand)
{
if (strlen(pcommand) > 0) PMVolumeType = pcommand;
callFree(pcommand);
}
if ( PMVolumeType == "standard" || PMVolumeType == "gp2" || PMVolumeType == "io1" )
break;
else
{
cout << endl << "Invalid Entry, please re-enter" << endl << endl;
if ( noPrompting )
exit(1);
}
}
//set PMVolumeType
try {
sysConfig->setConfig(InstallSection, "PMVolumeType", PMVolumeType);
}
catch(...)
{
cout << "ERROR: Problem setting PMVolumeType in the InfiniDB System Configuration file" << endl;
return false;
}
cout << endl;
try {
oam.getSystemConfig("PMVolumeSize", PMVolumeSize);
@ -4561,15 +4710,90 @@ bool storageSetup(bool amazonInstall)
catch(...)
{}
if ( PMVolumeSize.empty() || PMVolumeSize == "" )
if ( PMVolumeSize.empty() || PMVolumeSize == "")
PMVolumeSize = oam::UnassignedName;
string prompt = "Enter EBS Volume storage size in GB: (" + PMVolumeSize + ") > ";
pcommand = callReadline(prompt);
if (pcommand)
string minSize = "1";
string maxSize = "16384";
if (PMVolumeType == "io1")
minSize = "4";
while(true)
{
if (strlen(pcommand) > 0) PMVolumeSize = pcommand;
callFree(pcommand);
string prompt = "Enter EBS Volume storage size in GB: [" + minSize + "," + maxSize + "] (" + PMVolumeSize + ") > ";
pcommand = callReadline(prompt);
if (pcommand)
{
if (strlen(pcommand) > 0) PMVolumeSize = pcommand;
callFree(pcommand);
}
if ( atoi(PMVolumeSize.c_str()) < atoi(minSize.c_str()) || atoi(PMVolumeSize.c_str()) > atoi(maxSize.c_str()) )
{
cout << endl << "Invalid Entry, please re-enter" << endl << endl;
if ( noPrompting )
exit(1);
}
else
break;
}
//set PMVolumeSize
try {
sysConfig->setConfig(InstallSection, "PMVolumeSize", PMVolumeSize);
}
catch(...)
{
cout << "ERROR: Problem setting PMVolumeSize in the InfiniDB System Configuration file" << endl;
return false;
}
if ( PMVolumeType == "io1" )
{
string minIOPS = PMVolumeSize;
string maxIOPS = oam.itoa(atoi(PMVolumeSize.c_str()) * 30);
cout << endl;
try {
oam.getSystemConfig("PMVolumeIOPS", PMVolumeIOPS);
}
catch(...)
{}
if ( PMVolumeIOPS.empty() || PMVolumeIOPS == "")
PMVolumeIOPS = maxIOPS;
while(true)
{
string prompt = "Enter EBS Volume IOPS: [" + minIOPS + "," + maxIOPS + "] (" + PMVolumeIOPS + ") > ";
pcommand = callReadline(prompt);
if (pcommand)
{
if (strlen(pcommand) > 0) PMVolumeSize = pcommand;
callFree(pcommand);
}
if ( atoi(PMVolumeSize.c_str()) < atoi(minIOPS.c_str()) || atoi(PMVolumeSize.c_str()) > atoi(maxIOPS.c_str()) )
{
cout << endl << "Invalid Entry, please re-enter" << endl << endl;
if ( noPrompting )
exit(1);
}
else
break;
}
//set PMVolumeIOPS
try {
sysConfig->setConfig(InstallSection, "PMVolumeIOPS", PMVolumeIOPS);
}
catch(...)
{
cout << "ERROR: Problem setting PMVolumeIOPS in the InfiniDB System Configuration file" << endl;
return false;
}
}
//set DBRootStorageType

View File

@ -1303,6 +1303,12 @@ int main(int argc, char *argv[])
string AmazonZone;
string AmazonVPCNextPrivateIP;
string AmazonDeviceName;
string UMVolumeType;
string UMVolumeIOPS;
string PMVolumeType;
string PMVolumeIOPS;
try {
cloud = sysConfigOld->getConfig(InstallSection, "Cloud");
x509Cert = sysConfigOld->getConfig(InstallSection, "AmazonX509Certificate");
@ -1320,6 +1326,10 @@ int main(int argc, char *argv[])
AmazonVPCNextPrivateIP = sysConfigOld->getConfig(InstallSection, "AmazonVPCNextPrivateIP");
AmazonSubNetID = sysConfigOld->getConfig(InstallSection, "AmazonSubNetID");
AmazonDeviceName = sysConfigOld->getConfig(InstallSection, "AmazonDeviceName");
UMVolumeType = sysConfigOld->getConfig(InstallSection, "UMVolumeType");
UMVolumeIOPS = sysConfigOld->getConfig(InstallSection, "UMVolumeIOPS");
PMVolumeType = sysConfigOld->getConfig(InstallSection, "PMVolumeType");
PMVolumeIOPS = sysConfigOld->getConfig(InstallSection, "PMVolumeIOPS");
}
catch(...)
{ }
@ -1382,6 +1392,11 @@ int main(int argc, char *argv[])
sysConfigNew->setConfig(InstallSection, "AmazonRegion", AmazonRegion);
sysConfigNew->setConfig(InstallSection, "AmazonZone", AmazonZone);
sysConfigNew->setConfig(InstallSection, "AmazonDeviceName", AmazonDeviceName);
sysConfigNew->setConfig(InstallSection, "UMVolumeType", UMVolumeType);
sysConfigNew->setConfig(InstallSection, "UMVolumeIOPS", UMVolumeIOPS);
sysConfigNew->setConfig(InstallSection, "PMVolumeType", PMVolumeType);
sysConfigNew->setConfig(InstallSection, "PMVolumeIOPS", PMVolumeIOPS);
}
catch(...)
{