1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

chnages for ebs create

This commit is contained in:
david hill
2016-05-05 17:23:51 -05:00
parent e0db0597e2
commit f98249deb2
4 changed files with 75 additions and 71 deletions

View File

@ -111,7 +111,7 @@ export JAVA_HOME=$java
# get Keys and region # get Keys and region
AmazonAccessKeyFile=`$prefix/Calpont/bin/getConfig Installation AmazonAccessKey` AmazonAccessKeyFile=`$prefix/Calpont/bin/getConfig Installation AmazonAccessKey`
if [ $AmazonAccessKeyfile == "unassigned" ]; then if [ $AmazonAccessKeyFile == "unassigned" ]; then
echo "FAILED: missing Config Setting AmazonAccessKey : $AmazonAccessKeyfile" echo "FAILED: missing Config Setting AmazonAccessKey : $AmazonAccessKeyfile"
exit 1 exit 1
fi fi

View File

@ -111,7 +111,7 @@ export JAVA_HOME=$java
# get Keys and region # get Keys and region
AmazonAccessKeyFile=`$prefix/Calpont/bin/getConfig Installation AmazonAccessKey` AmazonAccessKeyFile=`$prefix/Calpont/bin/getConfig Installation AmazonAccessKey`
if [ $AmazonAccessKeyfile == "unassigned" ]; then if [ $AmazonAccessKeyFile == "unassigned" ]; then
echo "FAILED: missing Config Setting AmazonAccessKey : $AmazonAccessKeyfile" echo "FAILED: missing Config Setting AmazonAccessKey : $AmazonAccessKeyfile"
exit 1 exit 1
fi fi
@ -193,25 +193,26 @@ createvolume() {
if [ $moduleType == "um" ]; then if [ $moduleType == "um" ]; then
# get type # get type
volumeType=`$prefix/Calpont/bin/IDBInstanceCmds.sh UMVolumeType` volumeType=`$prefix/Calpont/bin/getConfig Installation UMVolumeType`
if [ $volumeType == "io1" ]; then if [ $volumeType == "io1" ]; then
# get IOPS # get IOPS
volumeIOPS=`$prefix/Calpont/bin/IDBInstanceCmds.sh UMVolumeIOPS` volumeIOPS=`$prefix/Calpont/bin/getConfig Installation UMVolumeIOPS`
fi fi
else # pm else # pm
# get type # get type
volumeType=`$prefix/Calpont/bin/IDBInstanceCmds.sh PMVolumeType` volumeType=`$prefix/Calpont/bin/getConfig Installation PMVolumeType`
if [ $volumeType == "io1" ]; then if [ $volumeType == "io1" ]; then
# get IOPS # get IOPS
volumeIOPS=`$prefix/Calpont/bin/IDBInstanceCmds.sh PMVolumeIOPS` volumeIOPS=`$prefix/Calpont/bin/getConfig Installation PMVolumeIOPS`
fi fi
fi fi
#create volume #create volume
if [ $volumeType == "io1" ]; then if [ $volumeType == "io1" ]; then
volume=`ec2-create-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region -z $zone -s $volumeSize -t volumeType -iops $volumeIOPS | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'` volume=`ec2-create-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region -z $zone -s $volumeSize -t $volumeType -iops $volumeIOPS | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
else else
volume=`ec2-create-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region -z $zone -s $volumeSize -t volumeType | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'` volume=`ec2-create-volume -O $AmazonAccessKey -W $AmazonSecretKey --region $Region -z $zone -s $volumeSize -t $volumeType | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
fi
echo $volume echo $volume
return return

View File

@ -5946,7 +5946,7 @@ namespace oam
} }
//attach and format volumes //attach and format volumes
device = "/dev/sdf" + itoa(moduleID); device = "/dev/sdf";
string localInstance = getEC2LocalInstance(); string localInstance = getEC2LocalInstance();

View File

