You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-11-03 17:13:17 +03:00
Add new command line option '-m' to postConfigure. Makes packages management by postConfigure optional
This commit is contained in:
@@ -172,6 +172,7 @@ bool amazonInstall = false;
|
|||||||
|
|
||||||
string DataFileEnvFile;
|
string DataFileEnvFile;
|
||||||
|
|
||||||
|
string managePackages;
|
||||||
string installDir;
|
string installDir;
|
||||||
string HOME = "/root";
|
string HOME = "/root";
|
||||||
|
|
||||||
@@ -210,6 +211,7 @@ int main(int argc, char *argv[])
|
|||||||
// -o to prompt for process to start offline
|
// -o to prompt for process to start offline
|
||||||
|
|
||||||
//default
|
//default
|
||||||
|
managePackages = "0";
|
||||||
installDir = installDir + "";
|
installDir = installDir + "";
|
||||||
//see if we can determine our own location
|
//see if we can determine our own location
|
||||||
ostringstream oss;
|
ostringstream oss;
|
||||||
@@ -279,6 +281,7 @@ int main(int argc, char *argv[])
|
|||||||
cout << " -s Single Threaded Remote Install" << endl;
|
cout << " -s Single Threaded Remote Install" << 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 << " -m When specified, postConfigure won't try to deploy, install or uninstall packages" << endl;
|
||||||
exit (0);
|
exit (0);
|
||||||
}
|
}
|
||||||
else if( string("-s") == argv[i] )
|
else if( string("-s") == argv[i] )
|
||||||
@@ -337,10 +340,13 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
installDir = argv[i];
|
installDir = argv[i];
|
||||||
}
|
}
|
||||||
|
else if( string("-m") == argv[i] ) {
|
||||||
|
managePackages = "0";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cout << " ERROR: Invalid Argument = " << argv[i] << endl;
|
cout << " ERROR: Invalid Argument = " << argv[i] << endl;
|
||||||
cout << " Usage: postConfigure [-h][-c][-u][-p][-s][-port][-i]" << endl;
|
cout << " Usage: postConfigure [-h][-c][-m][-u][-p][-s][-port][-i]" << endl;
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2670,112 +2676,115 @@ int main(int argc, char *argv[])
|
|||||||
else //nonroot, default to binary
|
else //nonroot, default to binary
|
||||||
EEPackageType = "binary";
|
EEPackageType = "binary";
|
||||||
|
|
||||||
while(true) {
|
string version = systemsoftware.Version + "-" + systemsoftware.Release;
|
||||||
prompt = "Enter the Package Type being installed to other servers [rpm,deb,binary] (" + EEPackageType + ") > ";
|
if ( managePackages == "1")
|
||||||
pcommand = callReadline(prompt);
|
{
|
||||||
if (pcommand) {
|
while(true) {
|
||||||
if (strlen(pcommand) > 0) EEPackageType = pcommand;
|
prompt = "Enter the Package Type being installed to other servers [rpm,deb,binary] (" + EEPackageType + ") > ";
|
||||||
callFree(pcommand);
|
pcommand = callReadline(prompt);
|
||||||
|
if (pcommand) {
|
||||||
|
if (strlen(pcommand) > 0) EEPackageType = pcommand;
|
||||||
|
callFree(pcommand);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( EEPackageType == "rpm" || EEPackageType == "deb" || EEPackageType == "binary" ) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
cout << "Invalid Package Type, please re-enter" << endl;
|
||||||
|
EEPackageType = "rpm";
|
||||||
|
if ( noPrompting )
|
||||||
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( EEPackageType == "rpm" || EEPackageType == "deb" || EEPackageType == "binary" ) {
|
if ( EEPackageType == "rpm" )
|
||||||
break;
|
|
||||||
}
|
|
||||||
cout << "Invalid Package Type, please re-enter" << endl;
|
|
||||||
EEPackageType = "rpm";
|
|
||||||
if ( noPrompting )
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( EEPackageType == "rpm" )
|
|
||||||
{
|
|
||||||
cout << "Performing an MariaDB ColumnStore System install using RPM packages" << endl;
|
|
||||||
cout << "located in the " + HOME + " directory." << endl << endl;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( EEPackageType == "binary" )
|
|
||||||
{
|
{
|
||||||
cout << "Performing an MariaDB ColumnStore System install using a Binary package" << endl;
|
cout << "Performing an MariaDB ColumnStore System install using RPM packages" << endl;
|
||||||
cout << "located in the " + HOME + " directory." << endl << endl;
|
cout << "located in the " + HOME + " directory." << endl << endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cout << "Performing an MariaDB ColumnStore System install using using DEB packages" << endl;
|
if ( EEPackageType == "binary" )
|
||||||
cout << "located in the " + HOME + " directory." << endl;
|
{
|
||||||
|
cout << "Performing an MariaDB ColumnStore System install using a Binary package" << endl;
|
||||||
|
cout << "located in the " + HOME + " directory." << endl << endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cout << "Performing an MariaDB ColumnStore System install using using DEB packages" << endl;
|
||||||
|
cout << "located in the " + HOME + " directory." << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//Write out Updated System Configuration File
|
//Write out Updated System Configuration File
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !writeConfig(sysConfig) ) {
|
|
||||||
cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl;
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
//check if pkgs are located in $HOME directory
|
|
||||||
string version = systemsoftware.Version + "-" + systemsoftware.Release;
|
|
||||||
if ( EEPackageType != "binary") {
|
|
||||||
string separator = "-";
|
|
||||||
calpontPackage1 = "mariadb-columnstore-*" + separator + version;
|
|
||||||
//calpontPackage2 = "mariadb-columnstore-libs" + separator + version;
|
|
||||||
//calpontPackage3 = "mariadb-columnstore-enterprise" + separator + version;
|
|
||||||
//mysqlPackage = "mariadb-columnstore-storage-engine" + separator + version;
|
|
||||||
//mysqldPackage = "mariadb-columnstore-mysql" + separator + version;
|
|
||||||
|
|
||||||
if( !pkgCheck() ) {
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !writeConfig(sysConfig) ) {
|
||||||
|
cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl;
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//check if pkgs are located in $HOME directory
|
||||||
|
if ( EEPackageType != "binary") {
|
||||||
|
string separator = "-";
|
||||||
|
calpontPackage1 = "mariadb-columnstore-*" + separator + version;
|
||||||
|
//calpontPackage2 = "mariadb-columnstore-libs" + separator + version;
|
||||||
|
//calpontPackage3 = "mariadb-columnstore-enterprise" + separator + version;
|
||||||
|
//mysqlPackage = "mariadb-columnstore-storage-engine" + separator + version;
|
||||||
|
//mysqldPackage = "mariadb-columnstore-mysql" + separator + version;
|
||||||
|
|
||||||
|
if( !pkgCheck() ) {
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//mariadb
|
||||||
|
calpontPackage1 = "mariadb-columnstore-*" + separator + version;
|
||||||
|
|
||||||
|
calpontPackage1 = HOME + "/" + calpontPackage1 + "*." + EEPackageType;
|
||||||
|
//calpontPackage2 = HOME + "/" + calpontPackage2 + "*." + EEPackageType;
|
||||||
|
//calpontPackage3 = HOME + "/" + calpontPackage3 + "*." + EEPackageType;
|
||||||
|
//mysqlPackage = HOME + "/" + mysqlPackage + "*." + EEPackageType;
|
||||||
|
//mysqldPackage = HOME + "/" + mysqldPackage + "*." + EEPackageType;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//mariadb
|
// binary
|
||||||
calpontPackage1 = "mariadb-columnstore-*" + separator + version;
|
//string fileName = installDir + "/bin/healthcheck";
|
||||||
|
//ifstream file (fileName.c_str());
|
||||||
|
//if (!file) // CE
|
||||||
|
calpontPackage1 = "mariadb-columnstore-" + version;
|
||||||
|
//else // EE
|
||||||
|
//calpontPackage1 = "mariadb-columnstore-ent-" + version;
|
||||||
|
//calpontPackage2 = "dummy";
|
||||||
|
//calpontPackage3 = "dummy";
|
||||||
|
//mysqlPackage = calpontPackage1;
|
||||||
|
//mysqldPackage = calpontPackage1;
|
||||||
|
|
||||||
calpontPackage1 = HOME + "/" + calpontPackage1 + "*." + EEPackageType;
|
if( !pkgCheck() )
|
||||||
//calpontPackage2 = HOME + "/" + calpontPackage2 + "*." + EEPackageType;
|
exit(1);
|
||||||
//calpontPackage3 = HOME + "/" + calpontPackage3 + "*." + EEPackageType;
|
calpontPackage1 = HOME + "/" + calpontPackage1 + "*.bin.tar.gz";
|
||||||
//mysqlPackage = HOME + "/" + mysqlPackage + "*." + EEPackageType;
|
//calpontPackage2 = "dummy";
|
||||||
//mysqldPackage = HOME + "/" + mysqldPackage + "*." + EEPackageType;
|
//calpontPackage3 = "dummy";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// binary
|
|
||||||
//string fileName = installDir + "/bin/healthcheck";
|
|
||||||
//ifstream file (fileName.c_str());
|
|
||||||
//if (!file) // CE
|
|
||||||
calpontPackage1 = "mariadb-columnstore-" + version;
|
|
||||||
//else // EE
|
|
||||||
//calpontPackage1 = "mariadb-columnstore-ent-" + version;
|
|
||||||
//calpontPackage2 = "dummy";
|
|
||||||
//calpontPackage3 = "dummy";
|
|
||||||
//mysqlPackage = calpontPackage1;
|
|
||||||
//mysqldPackage = calpontPackage1;
|
|
||||||
|
|
||||||
if( !pkgCheck() )
|
//If ent pkg is not there, mark it as such
|
||||||
exit(1);
|
//{
|
||||||
calpontPackage1 = HOME + "/" + calpontPackage1 + "*.bin.tar.gz";
|
// glob_t gt;
|
||||||
//calpontPackage2 = "dummy";
|
// memset(>, 0, sizeof(gt));
|
||||||
//calpontPackage3 = "dummy";
|
// if (glob(calpontPackage3.c_str(), 0, 0, >) != 0)
|
||||||
|
// calpontPackage3 = "dummy.rpm";
|
||||||
|
// globfree(>);
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
//If ent pkg is not there, mark it as such
|
|
||||||
//{
|
|
||||||
// glob_t gt;
|
|
||||||
// memset(>, 0, sizeof(gt));
|
|
||||||
// if (glob(calpontPackage3.c_str(), 0, 0, >) != 0)
|
|
||||||
// calpontPackage3 = "dummy.rpm";
|
|
||||||
// globfree(>);
|
|
||||||
//}
|
|
||||||
|
|
||||||
if ( password.empty() )
|
if ( password.empty() )
|
||||||
{
|
{
|
||||||
cout << endl;
|
cout << endl;
|
||||||
@@ -2874,7 +2883,7 @@ int main(int argc, char *argv[])
|
|||||||
temppwprompt = "none";
|
temppwprompt = "none";
|
||||||
|
|
||||||
//run remote installer script
|
//run remote installer script
|
||||||
cmd = installDir + "/bin/user_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + version + " initial " + EEPackageType + " " + nodeps + " " + temppwprompt + " " + mysqlPort + " " + remote_installer_debug + " " + debug_logfile;
|
cmd = installDir + "/bin/user_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + version + " initial " + EEPackageType + " " + nodeps + " " + temppwprompt + " " + mysqlPort + " " + remote_installer_debug + " " + debug_logfile + " " + managePackages;
|
||||||
|
|
||||||
//cout << cmd << endl;
|
//cout << cmd << endl;
|
||||||
if ( thread_remote_installer ) {
|
if ( thread_remote_installer ) {
|
||||||
@@ -2987,7 +2996,7 @@ int main(int argc, char *argv[])
|
|||||||
cmd = installDir + "/bin/binary_installer.sh " + remoteModuleName + " " +
|
cmd = installDir + "/bin/binary_installer.sh " + remoteModuleName + " " +
|
||||||
remoteModuleIP + " " + password + " " + calpontPackage1 + " " + remoteModuleType +
|
remoteModuleIP + " " + password + " " + calpontPackage1 + " " + remoteModuleType +
|
||||||
" initial " + binservertype + " " + mysqlPort + " " + remote_installer_debug +
|
" initial " + binservertype + " " + mysqlPort + " " + remote_installer_debug +
|
||||||
" " + installDir + " " + debug_logfile;
|
" " + installDir + " " + debug_logfile + " " + managePackages;
|
||||||
|
|
||||||
if ( thread_remote_installer ) {
|
if ( thread_remote_installer ) {
|
||||||
thr_data[thread_id].command = cmd;
|
thr_data[thread_id].command = cmd;
|
||||||
@@ -3024,7 +3033,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if ( EEPackageType != "binary" ) {
|
if ( EEPackageType != "binary" ) {
|
||||||
//run remote installer script
|
//run remote installer script
|
||||||
cmd = installDir + "/bin/performance_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + version + " initial " + EEPackageType + " " + nodeps + " " + remote_installer_debug + " " + debug_logfile;
|
cmd = installDir + "/bin/performance_installer.sh " + remoteModuleName + " " + remoteModuleIP + " " + password + " " + version + " initial " + EEPackageType + " " + nodeps + " " + remote_installer_debug + " " + debug_logfile + " " + managePackages;
|
||||||
|
|
||||||
//cout << cmd << endl;
|
//cout << cmd << endl;
|
||||||
if ( thread_remote_installer ) {
|
if ( thread_remote_installer ) {
|
||||||
@@ -3057,7 +3066,7 @@ int main(int argc, char *argv[])
|
|||||||
cmd = installDir + "/bin/binary_installer.sh " + remoteModuleName + " " + remoteModuleIP +
|
cmd = installDir + "/bin/binary_installer.sh " + remoteModuleName + " " + remoteModuleIP +
|
||||||
" " + password + " " + calpontPackage1 + " " + remoteModuleType + " initial " +
|
" " + password + " " + calpontPackage1 + " " + remoteModuleType + " initial " +
|
||||||
binservertype + " " + mysqlPort + " " + remote_installer_debug + " " + installDir + " " +
|
binservertype + " " + mysqlPort + " " + remote_installer_debug + " " + installDir + " " +
|
||||||
debug_logfile;
|
debug_logfile + " " + managePackages;
|
||||||
|
|
||||||
if ( thread_remote_installer ) {
|
if ( thread_remote_installer ) {
|
||||||
thr_data[thread_id].command = cmd;
|
thr_data[thread_id].command = cmd;
|
||||||
|
|||||||
Reference in New Issue
Block a user