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 managePackages;
 | 
			
		||||
string installDir;
 | 
			
		||||
string HOME = "/root";
 | 
			
		||||
 | 
			
		||||
@@ -210,6 +211,7 @@ int main(int argc, char *argv[])
 | 
			
		||||
	// -o to prompt for process to start offline
 | 
			
		||||
 | 
			
		||||
	//default
 | 
			
		||||
	managePackages = "0";
 | 
			
		||||
	installDir = installDir + "";
 | 
			
		||||
	//see if we can determine our own location
 | 
			
		||||
	ostringstream oss;
 | 
			
		||||
@@ -279,6 +281,7 @@ int main(int argc, char *argv[])
 | 
			
		||||
			cout << "   -s  Single Threaded Remote Install" << endl;
 | 
			
		||||
			cout << "   -port MariaDB ColumnStore Port Address" << 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);
 | 
			
		||||
		}
 | 
			
		||||
      		else if( string("-s") == argv[i] )
 | 
			
		||||
@@ -337,10 +340,13 @@ int main(int argc, char *argv[])
 | 
			
		||||
            }
 | 
			
		||||
            installDir = argv[i];
 | 
			
		||||
        }
 | 
			
		||||
		else if( string("-m") == argv[i] ) {
 | 
			
		||||
			managePackages = "0";
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
			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);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
@@ -2670,112 +2676,115 @@ int main(int argc, char *argv[])
 | 
			
		||||
			else	//nonroot, default to binary
 | 
			
		||||
				EEPackageType = "binary";
 | 
			
		||||
 | 
			
		||||
			while(true) {
 | 
			
		||||
				prompt = "Enter the Package Type being installed to other servers [rpm,deb,binary] (" + EEPackageType + ") > ";
 | 
			
		||||
				pcommand = callReadline(prompt);
 | 
			
		||||
				if (pcommand) {
 | 
			
		||||
					if (strlen(pcommand) > 0) EEPackageType = pcommand;
 | 
			
		||||
					callFree(pcommand);
 | 
			
		||||
			string version = systemsoftware.Version + "-" + systemsoftware.Release;
 | 
			
		||||
			if ( managePackages == "1")
 | 
			
		||||
			{
 | 
			
		||||
				while(true) {
 | 
			
		||||
					prompt = "Enter the Package Type being installed to other servers [rpm,deb,binary] (" + EEPackageType + ") > ";
 | 
			
		||||
					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"  ) {
 | 
			
		||||
					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" )
 | 
			
		||||
				if ( EEPackageType == "rpm" )
 | 
			
		||||
				{
 | 
			
		||||
					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;
 | 
			
		||||
				}
 | 
			
		||||
				else
 | 
			
		||||
				{
 | 
			
		||||
					cout << "Performing an MariaDB ColumnStore System install using using DEB packages" << endl;
 | 
			
		||||
					cout << "located in the " + HOME + " directory." << endl;
 | 
			
		||||
					if ( EEPackageType == "binary" )
 | 
			
		||||
					{
 | 
			
		||||
						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
 | 
			
		||||
			try {
 | 
			
		||||
				sysConfig->setConfig(InstallSection, "EEPackageType", EEPackageType);
 | 
			
		||||
			}
 | 
			
		||||
			catch(...)
 | 
			
		||||
			{
 | 
			
		||||
				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() ) {
 | 
			
		||||
				//Write out Updated System Configuration File
 | 
			
		||||
				try {
 | 
			
		||||
					sysConfig->setConfig(InstallSection, "EEPackageType", EEPackageType);
 | 
			
		||||
				}
 | 
			
		||||
				catch(...)
 | 
			
		||||
				{
 | 
			
		||||
					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
 | 
			
		||||
				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
 | 
			
		||||
				{
 | 
			
		||||
				//mariadb
 | 
			
		||||
					calpontPackage1 = "mariadb-columnstore-*" + separator + version;
 | 
			
		||||
					// 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;
 | 
			
		||||
 | 
			
		||||
					calpontPackage1 = HOME + "/" + calpontPackage1 + "*." + EEPackageType;
 | 
			
		||||
					//calpontPackage2 = HOME + "/" + calpontPackage2 + "*." + EEPackageType;
 | 
			
		||||
					//calpontPackage3 = HOME + "/" + calpontPackage3 + "*." + EEPackageType;
 | 
			
		||||
					//mysqlPackage = HOME + "/" + mysqlPackage  + "*." + EEPackageType;
 | 
			
		||||
					//mysqldPackage = HOME + "/" + mysqldPackage  + "*." + EEPackageType;
 | 
			
		||||
					if( !pkgCheck() )
 | 
			
		||||
						exit(1);
 | 
			
		||||
					calpontPackage1 = HOME + "/" + calpontPackage1 + "*.bin.tar.gz";
 | 
			
		||||
					//calpontPackage2 = "dummy";
 | 
			
		||||
					//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() )
 | 
			
		||||
					exit(1);
 | 
			
		||||
				calpontPackage1 = HOME + "/" + calpontPackage1 + "*.bin.tar.gz";
 | 
			
		||||
				//calpontPackage2 = "dummy";
 | 
			
		||||
				//calpontPackage3 = "dummy";
 | 
			
		||||
				//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 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() )
 | 
			
		||||
			{
 | 
			
		||||
				cout << endl;
 | 
			
		||||
@@ -2874,7 +2883,7 @@ int main(int argc, char *argv[])
 | 
			
		||||
							temppwprompt = "none";
 | 
			
		||||
 | 
			
		||||
						//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;
 | 
			
		||||
						if ( thread_remote_installer ) {
 | 
			
		||||
@@ -2987,7 +2996,7 @@ int main(int argc, char *argv[])
 | 
			
		||||
						cmd = installDir + "/bin/binary_installer.sh " + remoteModuleName + " " +
 | 
			
		||||
							remoteModuleIP + " " + password + " " + calpontPackage1 + " " + remoteModuleType +
 | 
			
		||||
							" initial " + binservertype + " " + mysqlPort + " " + remote_installer_debug +
 | 
			
		||||
							" " + installDir + " " + debug_logfile;
 | 
			
		||||
							" " + installDir + " " + debug_logfile + " " + managePackages;
 | 
			
		||||
 | 
			
		||||
						if ( thread_remote_installer ) {
 | 
			
		||||
							thr_data[thread_id].command = cmd;
 | 
			
		||||
@@ -3024,7 +3033,7 @@ int main(int argc, char *argv[])
 | 
			
		||||
 | 
			
		||||
						if ( EEPackageType != "binary" ) {
 | 
			
		||||
							//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;
 | 
			
		||||
							if ( thread_remote_installer ) {
 | 
			
		||||
@@ -3057,7 +3066,7 @@ int main(int argc, char *argv[])
 | 
			
		||||
							cmd = installDir + "/bin/binary_installer.sh " + remoteModuleName + " " + remoteModuleIP +
 | 
			
		||||
								" " + password + " " + calpontPackage1 + " " + remoteModuleType + " initial " +
 | 
			
		||||
								binservertype + " " + mysqlPort + " " + remote_installer_debug + " " + installDir + " " +
 | 
			
		||||
								debug_logfile;
 | 
			
		||||
								debug_logfile + " " + managePackages;
 | 
			
		||||
 | 
			
		||||
							if ( thread_remote_installer ) {
 | 
			
		||||
								thr_data[thread_id].command = cmd;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user