@ -850,7 +850,8 @@ int main(int argc, char *argv[])
cloud = oam::UnassignedName; cloud = oam::UnassignedName;
} }
cout << "Amazon EC2-API-TOOLS Instance install. You have 2 install options: " << endl << endl; cout << "===== Amazon EC2-API-TOOLS Instance Install =====" << endl << endl;
cout << "You have 2 install options: " << endl << endl;
cout << "1. Utilizing the Amazon IDs for instances and volumes which allows for features like" << endl; cout << "1. Utilizing the Amazon IDs for instances and volumes which allows for features like" << endl;
cout << "automaticly launching instances and EBS volumes when configuring and system expansion." << endl; cout << "automaticly launching instances and EBS volumes when configuring and system expansion." << endl;
cout << "This option is recommended and would be use if you are setting up a InfiniDB system." << endl << endl; cout << "This option is recommended and would be use if you are setting up a InfiniDB system." << endl << endl;
@ -1316,9 +1317,9 @@ int main(int argc, char *argv[])
cout << "===== Setup the Module Configuration =====" << endl << endl; cout << "===== Setup the Module Configuration =====" << endl << endl;
if (amazonInstall) { if (amazonInstall) {
cout << "Amazon Install: For Module Configuration, you will have the option to Enter the Instance IDs" << endl; cout << "Amazon Install: For Module Configuration, you will have the option to provide the" << endl;
cout << "if you have already precreated the Instance's you want to install on or have postConfigure create" << endl; cout << "existing Instance IDs or have postConfigure create the Instances used for the other nodes." << endl;
cout << "the Instances for you. You will be prompted during the Module Configuration setup section." << endl; cout << "You will be prompted during the Module Configuration setup section." << endl;
} }
//get OAM Parent Module IP addresses and Host Name, if it exist //get OAM Parent Module IP addresses and Host Name, if it exist
@ -1652,47 +1653,52 @@ int main(int argc, char *argv[])
} }
else else
{ {
//check if need to create instance or user enter ID if ( moduleHostName == oam::UnassignedName )
string create = "y";
while(true)
{ {
pcommand = callReadline("Do you need the instance created for " + newModuleName + " [y,n] (y) > "); //check if need to create instance or user enter ID
if (pcommand) string create = "y";
while(true)
{ {
if (strlen(pcommand) > 0) create = pcommand; pcommand = callReadline("Create Instance for " + newModuleName + " [y,n] (y) > ");
callFree(pcommand); if (pcommand)
{
if (strlen(pcommand) > 0) create = pcommand;
callFree(pcommand);
}
if ( create == "y" || create == "n" )
break;
else
cout << "Invalid Entry, please enter 'y' for yes or 'n' for no" << endl;
create = "y";
if ( noPrompting )
exit(1);
} }
if ( create == "y" || create == "n" )
break;
else if ( create == "y" ) {
cout << "Invalid Entry, please enter 'y' for yes or 'n' for no" << endl; ModuleIP moduleip;
create = "y"; moduleip.moduleName = newModuleName;
if ( noPrompting )
exit(1); string AmazonVPCNextPrivateIP = "autoassign";
} try {
oam.getSystemConfig("AmazonVPCNextPrivateIP", AmazonVPCNextPrivateIP);
}
catch(...) {}
moduleip.IPaddress = AmazonVPCNextPrivateIP;
newModuleHostName = launchInstance(moduleip);
if ( create == "y" ) { if ( newModuleHostName == oam::UnassignedName )
ModuleIP moduleip; {
moduleip.moduleName = newModuleName; cout << "launch Instance failed for " + newModuleName << endl;
exit (1);
string AmazonVPCNextPrivateIP = "autoassign"; }
try {
oam.getSystemConfig("AmazonVPCNextPrivateIP", AmazonVPCNextPrivateIP); prompt = "";
} }
catch(...) {} else
prompt = "Enter EC2 Instance ID (" + moduleHostName + ") > ";
moduleip.IPaddress = AmazonVPCNextPrivateIP;
newModuleHostName = launchInstance(moduleip);
if ( newModuleHostName == oam::UnassignedName )
{
cout << "launch Instance failed for " + newModuleName << endl;
exit (1);
}
prompt = "";
} }
else else
prompt = "Enter EC2 Instance ID (" + moduleHostName + ") > "; prompt = "Enter EC2 Instance ID (" + moduleHostName + ") > ";
@ -2095,8 +2101,7 @@ int main(int argc, char *argv[])
while(true) while(true)
{ {
pcommand = callReadline("Do you need the volume created [y,n] (y) > "); pcommand = callReadline("Create an EBS volume for " + newModuleName + " ? [y,n] (y) > ");
if (pcommand)
{ {
if (strlen(pcommand) > 0) create = pcommand; if (strlen(pcommand) > 0) create = pcommand;
callFree(pcommand); callFree(pcommand);
@ -2132,7 +2137,7 @@ int main(int argc, char *argv[])
} }
//get device name based on DBRoot ID //get device name based on DBRoot ID
deviceName = "/dev/sdf" + oam.itoa(moduleID); deviceName = "/dev/sdf";
} }
else else
{ {
@ -4287,13 +4292,11 @@ bool storageSetup(bool amazonInstall)
// get Frontend Data storage type // get Frontend Data storage type
// //
cout << "----- Setup High Availability Frontend MySQL Data Storage Mount Configuration -----" << endl << endl; cout << "----- Setup User Module MySQL Data Storage Mount Configuration -----" << endl << endl;
cout << "There are 2 options when configuring the storage: internal and external" << endl << endl; cout << "There are 2 options when configuring the storage: internal and external" << endl << endl;
cout << " 'internal' - This is specified when a local disk is used for the MySQL Data storage." << endl; cout << " 'internal' - This is specified when a local disk is used for the MySQL Data storage." << endl << endl;
cout << " High Availability Server Failover is not Supported in this mode," << endl << endl; cout << " 'external' - This is specified when the MySQL Data directory is externally mounted." << endl << endl;
cout << " 'external' - This is specified when the MySQL Data directory is externally mounted." << endl;
cout << " High Availability Server Failover is Supported in this mode." << endl << endl;
try { try {
UMStorageType = sysConfig->getConfig(InstallSection, "UMStorageType"); UMStorageType = sysConfig->getConfig(InstallSection, "UMStorageType");
@ -4370,6 +4373,12 @@ bool storageSetup(bool amazonInstall)
return false; return false;
} }
string minSize = "1";
string maxSize = "16384";
if (UMVolumeType == "io1")
minSize = "4";
cout << endl; cout << endl;
try { try {
oam.getSystemConfig("UMVolumeSize", UMVolumeSize); oam.getSystemConfig("UMVolumeSize", UMVolumeSize);
@ -4377,14 +4386,8 @@ bool storageSetup(bool amazonInstall)
catch(...) catch(...)
{} {}
if ( UMVolumeSize.empty() || UMVolumeSize == "") if ( UMVolumeSize.empty() || UMVolumeSize == "" || UMVolumeSize == oam::UnassignedName)
UMVolumeSize = oam::UnassignedName; UMVolumeSize = "10";
string minSize = "1";
string maxSize = "16384";
if (UMVolumeType == "io1")
minSize = "4";
while(true) while(true)
{ {
@ -4527,7 +4530,7 @@ bool storageSetup(bool amazonInstall)
if ( DBRootStorageType == "hdfs" ) if ( DBRootStorageType == "hdfs" )
storageType = "4"; storageType = "4";
cout << endl << "----- Setup High Availability Data Storage Mount Configuration -----" << endl << endl; cout << endl << "----- Setup Performance Module DBRoot Data Storage Mount Configuration -----" << endl << endl;
if ( glusterInstalled == "n" && hadoopInstalled == "n" ) if ( glusterInstalled == "n" && hadoopInstalled == "n" )
{ {
@ -4710,8 +4713,8 @@ bool storageSetup(bool amazonInstall)
catch(...) catch(...)
{} {}
if ( PMVolumeSize.empty() || PMVolumeSize == "") if ( PMVolumeSize.empty() || PMVolumeSize == "" || PMVolumeSize == oam::UnassignedName)
PMVolumeSize = oam::UnassignedName; PMVolumeSize = "100";
string minSize = "1"; string minSize = "1";
string maxSize = "16384"; string maxSize = "16384";
@ -4762,7 +4765,7 @@ bool storageSetup(bool amazonInstall)
catch(...) catch(...)
{} {}
if ( PMVolumeIOPS.empty() || PMVolumeIOPS == "") if ( PMVolumeIOPS.empty() || PMVolumeIOPS == "" || PMVolumeIOPS == oam::UnassignedName)
PMVolumeIOPS = maxIOPS; PMVolumeIOPS = maxIOPS;
while(true) while(true)
@ -4771,11 +4774,11 @@ bool storageSetup(bool amazonInstall)
pcommand = callReadline(prompt); pcommand = callReadline(prompt);
if (pcommand) if (pcommand)
{ {
if (strlen(pcommand) > 0) PMVolumeSize = pcommand; if (strlen(pcommand) > 0) PMVolumeIOPS = pcommand;
callFree(pcommand); callFree(pcommand);
} }
if ( atoi(PMVolumeSize.c_str()) < atoi(minIOPS.c_str()) || atoi(PMVolumeSize.c_str()) > atoi(maxIOPS.c_str()) ) if ( atoi(PMVolumeIOPS.c_str()) < atoi(minIOPS.c_str()) || atoi(PMVolumeIOPS.c_str()) > atoi(maxIOPS.c_str()) )
{ {
cout << endl << "Invalid Entry, please re-enter" << endl << endl; cout << endl << "Invalid Entry, please re-enter" << endl << endl;
if ( noPrompting ) if ( noPrompting )