1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-10-31 18:30:33 +03:00

Merge pull request #518 from mariadb-corporation/MCOL-1146

Mcol 1146 - multi node quick install
This commit is contained in:
benthompson15
2018-07-12 15:36:42 -05:00
committed by GitHub
7 changed files with 631 additions and 147 deletions

View File

@@ -181,7 +181,6 @@ SET(CPACK_RPM_platform_USER_FILELIST
"/usr/local/mariadb/columnstore/bin/resourceReport.sh" "/usr/local/mariadb/columnstore/bin/resourceReport.sh"
"/usr/local/mariadb/columnstore/bin/hadoopReport.sh" "/usr/local/mariadb/columnstore/bin/hadoopReport.sh"
"/usr/local/mariadb/columnstore/bin/alarmReport.sh" "/usr/local/mariadb/columnstore/bin/alarmReport.sh"
"/usr/local/mariadb/columnstore/bin/amazonInstaller"
"/usr/local/mariadb/columnstore/bin/remote_command_verify.sh" "/usr/local/mariadb/columnstore/bin/remote_command_verify.sh"
"/usr/local/mariadb/columnstore/bin/disable-rep-columnstore.sh" "/usr/local/mariadb/columnstore/bin/disable-rep-columnstore.sh"
"/usr/local/mariadb/columnstore/bin/columnstore.service" "/usr/local/mariadb/columnstore/bin/columnstore.service"
@@ -217,6 +216,9 @@ SET(CPACK_RPM_platform_USER_FILELIST
"/usr/local/mariadb/columnstore/bin/os_detect.sh" "/usr/local/mariadb/columnstore/bin/os_detect.sh"
"/usr/local/mariadb/columnstore/bin/columnstoreClusterTester.sh" "/usr/local/mariadb/columnstore/bin/columnstoreClusterTester.sh"
"/usr/local/mariadb/columnstore/bin/mariadb-command-line.sh" "/usr/local/mariadb/columnstore/bin/mariadb-command-line.sh"
"/usr/local/mariadb/columnstore/bin/quick_installer_single_server.sh"
"/usr/local/mariadb/columnstore/bin/quick_installer_multi_server.sh"
"/usr/local/mariadb/columnstore/bin/quick_installer_amazon.sh"
${ignored}) ${ignored})
SET(CPACK_RPM_libs_USER_FILELIST SET(CPACK_RPM_libs_USER_FILELIST

View File

@@ -438,7 +438,7 @@
<SystemStartupOffline>n</SystemStartupOffline> <SystemStartupOffline>n</SystemStartupOffline>
<InitialInstallFlag>n</InitialInstallFlag> <InitialInstallFlag>n</InitialInstallFlag>
<SingleServerInstall>n</SingleServerInstall> <SingleServerInstall>n</SingleServerInstall>
<ServerTypeInstall>2</ServerTypeInstall> <ServerTypeInstall>1</ServerTypeInstall>
<PMwithUM>n</PMwithUM> <PMwithUM>n</PMwithUM>
<MySQLRep>n</MySQLRep> <MySQLRep>n</MySQLRep>
<DBRootStorageType>internal</DBRootStorageType> <DBRootStorageType>internal</DBRootStorageType>

View File

@@ -37,13 +37,13 @@ install(TARGETS getMySQLpw DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
########### next target ############### ########### next target ###############
set(amazonInstaller_SRCS amazonInstaller.cpp helpers.cpp) #set(amazonInstaller_SRCS amazonInstaller.cpp helpers.cpp)
add_executable(amazonInstaller ${amazonInstaller_SRCS}) #add_executable(amazonInstaller ${amazonInstaller_SRCS})
target_link_libraries(amazonInstaller ${ENGINE_LDFLAGS} readline ncurses ${SNMP_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS}) #target_link_libraries(amazonInstaller ${ENGINE_LDFLAGS} readline ncurses ${SNMP_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
install(TARGETS amazonInstaller DESTINATION ${ENGINE_BINDIR} COMPONENT platform) #install(TARGETS amazonInstaller DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
########### next target ############### ########### next target ###############
@@ -59,5 +59,5 @@ install(TARGETS mycnfUpgrade DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
########### next target ############### ########### next target ###############
install(PROGRAMS quick_installer_single_server.sh install(PROGRAMS quick_installer_single_server.sh quick_installer_multi_server.sh quick_installer_amazon.sh
DESTINATION ${ENGINE_BINDIR} COMPONENT platform) DESTINATION ${ENGINE_BINDIR} COMPONENT platform)

View File

@@ -99,6 +99,14 @@ typedef struct Performance_Module_struct
typedef std::vector<PerformanceModule> PerformanceModuleList; typedef std::vector<PerformanceModule> PerformanceModuleList;
typedef struct ModuleIP_struct
{
std::string IPaddress;
std::string moduleName;
} ModuleIP;
typedef std::vector<ModuleIP> ModuleIpList;
void offLineAppCheck(); void offLineAppCheck();
bool setOSFiles(string parentOAMModuleName, int serverTypeInstall); bool setOSFiles(string parentOAMModuleName, int serverTypeInstall);
bool checkSaveConfigFile(); bool checkSaveConfigFile();
@@ -112,7 +120,7 @@ bool makeRClocal(string moduleType, string moduleName, int IserverTypeInstall);
bool createDbrootDirs(string DBRootStorageType); bool createDbrootDirs(string DBRootStorageType);
bool pkgCheck(std::string columnstorePackage); bool pkgCheck(std::string columnstorePackage);
bool storageSetup(bool amazonInstall); bool storageSetup(bool amazonInstall);
void setSystemName(bool single_server_quick_install = false); void setSystemName();
bool singleServerDBrootSetup(); bool singleServerDBrootSetup();
bool copyFstab(string moduleName); bool copyFstab(string moduleName);
bool attachVolume(string instanceName, string volumeName, string deviceName, string dbrootPath); bool attachVolume(string instanceName, string volumeName, string deviceName, string dbrootPath);
@@ -121,12 +129,6 @@ void remoteInstallThread(void *);
bool glusterSetup(string password); bool glusterSetup(string password);
typedef struct ModuleIP_struct
{
std::string IPaddress;
std::string moduleName;
} ModuleIP;
std::string launchInstance(ModuleIP moduleip); std::string launchInstance(ModuleIP moduleip);
string columnstorePackage; string columnstorePackage;
@@ -150,7 +152,6 @@ string PMVolumeType = "standard";
string PMVolumeIOPS = oam::UnassignedName; string PMVolumeIOPS = oam::UnassignedName;
string UMVolumeIOPS = oam::UnassignedName; string UMVolumeIOPS = oam::UnassignedName;
int DBRootCount; int DBRootCount;
string deviceName; string deviceName;
@@ -185,6 +186,10 @@ string MySQLRep = "y";
string PMwithUM = "n"; string PMwithUM = "n";
bool amazonInstall = false; bool amazonInstall = false;
bool nonDistribute = false; bool nonDistribute = false;
bool nonDistributeFlag = false;
bool single_server_quick_install = false;
bool multi_server_quick_install = false;
bool amazon_quick_install = false;
string DataFileEnvFile; string DataFileEnvFile;
@@ -219,8 +224,9 @@ int main(int argc, char *argv[])
noPrompting = false; noPrompting = false;
string password; string password;
string cmd; string cmd;
bool single_server_quick_install = false; string pmIpAddrs = "";
string umIpAddrs = "";
// struct sysinfo myinfo; // struct sysinfo myinfo;
// hidden options // hidden options
@@ -272,10 +278,12 @@ int main(int argc, char *argv[])
if (p && *p) if (p && *p)
HOME = p; HOME = p;
} }
for( int i = 1; i < argc; i++ ) for( int i = 1; i < argc; i++ )
{ {
if( string("-h") == argv[i] ) { if( string("-h") == argv[i] )
{
cout << endl; cout << endl;
cout << "This is the MariaDB ColumnStore System Configuration and Installation tool." << endl; cout << "This is the MariaDB ColumnStore System Configuration and Installation tool." << endl;
cout << "It will Configure the MariaDB ColumnStore System based on Operator inputs and" << endl; cout << "It will Configure the MariaDB ColumnStore System based on Operator inputs and" << endl;
@@ -289,48 +297,68 @@ int main(int argc, char *argv[])
cout << " Enter one of the options within [], if available, or" << endl; cout << " Enter one of the options within [], if available, or" << endl;
cout << " Enter a new value" << endl << endl; cout << " Enter a new value" << endl << endl;
cout << endl; cout << endl;
cout << "Usage: postConfigure [-h][-c][-u][-p][-qs][-port][-i][-n][-sn]" << endl; cout << "Usage: postConfigure [-h][-c][-u][-p][-qs][-qm][-qa][-port][-i][-n][-d][-sn][-pm-ip-addrs][-um-ip-addrs][-pm-count][-um-count]" << endl;
cout << " -h Help" << endl; cout << " -h Help" << endl;
cout << " -c Config File to use to extract configuration data, default is Columnstore.xml.rpmsave" << endl; cout << " -c Config File to use to extract configuration data, default is Columnstore.xml.rpmsave" << endl;
cout << " -u Upgrade, Install using the Config File from -c, default to Columnstore.xml.rpmsave" << endl; cout << " -u Upgrade, Install using the Config File from -c, default to Columnstore.xml.rpmsave" << endl;
cout << " If ssh-keys aren't setup, you should provide passwords as command line arguments" << endl; cout << " If ssh-keys aren't setup, you should provide passwords as command line arguments" << endl;
cout << " -p Unix Password, used with no-prompting option" << endl; cout << " -p Unix Password, used with no-prompting option" << endl;
cout << " -qs Single Server Quick Install" << endl; cout << " -qs Quick Install - Single Server" << endl;
cout << " -qm Quick Install - Multi Server" << endl;
cout << " -port MariaDB ColumnStore Port Address" << endl; cout << " -port MariaDB ColumnStore Port Address" << endl;
cout << " -i Non-root Install directory, Only use for non-root installs" << endl; cout << " -i Non-root Install directory, Only use for non-root installs" << endl;
cout << " -n Non-distributed install, meaning it will not install the remote nodes" << endl; cout << " -n Non-distributed install, meaning postConfigure will not install packages on remote nodes" << endl;
cout << " -d Distributed install, meaning postConfigure will install packages on remote nodes" << endl;
cout << " -sn System Name" << endl; cout << " -sn System Name" << endl;
cout << " -pm-ip-addrs Performance Module IP Addresses xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx" << endl;
cout << " -um-ip-addrs User Module IP Addresses xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx" << endl;
exit (0); exit (0);
} }
else if( string("-qs") == argv[i] ) else if( string("-qs") == argv[i] )
{ {
single_server_quick_install = true; single_server_quick_install = true;
noPrompting = true; noPrompting = true;
} }
else if( string("-f") == argv[i] ) else if( string("-qm") == argv[i] )
nodeps = "--nodeps"; {
else if( string("-o") == argv[i] ) multi_server_quick_install = true;
startOfflinePrompt = true; noPrompting = true;
else if( string("-c") == argv[i] ) { }
else if( string("-qa") == argv[i] )
{
amazon_quick_install = true;
noPrompting = true;
}
else if( string("-f") == argv[i] )
nodeps = "--nodeps";
else if( string("-o") == argv[i] )
startOfflinePrompt = true;
else if( string("-c") == argv[i] )
{
i++; i++;
if (i >= argc ) { if (i >= argc )
{
cout << " ERROR: Config File not provided" << endl; cout << " ERROR: Config File not provided" << endl;
exit (1); exit (1);
} }
oldFileName = argv[i]; oldFileName = argv[i];
if ( oldFileName.find("Columnstore.xml") == string::npos ) { if ( oldFileName.find("Columnstore.xml") == string::npos )
{
cout << " ERROR: Config File is not a Columnstore.xml file name" << endl; cout << " ERROR: Config File is not a Columnstore.xml file name" << endl;
exit (1); exit (1);
} }
} }
else if( string("-p") == argv[i] ) { else if( string("-p") == argv[i] )
{
i++; i++;
if (i >= argc ) { if (i >= argc )
{
cout << " ERROR: Password not provided" << endl; cout << " ERROR: Password not provided" << endl;
exit (1); exit (1);
} }
password = argv[i]; password = argv[i];
if ( password.find("-") != string::npos ) { if ( password.find("-") != string::npos )
{
cout << " ERROR: Valid Password not provided" << endl; cout << " ERROR: Valid Password not provided" << endl;
exit (1); exit (1);
} }
@@ -339,10 +367,20 @@ int main(int argc, char *argv[])
noPrompting = true; noPrompting = true;
// for backward compatibility // for backward compatibility
else if( string("-n") == argv[i] ) else if( string("-n") == argv[i] )
{
nonDistribute = true; nonDistribute = true;
else if( string("-port") == argv[i] ) { nonDistributeFlag = true;
}
else if( string("-d") == argv[i] )
{
nonDistribute = false;
nonDistributeFlag = true;
}
else if( string("-port") == argv[i] )
{
i++; i++;
if (i >= argc ) { if (i >= argc )
{
cout << " ERROR: MariaDB ColumnStore Port ID not supplied" << endl; cout << " ERROR: MariaDB ColumnStore Port ID not supplied" << endl;
exit (1); exit (1);
} }
@@ -353,29 +391,95 @@ int main(int argc, char *argv[])
exit (1); exit (1);
} }
} }
else if( string("-i") == argv[i] ) { else if( string("-i") == argv[i] )
{
i++; i++;
if (i >= argc ) { if (i >= argc )
{
cout << " ERROR: Path not provided" << endl; cout << " ERROR: Path not provided" << endl;
exit (1); exit (1);
} }
installDir = argv[i]; installDir = argv[i];
} }
else if( string("-sn") == argv[i] ) { else if( string("-sn") == argv[i] )
{
i++; i++;
if (i >= argc ) { if (i >= argc )
{
cout << " ERROR: System-name not provided" << endl; cout << " ERROR: System-name not provided" << endl;
exit (1); exit (1);
} }
systemName = argv[i]; systemName = argv[i];
}
else if( string("-pm-ip-addrs") == argv[i] )
{
i++;
if (i >= argc )
{
cout << " ERROR: PM-IP-ADRESSES not provided" << endl;
exit (1);
}
pmIpAddrs = argv[i];
}
else if( string("-um-ip-addrs") == argv[i] )
{
i++;
if (i >= argc )
{
cout << " ERROR: UM-IP-ADRESSES not provided" << endl;
exit (1);
}
umIpAddrs = argv[i];
}
else if( string("-pm-count") == argv[i] )
{
i++;
if (i >= argc )
{
cout << " ERROR: PM-COUNT not provided" << endl;
exit (1);
}
pmNumber = atoi(argv[i]);
}
else if( string("-um-count") == argv[i] )
{
i++;
if (i >= argc )
{
cout << " ERROR: UM-COUNT not provided" << endl;
exit (1);
}
umNumber = atoi(argv[i]);
} }
else else
{ {
cout << " ERROR: Invalid Argument = " << argv[i] << endl; cout << " ERROR: Invalid Argument = " << argv[i] << endl;
cout << " Usage: postConfigure [-h][-c][-u][-p][-qs][-port][-i][-n][-sn]" << endl; cout << " Usage: postConfigure [-h][-c][-u][-p][-qs][-qm][-qa][-port][-i][-n][-d][-sn][-pm-ip-addrs][-um-ip-addrs][-pm-count][-um-count]" << endl;
exit (1); exit (1);
} }
} }
//check if quick install multi-server has been given ip address
if (multi_server_quick_install)
{
if ( ( umIpAddrs.empty() && pmIpAddrs.empty() ) ||
( !umIpAddrs.empty() && pmIpAddrs.empty() ))
{
cout << " ERROR: Multi-Server option entered, but invalid UM/PM IP addresses were provided, exiting" << endl;
exit(1);
}
}
//check if quick install multi-server has been given ip address
if (amazon_quick_install)
{
if ( ( umNumber == 0 && pmNumber == 0 ) ||
( umNumber != 0 && pmNumber == 0 ) )
{
cout << " ERROR: Amazon option entered, but invalid UM/PM Counts were provided, exiting" << endl;
exit(1);
}
}
if (installDir[0] != '/') if (installDir[0] != '/')
{ {
@@ -395,7 +499,7 @@ int main(int argc, char *argv[])
cout << "IMPORTANT: This tool requires to run on the Performance Module #1" << endl; cout << "IMPORTANT: This tool requires to run on the Performance Module #1" << endl;
cout << endl; cout << endl;
if (!single_server_quick_install) if (!single_server_quick_install || !multi_server_quick_install || !amazon_quick_install)
{ {
if (!noPrompting) { if (!noPrompting) {
cout << "Prompting instructions:" << endl << endl; cout << "Prompting instructions:" << endl << endl;
@@ -436,49 +540,43 @@ int main(int argc, char *argv[])
} }
//check Config saved files //check Config saved files
if (!single_server_quick_install) if ( !checkSaveConfigFile())
{ {
if ( !checkSaveConfigFile()) cout << "ERROR: Configuration File not setup" << endl;
{ exit(1);
cout << "ERROR: Configuration File not setup" << endl;
exit(1);
}
} }
//determine package type //determine package type
string EEPackageType; string EEPackageType;
if (single_server_quick_install) if (!rootUser)
EEPackageType = "binary";
else
{ {
if (!rootUser) int rtnCode = system("rpm -qi mariadb-columnstore-platform > /tmp/columnstore.txt 2>&1");
EEPackageType = "binary"; if (WEXITSTATUS(rtnCode) == 0)
else EEPackageType = "rpm";
{ else {
int rtnCode = system("rpm -qi mariadb-columnstore-platform > /tmp/columnstore.txt 2>&1"); rtnCode = system("dpkg -s mariadb-columnstore-platform > /tmp/columnstore.txt 2>&1");
if (WEXITSTATUS(rtnCode) == 0) if (WEXITSTATUS(rtnCode) == 0)
EEPackageType = "rpm"; EEPackageType = "deb";
else { else
rtnCode = system("dpkg -s mariadb-columnstore-platform > /tmp/columnstore.txt 2>&1"); EEPackageType = "binary";
if (WEXITSTATUS(rtnCode) == 0)
EEPackageType = "deb";
else
EEPackageType = "binary";
}
} }
}
try { try {
sysConfig->setConfig(InstallSection, "EEPackageType", EEPackageType); sysConfig->setConfig(InstallSection, "EEPackageType", EEPackageType);
} }
catch(...) catch(...)
{ {
cout << "ERROR: Problem setting EEPackageType from the MariaDB ColumnStore System Configuration file" << endl; cout << "ERROR: Problem setting EEPackageType from the MariaDB ColumnStore System Configuration file" << endl;
exit(1); exit(1);
} }
if ( !writeConfig(sysConfig) ) { if ( !writeConfig(sysConfig) ) {
cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl; cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl;
exit(1); exit(1);
}
} }
//check for local ip address as pm1 //check for local ip address as pm1
@@ -614,12 +712,22 @@ int main(int argc, char *argv[])
} }
//check for non-Distributed Install //check for non-Distributed Install
if ( nonDistribute ) if ( nonDistributeFlag )
{ {
try { if ( nonDistribute )
oam.setSystemConfig("DistributedInstall", "n"); {
} try {
catch(...) {} oam.setSystemConfig("DistributedInstall", "n");
}
catch(...) {}
}
else
{
try {
oam.setSystemConfig("DistributedInstall", "y");
}
catch(...) {}
}
} }
else else
{ {
@@ -638,7 +746,7 @@ int main(int argc, char *argv[])
if (single_server_quick_install) if (single_server_quick_install)
{ {
cout << "===== Quick Single-Server Install Configuration =====" << endl << endl; cout << "===== Quick Install Single-Server Configuration =====" << endl << endl;
cout << "Single-Server install is used when there will only be 1 server configured" << endl; cout << "Single-Server install is used when there will only be 1 server configured" << endl;
cout << "on the system. It can also be used for production systems, if the plan is" << endl; cout << "on the system. It can also be used for production systems, if the plan is" << endl;
@@ -646,6 +754,18 @@ int main(int argc, char *argv[])
singleServerInstall = "1"; singleServerInstall = "1";
} }
else if (multi_server_quick_install)
{
cout << "===== Quick Install Multi-Server Configuration =====" << endl << endl;
singleServerInstall = "2";
}
else if (amazon_quick_install)
{
cout << "===== Quick Install Amazon Configuration =====" << endl << endl;
singleServerInstall = "2";
}
else else
{ {
cout << "===== Setup System Server Type Configuration =====" << endl << endl; cout << "===== Setup System Server Type Configuration =====" << endl << endl;
@@ -724,7 +844,7 @@ int main(int argc, char *argv[])
system(cmd.c_str()); system(cmd.c_str());
} }
setSystemName(single_server_quick_install); setSystemName();
if (!single_server_quick_install) if (!single_server_quick_install)
{ {
@@ -796,6 +916,112 @@ int main(int argc, char *argv[])
// //
// Multi-server install // Multi-server install
// //
ModuleIP InputModuleIP;
ModuleIpList InputModuleIPList;
int MaxNicID = oam::MAX_NIC;
if (multi_server_quick_install)
{
//set configuarion settings for default setup
try {
sysConfig->setConfig(InstallSection, "MySQLRep", "y");
}
catch(...)
{}
if (umIpAddrs == "" )
{
// set Server Type Installation to combined
try {
sysConfig->setConfig(InstallSection, "ServerTypeInstall", "2");
}
catch(...)
{}
}
else
{
int id = 1;
boost::char_separator<char> sep(",");
boost::tokenizer< boost::char_separator<char> > tokens(umIpAddrs, sep);
for ( boost::tokenizer< boost::char_separator<char> >::iterator it = tokens.begin();
it != tokens.end();
++it, ++id)
{
string module = "um" + oam.itoa(id);
InputModuleIP.IPaddress = *it;
InputModuleIP.moduleName = module;
InputModuleIPList.push_back(InputModuleIP);
}
umNumber = id-1;
}
if (pmIpAddrs != "" )
{
int id = 1;
boost::char_separator<char> sep(",");
boost::tokenizer< boost::char_separator<char> > tokens(pmIpAddrs, sep);
for ( boost::tokenizer< boost::char_separator<char> >::iterator it = tokens.begin();
it != tokens.end();
++it, ++id)
{
string module = "pm" + oam.itoa(id);
InputModuleIP.IPaddress = *it;
InputModuleIP.moduleName = module;
InputModuleIPList.push_back(InputModuleIP);
}
pmNumber = id-1;
}
if ( !writeConfig(sysConfig) )
{
cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl;
exit(1);
}
MaxNicID = 1;
}
else
{
if (amazon_quick_install)
{
//set configuarion settings for default setup
try {
sysConfig->setConfig(InstallSection, "MySQLRep", "y");
}
catch(...)
{}
try {
sysConfig->setConfig(InstallSection, "Cloud", "amazon-vpc");
}
catch(...)
{}
if (umNumber == 0 )
{
// set Server Type Installation to combined
try {
sysConfig->setConfig(InstallSection, "ServerTypeInstall", "2");
}
catch(...)
{}
}
if ( !writeConfig(sysConfig) )
{
cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl;
exit(1);
}
MaxNicID = 1;
}
}
cout << endl; cout << endl;
//cleanup/create local/etc directory //cleanup/create local/etc directory
@@ -851,7 +1077,7 @@ int main(int argc, char *argv[])
} }
switch ( IserverTypeInstall ) { switch ( IserverTypeInstall ) {
case (oam::INSTALL_COMBINE_DM_UM_PM): // combined #1 - dm/um/pm on a single server case (oam::INSTALL_COMBINE_DM_UM_PM): // combined #1 - um/pm on a single server
{ {
cout << "Combined Server Installation will be performed." << endl; cout << "Combined Server Installation will be performed." << endl;
cout << "The Server will be configured as a Performance Module." << endl; cout << "The Server will be configured as a Performance Module." << endl;
@@ -986,8 +1212,8 @@ int main(int argc, char *argv[])
} }
if ( answer == "y" ) { if ( answer == "y" ) {
mysqlRep = true; mysqlRep = true;
MySQLRep = "y"; MySQLRep = "y";
} }
else else
{ {
@@ -1027,13 +1253,30 @@ int main(int argc, char *argv[])
in.seekg(0, std::ios::end); in.seekg(0, std::ios::end);
int size = in.tellg(); int size = in.tellg();
if ( size == 0 || oam.checkLogStatus("/tmp/amazon.log", "not found")) if ( size == 0 || oam.checkLogStatus("/tmp/amazon.log", "not found"))
// not running on amazon with ec2-api-tools {
// not running on amazon with ec2-api-tools
if (amazon_quick_install)
{
cout << "ERROR: Amazon Quick Installer was specified, bu the AMazon CLI API packages isnt installed, exiting" << endl;
exit(1);
}
amazonInstall = false; amazonInstall = false;
}
else else
{ {
if ( size == 0 || oam.checkLogStatus("/tmp/amazon.log", "not installed")) if ( size == 0 || oam.checkLogStatus("/tmp/amazon.log", "not installed"))
{
// not running on amazon with ec2-api-tools
if (amazon_quick_install)
{
cout << "ERROR: Amazon Quick Installer was specified, bu the AMazon CLI API packages isnt installed, exiting" << endl;
exit(1);
}
amazonInstall = false; amazonInstall = false;
}
else else
amazonInstall = true; amazonInstall = true;
} }
@@ -1069,7 +1312,7 @@ int main(int argc, char *argv[])
amazonInstall = false; amazonInstall = false;
try { try {
sysConfig->setConfig(InstallSection, "Cloud", "disable"); sysConfig->setConfig(InstallSection, "Cloud", "disable");
} }
catch(...) catch(...)
{}; {};
@@ -1463,6 +1706,14 @@ int main(int argc, char *argv[])
catch(...) catch(...)
{} {}
} }
if ( moduleType == "um")
if ( umNumber != 0 )
moduleCount = umNumber;
if ( moduleType == "pm")
if ( pmNumber != 0 )
moduleCount = pmNumber;
//verify and setup of modules count //verify and setup of modules count
switch ( IserverTypeInstall ) { switch ( IserverTypeInstall ) {
@@ -1519,6 +1770,7 @@ int main(int argc, char *argv[])
exit(1); exit(1);
continue; continue;
} }
//update count //update count
try { try {
string ModuleCountParm = "ModuleCount" + oam.itoa(i+1); string ModuleCountParm = "ModuleCount" + oam.itoa(i+1);
@@ -1545,7 +1797,7 @@ int main(int argc, char *argv[])
//clear any Equipped Module IP addresses that aren't in current ID range //clear any Equipped Module IP addresses that aren't in current ID range
for ( int j = 0 ; j < listSize ; j++ ) for ( int j = 0 ; j < listSize ; j++ )
{ {
for ( unsigned int k = 1 ; k < MAX_NIC+1 ; k++) for ( unsigned int k = 1 ; k < MaxNicID+1 ; k++)
{ {
string ModuleIPAddr = "ModuleIPAddr" + oam.itoa(j+1) + "-" + oam.itoa(k) + "-" + oam.itoa(i+1); string ModuleIPAddr = "ModuleIPAddr" + oam.itoa(j+1) + "-" + oam.itoa(k) + "-" + oam.itoa(i+1);
if ( !(sysConfig->getConfig(ModuleSection, ModuleIPAddr).empty()) ) { if ( !(sysConfig->getConfig(ModuleSection, ModuleIPAddr).empty()) ) {
@@ -1594,36 +1846,65 @@ int main(int argc, char *argv[])
moduleDisableState = oam::ENABLEDSTATE; moduleDisableState = oam::ENABLEDSTATE;
//setup HostName/IPAddress for each NIC //setup HostName/IPAddress for each NIC
for( unsigned int nicID=1 ; nicID < MAX_NIC+1 ; nicID++ )
string moduleHostName = oam::UnassignedName;
string moduleIPAddr = oam::UnassignedIpAddr;
bool found = false;
if (multi_server_quick_install)
{ {
string moduleHostName = oam::UnassignedName; ModuleIpList::iterator pt2 = InputModuleIPList.begin();
string moduleIPAddr = oam::UnassignedIpAddr; for( ; pt2 != InputModuleIPList.end() ; pt2++)
DeviceNetworkList::iterator listPT = sysModuleTypeConfig.moduletypeconfig[i].ModuleNetworkList.begin();
for( ; listPT != sysModuleTypeConfig.moduletypeconfig[i].ModuleNetworkList.end() ; listPT++)
{ {
if (newModuleName == (*listPT).DeviceName) { if ( (*pt2).moduleName == newModuleName )
if ( nicID == 1 ) { {
moduleDisableState = (*listPT).DisableState; moduleHostName = (*pt2).IPaddress;
if ( moduleDisableState.empty() || moduleIPAddr = (*pt2).IPaddress;
moduleDisableState == oam::UnassignedName || found = true;
moduleDisableState == oam::AUTODISABLEDSTATE ) break;
moduleDisableState = oam::ENABLEDSTATE; }
} }
}
HostConfigList::iterator pt1 = (*listPT).hostConfigList.begin();
for( ; pt1 != (*listPT).hostConfigList.end() ; pt1++) unsigned int nicID=1;
for( ; nicID < MaxNicID +1 ; nicID++ )
{
if ( !found )
{
moduleHostName = oam::UnassignedName;
moduleIPAddr = oam::UnassignedIpAddr;
DeviceNetworkList::iterator listPT = sysModuleTypeConfig.moduletypeconfig[i].ModuleNetworkList.begin();
for( ; listPT != sysModuleTypeConfig.moduletypeconfig[i].ModuleNetworkList.end() ; listPT++)
{
if (newModuleName == (*listPT).DeviceName)
{ {
if ((*pt1).NicID == nicID) { if ( nicID == 1 )
moduleHostName = (*pt1).HostName; {
moduleIPAddr = (*pt1).IPAddr; moduleDisableState = (*listPT).DisableState;
break; if ( moduleDisableState.empty() ||
moduleDisableState == oam::UnassignedName ||
moduleDisableState == oam::AUTODISABLEDSTATE )
moduleDisableState = oam::ENABLEDSTATE;
{
HostConfigList::iterator pt1 = (*listPT).hostConfigList.begin();
for( ; pt1 != (*listPT).hostConfigList.end() ; pt1++)
{
if ((*pt1).NicID == nicID)
{
moduleHostName = (*pt1).HostName;
moduleIPAddr = (*pt1).IPAddr;
break;
}
}
}
} }
} }
} }
} }
if ( nicID == 1 ) { if ( nicID == 1 )
{
if ( moduleDisableState != oam::ENABLEDSTATE ) { if ( moduleDisableState != oam::ENABLEDSTATE ) {
string disabled = "y"; string disabled = "y";
while (true) while (true)
@@ -1705,6 +1986,7 @@ int main(int argc, char *argv[])
break; break;
} }
bool moduleHostNameFound = true; bool moduleHostNameFound = true;
if (moduleHostName.empty()) { if (moduleHostName.empty()) {
moduleHostNameFound = true; moduleHostNameFound = true;
@@ -1744,23 +2026,25 @@ int main(int argc, char *argv[])
//check if need to create instance or user enter ID //check if need to create instance or user enter ID
string create = "y"; string create = "y";
while(true) if ( !amazon_quick_install )
{ {
pcommand = callReadline("Create Instance for " + newModuleName + " [y,n] (y) > "); while(true)
if (pcommand)
{ {
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
cout << "Invalid Entry, please enter 'y' for yes or 'n' for no" << endl;
create = "y";
if ( noPrompting )
exit(1);
} }
if ( create == "y" ) { if ( create == "y" ) {
ModuleIP moduleip; ModuleIP moduleip;
@@ -2313,28 +2597,35 @@ int main(int argc, char *argv[])
string dbrootList; string dbrootList;
for ( unsigned int id = 1 ; id < count+1 ; ) if (multi_server_quick_install || amazon_quick_install)
{ {
string moduledbrootid = "ModuleDBRootID" + oam.itoa(moduleID) + "-" + oam.itoa(id) + "-" + oam.itoa(i+1); dbrootList = oam.itoa(moduleID);
try { }
string dbrootid = sysConfig->getConfig(ModuleSection, moduledbrootid); else
{
for ( unsigned int id = 1 ; id < count+1 ; )
{
string moduledbrootid = "ModuleDBRootID" + oam.itoa(moduleID) + "-" + oam.itoa(id) + "-" + oam.itoa(i+1);
try {
string dbrootid = sysConfig->getConfig(ModuleSection, moduledbrootid);
if ( dbrootid != oam::UnassignedName) { if ( dbrootid != oam::UnassignedName) {
sysConfig->setConfig(ModuleSection, moduledbrootid, oam::UnassignedName); sysConfig->setConfig(ModuleSection, moduledbrootid, oam::UnassignedName);
dbrootList = dbrootList + dbrootid; dbrootList = dbrootList + dbrootid;
id ++; id ++;
if ( id < count+1 ) if ( id < count+1 )
dbrootList = dbrootList + ","; dbrootList = dbrootList + ",";
}
}
catch(...)
{
cout << "ERROR: Problem setting DBRoot ID in the MariaDB ColumnStore System Configuration file" << endl;
exit(1);
} }
} }
catch(...)
{
cout << "ERROR: Problem setting DBRoot ID in the MariaDB ColumnStore System Configuration file" << endl;
exit(1);
}
} }
vector <string> dbroots; vector <string> dbroots;
string tempdbrootList; string tempdbrootList;
@@ -3417,12 +3708,25 @@ bool checkSaveConfigFile()
//check if Columnstore.xml.rpmsave exist //check if Columnstore.xml.rpmsave exist
ifstream File (oldFileName.c_str()); ifstream File (oldFileName.c_str());
if (!File) { if (!File) {
if (single_server_quick_install || multi_server_quick_install || amazon_quick_install)
{
return true;
}
if ( noPrompting ) { if ( noPrompting ) {
cout << endl << "Old Config File not found '" + oldFileName + "', exiting" << endl; cout << endl << "Old Config File not found '" + oldFileName + "', exiting" << endl;
exit(1); exit(1);
} }
return true; return true;
} }
else
{
if (single_server_quick_install || multi_server_quick_install || amazon_quick_install)
{
cout << endl << "Quick Install is for fresh installs only, '" + oldFileName + "' exist, exiting" << endl;
exit(1);
}
}
File.close(); File.close();
// If 'oldFileName' isn't configured, exit // If 'oldFileName' isn't configured, exit
@@ -4837,7 +5141,7 @@ bool storageSetup(bool amazonInstall)
} }
void setSystemName(bool single_server_quick_install) void setSystemName()
{ {
Oam oam; Oam oam;
//setup System Name //setup System Name
@@ -4856,7 +5160,7 @@ void setSystemName(bool single_server_quick_install)
if ( systemName.empty() ) if ( systemName.empty() )
systemName = "columnstore-1"; systemName = "columnstore-1";
if (!single_server_quick_install) if (!single_server_quick_install || !multi_server_quick_install)
{ {
prompt = "Enter System Name (" + systemName + ") > "; prompt = "Enter System Name (" + systemName + ") > ";
pcommand = callReadline(prompt.c_str()); pcommand = callReadline(prompt.c_str());

View File

@@ -0,0 +1,81 @@
#!/bin/bash
#
# $Id: quick_installer_amazon.sh 3705 2018-07-07 19:47:20Z dhill $
#
# Poddst- Quick Installer for Amazon MariaDB Columnstore
pmCount=""
umCount=""
systemName=""
for arg in "$@"; do
if [ `expr -- "$arg" : '--pm-count='` -eq 11 ]; then
pmCount="`echo $arg | awk -F= '{print $2}'`"
elif [ `expr -- "$arg" : '--um-count='` -eq 11 ]; then
umCount="`echo $arg | awk -F= '{print $2}'`"
elif [ `expr -- "$arg" : '--system-name='` -eq 14 ]; then
systemName="`echo $arg | awk -F= '{print $2}'`"
systemName="-sn "$systemName
elif [ `expr -- "$arg" : '--dist-install'` -eq 14 ]; then
nonDistrubutedInstall=" "
elif [ `expr -- "$arg" : '--help'` -eq 6 ]; then
echo "Usage ./quick_installer_amazon.sh [OPTION]"
echo ""
echo "Quick Installer for an Amazon MariaDB ColumnStore Install"
echo "This requires to be run on a MariaDB ColumnStore AMI"
echo ""
echo "Performace Module (pm) number is required"
echo "User Module (um) number is option"
echo "When only pm counts provided, system is combined setup"
echo "When both pm/um counts provided, system is seperate setup"
echo
echo "--pm-count=x Number of pm instances to create"
echo "--um-count=x Number of um instances to create, optional"
echo "--system-name=nnnn System Name, optional"
echo ""
exit 1
else
echo "./quick_installer_amazon.sh: unknown argument: $arg, enter --help for help" 1>&2
exit 1
fi
done
if [[ $pmCount = "" ]]; then
echo ""
echo "Performace Module (pm) count is required, exiting"
exit 1
else
if [[ $umCount = "" ]]; then
echo ""
echo "NOTE: Performing a Multi-Server Combined install with um/pm running on some server"
echo""
else
echo ""
echo "NOTE: Performing a Multi-Server Seperate install with um and pm running on seperate servers"
echo""
fi
fi
if [[ $HOME = "/root" ]]; then
echo "${bold}Run post-install script${normal}"
echo ""
/usr/local/mariadb/columnstore/bin/post-install
echo "${bold}Run postConfigure script${normal}"
echo ""
if [[ $umCount = "" ]]; then
/usr/local/mariadb/columnstore/bin/postConfigure -qa -pm-count $pmCount $systemName
else
/usr/local/mariadb/columnstore/bin/postConfigure -qa -pm-count $pmCount -um-count $umCount $systemName
fi
else
echo "${bold}Run post-install script${normal}"
echo ""
$HOME/mariadb/columnstore/bin/post-install --installdir=$HOME/mariadb/columnstore
echo "${bold}Run postConfigure script${normal}"
echo ""
if [[ $umCount = "" ]]; then
$HOME/mariadb/columnstore/bin/postConfigure -i $HOME/mariadb/columnstore -qa -pm-count $pmCount $systemName
else
$HOME/mariadb/columnstore/bin/postConfigure -i $HOME/mariadb/columnstore -qa -pm-count $pmCount -um-count $umCount $systemName
fi
fi

View File

@@ -0,0 +1,85 @@
#!/bin/bash
#
# $Id: quick_installer_multi_server.sh 3705 2018-07-07 19:47:20Z dhill $
#
# Poddst- Quick Installer for Multi Server MariaDB Columnstore
pmIpAddrs=""
umIpAddrs=""
nonDistrubutedInstall="-n"
systemName=""
for arg in "$@"; do
if [ `expr -- "$arg" : '--pm-ip-addresses='` -eq 18 ]; then
pmIpAddrs="`echo $arg | awk -F= '{print $2}'`"
elif [ `expr -- "$arg" : '--um-ip-addresses='` -eq 18 ]; then
umIpAddrs="`echo $arg | awk -F= '{print $2}'`"
elif [ `expr -- "$arg" : '--system-name='` -eq 14 ]; then
systemName="`echo $arg | awk -F= '{print $2}'`"
systemName="-sn "$systemName
elif [ `expr -- "$arg" : '--dist-install'` -eq 14 ]; then
nonDistrubutedInstall=" "
elif [ `expr -- "$arg" : '--help'` -eq 6 ]; then
echo "Usage ./quick_installer_multi_server.sh [OPTION]"
echo ""
echo "Quick Installer for a Multi Server MariaDB ColumnStore Install"
echo ""
echo "Defaults to non-distrubuted install, meaning MariaDB Columnstore"
echo "needs to be preinstalled on all nodes in the system"
echo ""
echo "Performace Module (pm) IP addresses are required"
echo "User Module (um) IP addresses are option"
echo "When only pm IP addresses provided, system is combined setup"
echo "When both pm/um IP addresses provided, system is seperate setup"
echo
echo "--pm-ip-addresses=xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx"
echo "--um-ip-addresses=xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx, optional"
echo "--dist-install Use Distributed Install, optional"
echo "--system-name=nnnn System Name, optional"
echo ""
exit 1
else
echo "quick_installer_multi_server.sh: unknown argument: $arg, enter --help for help" 1>&2
exit 1
fi
done
if [[ $pmIpAddrs = "" ]]; then
echo ""
echo "Performace Module (pm) IP addresses required, exiting"
exit 1
else
if [[ $umIpAddrs = "" ]]; then
echo ""
echo "NOTE: Performing a Multi-Server Combined install with um/pm running on some server"
echo""
else
echo ""
echo "NOTE: Performing a Multi-Server Seperate install with um and pm running on seperate servers"
echo""
fi
fi
if [[ $HOME = "/root" ]]; then
echo "${bold}Run post-install script${normal}"
echo ""
/usr/local/mariadb/columnstore/bin/post-install
echo "${bold}Run postConfigure script${normal}"
echo ""
if [[ $umIpAddrs = "" ]]; then
/usr/local/mariadb/columnstore/bin/postConfigure -qm -pm-ip-addrs $pmIpAddrs $nonDistrubutedInstall $systemName
else
/usr/local/mariadb/columnstore/bin/postConfigure -qm -pm-ip-addrs $pmIpAddrs -um-ip-addrs $umIpAddrs $nonDistrubutedInstall $systemName
fi
else
echo "${bold}Run post-install script${normal}"
echo ""
$HOME/mariadb/columnstore/bin/post-install --installdir=$HOME/mariadb/columnstore
echo "${bold}Run postConfigure script${normal}"
echo ""
if [[ $umIpAddrs = "" ]]; then
$HOME/mariadb/columnstore/bin/postConfigure -i $HOME/mariadb/columnstore -qm -pm-ip-addrs $pmIpAddrs $nonDistrubutedInstall $systemName
else
$HOME/mariadb/columnstore/bin/postConfigure -i $HOME/mariadb/columnstore -qm -pm-ip-addrs $pmIpAddrs -um-ip-addrs $umIpAddrs $nonDistrubutedInstall $systemName
fi
fi

14
oamapps/postConfigure/quick_installer_single_server.sh Normal file → Executable file
View File

@@ -4,6 +4,18 @@
# #
# Poddst- Quick Installer for Single Server MariaDB Columnstore # Poddst- Quick Installer for Single Server MariaDB Columnstore
for arg in "$@"; do
if [ `expr -- "$arg" : '--help'` -eq 6 ]; then
echo "Usage ./quick_installer_multi_server.sh"
echo ""
echo "Quick Installer for a Single Server MariaDB ColumnStore Install"
echo ""
exit 1
else
echo "quick_installer_multi_server.sh: ignoring unknown argument: $arg" 1>&2
fi
done
if [ $HOME == "/root" ]; then if [ $HOME == "/root" ]; then
echo "Run post-install script" echo "Run post-install script"
@@ -18,5 +30,5 @@ else
$HOME/mariadb/columnstore/bin/post-install --installdir=$HOME/mariadb/columnstore $HOME/mariadb/columnstore/bin/post-install --installdir=$HOME/mariadb/columnstore
echo "Run postConfigure script" echo "Run postConfigure script"
echo "" echo ""
$HOME/mariadb/columnstore/bin/postConfigure -i $HOME/mariadb/columnstore -sq $HOME/mariadb/columnstore/bin/postConfigure -i $HOME/mariadb/columnstore -qs
fi fi