You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
tool changes for name changes
This commit is contained in:
@ -20,7 +20,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* List of files being updated by configure:
|
* List of files being updated by configure:
|
||||||
* Calpont/etc/Calpont.xml
|
* Calpont/etc" + installLocation + ".xml
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
******************************************************************************************/
|
******************************************************************************************/
|
||||||
@ -64,6 +64,11 @@ int main(int argc, char *argv[])
|
|||||||
string installDir = "/usr/local";
|
string installDir = "/usr/local";
|
||||||
string MySQLport= oam::UnassignedName;
|
string MySQLport= oam::UnassignedName;
|
||||||
string installPackageType = "";
|
string installPackageType = "";
|
||||||
|
string product = "columnstore";
|
||||||
|
string company = "MariaDB-Columnstore";
|
||||||
|
string calpontPackagename = "mariadb-columnstore";
|
||||||
|
string installLocation = "/MariaDB/Columnstore";
|
||||||
|
string adminCommand = "" + adminCommand + "";
|
||||||
|
|
||||||
char* pcommand = 0;
|
char* pcommand = 0;
|
||||||
string prompt;
|
string prompt;
|
||||||
@ -72,7 +77,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
int forceVer = -1;
|
int forceVer = -1;
|
||||||
|
|
||||||
Config* sysConfig = Config::makeConfig("./systems/CalpontSystems.xml");
|
Config* sysConfig = Config::makeConfig("./systems" + installLocation + "Systems.xml");
|
||||||
|
|
||||||
//gethostname to determine where to get the packages
|
//gethostname to determine where to get the packages
|
||||||
string SHARED = "//srvhill01/shared";
|
string SHARED = "//srvhill01/shared";
|
||||||
@ -96,16 +101,17 @@ int main(int argc, char *argv[])
|
|||||||
cout << "configuration of the 'Calpont.xml' located on the system being" << endl;
|
cout << "configuration of the 'Calpont.xml' located on the system being" << endl;
|
||||||
cout << "or can be passed as an argument into 'quickInstaller'." << endl;
|
cout << "or can be passed as an argument into 'quickInstaller'." << endl;
|
||||||
cout << endl;
|
cout << endl;
|
||||||
cout << "Usage: autoInstaller -s system [-h][-ce][-r release][-c configFile][-n][-d][-p package-type][-m mysql-password][-port mysql-port]" << endl;
|
cout << "Usage: autoInstaller -s system [-h][-ce][-r release][-c configFile][-n][-d][-p package-type][-m mysql-password][-port mysql-port][-pr product-name]" << endl;
|
||||||
cout << " -s system-name" << endl;
|
cout << " -s system-name" << endl;
|
||||||
cout << " -ce community-edition install" << endl;
|
cout << " -ce community-edition install" << endl;
|
||||||
cout << " -r release-number (optional, default to 'Latest')" << endl;
|
cout << " -r release-number (optional, default to 'Latest')" << endl;
|
||||||
cout << " -c InfiniDB Config File located in system-name directory (optional, default to system configuration)" << endl;
|
cout << " -c Config File located in system-name directory (optional, default to system configuration)" << endl;
|
||||||
cout << " -n No Prompt (Used for automated Installs)" << endl;
|
cout << " -n No Prompt (Used for automated Installs)" << endl;
|
||||||
cout << " -port System MySQL Port, if set" << endl;
|
cout << " -port System MySQL Port, if set" << endl;
|
||||||
cout << " -d Debug Flag" << endl;
|
cout << " -d Debug Flag" << endl;
|
||||||
cout << " -p Install Package Type (rpm or binary), defaults to " << sysConfig->configFile() << " setting" << endl;
|
cout << " -p Install Package Type (rpm or binary), defaults to " << sysConfig->configFile() << " setting" << endl;
|
||||||
cout << " -3 Force a version 3 install, defaults to autodetect" << endl;
|
cout << " -3 Force a version 3 install, defaults to autodetect" << endl;
|
||||||
|
cout << " -pr Product installing (infinidb or columnstore), defaults to columnstore" << endl;
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
else if( string("-s") == argv[i] ) {
|
else if( string("-s") == argv[i] ) {
|
||||||
@ -167,6 +173,14 @@ int main(int argc, char *argv[])
|
|||||||
else if( string("-3") == argv[i] ) {
|
else if( string("-3") == argv[i] ) {
|
||||||
forceVer = 3;
|
forceVer = 3;
|
||||||
}
|
}
|
||||||
|
else if( string("-pr") == argv[i] ) {
|
||||||
|
i++;
|
||||||
|
if ( argc == i ) {
|
||||||
|
cout << "ERROR: product name type argument" << endl;
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
product = argv[i];
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
cout << "ERROR: Unknown option: " << argv[i] << endl;
|
cout << "ERROR: Unknown option: " << argv[i] << endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
@ -175,10 +189,24 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (systemName.empty() ) {
|
if (systemName.empty() ) {
|
||||||
cout << endl;
|
cout << endl;
|
||||||
|
cout << "Missing system name" << endl;
|
||||||
cout << "Usage: autoInstaller -s system [-h][-ce][-r release][-c configFile][-n][-d][-p package-type][-m mysql-password][-port mysql-port]" << endl;
|
cout << "Usage: autoInstaller -s system [-h][-ce][-r release][-c configFile][-n][-d][-p package-type][-m mysql-password][-port mysql-port]" << endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( product == "infinidb" ) {
|
||||||
|
company = "InfiniDB";
|
||||||
|
calpontPackagename = "infinidb";
|
||||||
|
installLocation = "" + installLocation + "";
|
||||||
|
adminCommand = "calpontConsole";
|
||||||
|
}
|
||||||
|
else if ( product != "columnstore" )
|
||||||
|
{
|
||||||
|
cout << endl;
|
||||||
|
cout << "Invalid product name" << endl;
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
// get Parent OAM Module based on system name
|
// get Parent OAM Module based on system name
|
||||||
int systemCount;
|
int systemCount;
|
||||||
try {
|
try {
|
||||||
@ -249,8 +277,8 @@ int main(int argc, char *argv[])
|
|||||||
systemPackage = "*x86_64.bin.tar.gz";
|
systemPackage = "*x86_64.bin.tar.gz";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cout << "Invalid InfiniDB Package Type Arugument entered, use 'rpm' or 'binary' exiting" << endl;
|
cout << "Invalid " + company + " Package Type Arugument entered, use 'rpm' or 'binary' exiting" << endl;
|
||||||
cerr << "Invalid InfiniDB Package Type Arugument entered, use 'rpm' or 'binary' exiting" << endl;
|
cerr << "Invalid " + company + " Package Type Arugument entered, use 'rpm' or 'binary' exiting" << endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -263,9 +291,9 @@ int main(int argc, char *argv[])
|
|||||||
cout << endl;
|
cout << endl;
|
||||||
|
|
||||||
if ( systemPackage == "*.x86_64.rpm" )
|
if ( systemPackage == "*.x86_64.rpm" )
|
||||||
prompt = "Are you sure you want to install the '" + release + "' InfiniDB RPM on '" + systemName + "' ? (y,n,exit) > ";
|
prompt = "Are you sure you want to install the '" + release + "' " + company + " RPM on '" + systemName + "' ? (y,n,exit) > ";
|
||||||
else
|
else
|
||||||
prompt = "Are you sure you want to install the '" + release + "/packages' InfiniDB Binary Package on '" + systemName + "' ? (y,n,exit) > ";
|
prompt = "Are you sure you want to install the '" + release + "/packages' " + company + " Binary Package on '" + systemName + "' ? (y,n,exit) > ";
|
||||||
|
|
||||||
pcommand = readline(prompt.c_str());
|
pcommand = readline(prompt.c_str());
|
||||||
if (!pcommand)
|
if (!pcommand)
|
||||||
@ -310,7 +338,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
//remove all calpont packages from local /root/ directory, can interfere with install
|
//remove all calpont packages from local /root/ directory, can interfere with install
|
||||||
if (geteuid() == 0)
|
if (geteuid() == 0)
|
||||||
system("rm -f /root/calpont-*rpm /root/infinidb-*rpm");
|
system("rm -f /root" + installLocation + "-*rpm /root/infinidb-*rpm /root/mariadb-*rpm ");
|
||||||
|
|
||||||
string systemDir = "systems/" + systemName + "/";
|
string systemDir = "systems/" + systemName + "/";
|
||||||
|
|
||||||
@ -323,11 +351,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
int idbver = -1;
|
int idbver = -1;
|
||||||
string currentPrefix;
|
string currentPrefix;
|
||||||
string calpontPackagename;
|
|
||||||
string mysqlRPMname;
|
string mysqlRPMname;
|
||||||
|
|
||||||
//TODO: replace all the goofy file I/O with glob(3) or better yet just parse the output of samba 'dir' cmd
|
|
||||||
// and avoid all the wasted network I/O
|
|
||||||
if ( systemPackage == "*.x86_64.rpm" )
|
if ( systemPackage == "*.x86_64.rpm" )
|
||||||
{
|
{
|
||||||
//get rpm
|
//get rpm
|
||||||
@ -343,7 +368,7 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
//try to guess the release, v4+ takes precedence
|
//try to guess the release, v4+ takes precedence
|
||||||
string sentinel = systemDir + "infinidb-libs-*.rpm";
|
string sentinel = systemDir + "" + calpontPackagename + "-libs-*.rpm";
|
||||||
glob_t gt;
|
glob_t gt;
|
||||||
memset(>, 0, sizeof(gt));
|
memset(>, 0, sizeof(gt));
|
||||||
idbver = 3;
|
idbver = 3;
|
||||||
@ -352,7 +377,6 @@ int main(int argc, char *argv[])
|
|||||||
globfree(>);
|
globfree(>);
|
||||||
}
|
}
|
||||||
|
|
||||||
calpontPackagename = "infinidb";
|
|
||||||
mysqlRPMname = calpontPackagename + "-storage-engine";
|
mysqlRPMname = calpontPackagename + "-storage-engine";
|
||||||
|
|
||||||
//check if package is there
|
//check if package is there
|
||||||
@ -361,8 +385,8 @@ int main(int argc, char *argv[])
|
|||||||
int rtnCode = system(cmd.c_str());
|
int rtnCode = system(cmd.c_str());
|
||||||
if (rtnCode != 0) {
|
if (rtnCode != 0) {
|
||||||
{
|
{
|
||||||
cout << endl << "FAILED: InfiniDB Package(s) not found in " << release << " , exiting" << endl;
|
cout << endl << "FAILED: " + company + " Package(s) not found in " << release << " , exiting" << endl;
|
||||||
cerr << endl << "FAILED: InfiniDB Package(s) not found in " << release << " , exiting" << endl;
|
cerr << endl << "FAILED: " + company + " Package(s) not found in " << release << " , exiting" << endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -377,7 +401,8 @@ int main(int argc, char *argv[])
|
|||||||
buf = line;
|
buf = line;
|
||||||
|
|
||||||
string::size_type pos;
|
string::size_type pos;
|
||||||
pos = buf.find("infinidb-storage-engine-",0);
|
string package = calpontPackagename + "-storage-engine-";
|
||||||
|
pos = buf.find(package,0);
|
||||||
if (pos != string::npos) {
|
if (pos != string::npos) {
|
||||||
currentPrefix = buf.substr(pos+24,1);
|
currentPrefix = buf.substr(pos+24,1);
|
||||||
break;
|
break;
|
||||||
@ -387,7 +412,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
calpontPackage = calpontPackagename + "-" + currentPrefix + systemPackage;
|
calpontPackage = calpontPackagename + "-" + currentPrefix + systemPackage;
|
||||||
|
|
||||||
cout << endl << "Using the InfiniDB Packages '" + systemPackage + "' from " + SHARED + "/packages/" + release + "/" << endl;
|
cout << endl << "Using the " + company + " Packages '" + systemPackage + "' from " + SHARED + "/packages/" + release + "/" << endl;
|
||||||
}
|
}
|
||||||
else //binary package
|
else //binary package
|
||||||
{
|
{
|
||||||
@ -403,7 +428,7 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
//try to guess the release, v4+ takes precedence
|
//try to guess the release, v4+ takes precedence
|
||||||
string sentinel = systemDir + "infinidb-ent-*.tar.gz";
|
string sentinel = systemDir + "" + calpontPackagename + "-ent-*.tar.gz";
|
||||||
glob_t gt;
|
glob_t gt;
|
||||||
memset(>, 0, sizeof(gt));
|
memset(>, 0, sizeof(gt));
|
||||||
idbver = 3;
|
idbver = 3;
|
||||||
@ -413,9 +438,8 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
currentPrefix = oam.itoa(idbver);
|
currentPrefix = oam.itoa(idbver);
|
||||||
|
|
||||||
calpontPackagename = "infinidb";
|
|
||||||
mysqlRPMname = calpontPackagename + "-storage-engine";
|
mysqlRPMname = calpontPackagename + "-storage-engine";
|
||||||
calpontPackage = "infinidb-ent-" + systemPackage;
|
calpontPackage = "" + calpontPackagename + "-ent-" + systemPackage;
|
||||||
|
|
||||||
//check if package is there
|
//check if package is there
|
||||||
cmd = "ls " + systemDir + calpontPackage + " > /tmp/package.txt 2>&1";
|
cmd = "ls " + systemDir + calpontPackage + " > /tmp/package.txt 2>&1";
|
||||||
@ -423,8 +447,8 @@ int main(int argc, char *argv[])
|
|||||||
int rtnCode = system(cmd.c_str());
|
int rtnCode = system(cmd.c_str());
|
||||||
if (rtnCode != 0) {
|
if (rtnCode != 0) {
|
||||||
{
|
{
|
||||||
cout << endl << "FAILED: InfiniDB binary package not found in " << release << ", exiting" << endl;
|
cout << endl << "FAILED: " + company + " binary package not found in " << release << ", exiting" << endl;
|
||||||
cerr << endl << "FAILED: InfiniDB binary package not found in " << release << ", exiting" << endl;
|
cerr << endl << "FAILED: " + company + " binary package not found in " << release << ", exiting" << endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -439,7 +463,8 @@ int main(int argc, char *argv[])
|
|||||||
buf = line;
|
buf = line;
|
||||||
|
|
||||||
string::size_type pos;
|
string::size_type pos;
|
||||||
pos = buf.find("infinidb-ent-",0);
|
string package = calpontPackagename + "-ent-"
|
||||||
|
pos = buf.find(package,0);
|
||||||
if (pos != string::npos) {
|
if (pos != string::npos) {
|
||||||
currentPrefix = buf.substr(pos+13,1);
|
currentPrefix = buf.substr(pos+13,1);
|
||||||
break;
|
break;
|
||||||
@ -447,7 +472,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
cout << endl << "Using the InfiniDB Package '" + systemPackage + "' from " + SHARED + "/Iterations/" + release + "/packages" << endl;
|
cout << endl << "Using the " + company + " Package '" + systemPackage + "' from " + SHARED + "/Iterations/" + release + "/packages" << endl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -519,14 +544,14 @@ exit(0);
|
|||||||
cout << "Get System Calpont.xml " << flush;
|
cout << "Get System Calpont.xml " << flush;
|
||||||
for ( int retry = 0 ; retry < 5 ; retry++ )
|
for ( int retry = 0 ; retry < 5 ; retry++ )
|
||||||
{
|
{
|
||||||
cmd = "./remote_scp_get.sh " + installParentModuleIPAddr + " " + password + " " + installDir + "/Calpont/etc/Calpont.xml " + systemUser + " " + debug_flag;
|
cmd = "./remote_scp_get.sh " + installParentModuleIPAddr + " " + password + " " + installDir + "" + installLocation + "/etc" + installLocation + ".xml " + systemUser + " " + debug_flag;
|
||||||
rtnCode = system(cmd.c_str());
|
rtnCode = system(cmd.c_str());
|
||||||
sleep(2);
|
sleep(2);
|
||||||
if (rtnCode == 0) {
|
if (rtnCode == 0) {
|
||||||
cmd = "mv Calpont.xml " + systemDir + "/.";
|
cmd = "mv Calpont.xml " + systemDir + "/.";
|
||||||
rtnCode = system(cmd.c_str());
|
rtnCode = system(cmd.c_str());
|
||||||
if ( rtnCode == 0 ) {
|
if ( rtnCode == 0 ) {
|
||||||
//Calpont.xml found
|
/" + installLocation + ".xml found
|
||||||
|
|
||||||
//try to parse it
|
//try to parse it
|
||||||
Config* sysConfigOld;
|
Config* sysConfigOld;
|
||||||
@ -540,7 +565,7 @@ exit(0);
|
|||||||
// redirect cout to /dev/null
|
// redirect cout to /dev/null
|
||||||
cerr.rdbuf(file.rdbuf());
|
cerr.rdbuf(file.rdbuf());
|
||||||
|
|
||||||
sysConfigOld = Config::makeConfig( systemDir + "/Calpont.xml");
|
sysConfigOld = Config::makeConfig( systemDir + "" + installLocation + ".xml");
|
||||||
|
|
||||||
// restore cout stream buffer
|
// restore cout stream buffer
|
||||||
cerr.rdbuf (strm_buffer);
|
cerr.rdbuf (strm_buffer);
|
||||||
@ -573,10 +598,10 @@ exit(0);
|
|||||||
RPMSAVE:
|
RPMSAVE:
|
||||||
//try Calpont.xml.rpmsave
|
//try Calpont.xml.rpmsave
|
||||||
cout << "Get System Calpont.xml.rpmsave " << flush;
|
cout << "Get System Calpont.xml.rpmsave " << flush;
|
||||||
cmd = "./remote_scp_get.sh " + installParentModuleIPAddr + " " + password + " " + installDir + "/Calpont/etc/Calpont.xml.rpmsave " + systemUser + " " + debug_flag;
|
cmd = "./remote_scp_get.sh " + installParentModuleIPAddr + " " + password + " " + installDir + "" + installLocation + "/etc" + installLocation + ".xml.rpmsave " + systemUser + " " + debug_flag;
|
||||||
rtnCode = system(cmd.c_str());
|
rtnCode = system(cmd.c_str());
|
||||||
if (rtnCode == 0) {
|
if (rtnCode == 0) {
|
||||||
cmd = "mv Calpont.xml.rpmsave " + systemDir + "/Calpont.xml";
|
cmd = "mv Calpont.xml.rpmsave " + systemDir + "" + installLocation + ".xml";
|
||||||
rtnCode = system(cmd.c_str());
|
rtnCode = system(cmd.c_str());
|
||||||
if ( rtnCode != 0 ) {
|
if ( rtnCode != 0 ) {
|
||||||
cout << "ERROR: No system Calpont.xml or Calpont.xml.rpmsave found, exiting" << endl;
|
cout << "ERROR: No system Calpont.xml or Calpont.xml.rpmsave found, exiting" << endl;
|
||||||
@ -606,7 +631,7 @@ CONFIGDONE:
|
|||||||
|
|
||||||
Config* sysConfigOld;
|
Config* sysConfigOld;
|
||||||
try {
|
try {
|
||||||
sysConfigOld = Config::makeConfig( systemDir + "/Calpont.xml");
|
sysConfigOld = Config::makeConfig( systemDir + "" + installLocation + ".xml");
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
@ -625,8 +650,8 @@ CONFIGDONE:
|
|||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
cout << "ERROR: Problem updating the InfiniDB System Configuration file, exiting" << endl;
|
cout << "ERROR: Problem updating the " + company + " System Configuration file, exiting" << endl;
|
||||||
cerr << "ERROR: Problem updating the InfiniDB System Configuration file, exiting" << endl;
|
cerr << "ERROR: Problem updating the " + company + " System Configuration file, exiting" << endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -644,8 +669,8 @@ CONFIGDONE:
|
|||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
cout << "ERROR: Problem reading serverTypeInstall from the InfiniDB System Configuration file, exiting" << endl;
|
cout << "ERROR: Problem reading serverTypeInstall from the " + company + " System Configuration file, exiting" << endl;
|
||||||
cerr << "ERROR: Problem reading serverTypeInstall from the InfiniDB System Configuration file, exiting" << endl;
|
cerr << "ERROR: Problem reading serverTypeInstall from the " + company + " System Configuration file, exiting" << endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -656,8 +681,8 @@ CONFIGDONE:
|
|||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
cout << "ERROR: Problem reading DBRootStorageType from the InfiniDB System Configuration file, exiting" << endl;
|
cout << "ERROR: Problem reading DBRootStorageType from the " + company + " System Configuration file, exiting" << endl;
|
||||||
cerr << "ERROR: Problem reading DBRootStorageType from the InfiniDB System Configuration file, exiting" << endl;
|
cerr << "ERROR: Problem reading DBRootStorageType from the " + company + " System Configuration file, exiting" << endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -670,8 +695,8 @@ CONFIGDONE:
|
|||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
cout << "ERROR: Problem reading DataFileEnvFile from the InfiniDB System Configuration file, exiting" << endl;
|
cout << "ERROR: Problem reading DataFileEnvFile from the " + company + " System Configuration file, exiting" << endl;
|
||||||
cerr << "ERROR: Problem reading DataFileEnvFile from the InfiniDB System Configuration file, exiting" << endl;
|
cerr << "ERROR: Problem reading DataFileEnvFile from the " + company + " System Configuration file, exiting" << endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -736,15 +761,7 @@ CONFIGDONE:
|
|||||||
|
|
||||||
cout << "Shutdown System " << flush;
|
cout << "Shutdown System " << flush;
|
||||||
|
|
||||||
cmd = "./remote_command.sh " + installParentModuleIPAddr + " " + systemUser + " " + password + " '" + installDir + "/Calpont/bin/mcsadmin shutdownsystem Force y' 'Successful shutdown' Error 60 " + debug_flag;
|
cmd = "./remote_command.sh " + installParentModuleIPAddr + " " + systemUser + " " + password + " '" + installDir + "" + installLocation + "/bin/" + adminCommand + " shutdownsystem Force y' 'Successful shutdown' Error 60 " + debug_flag;
|
||||||
rtnCode = system(cmd.c_str());
|
|
||||||
if (rtnCode == 0)
|
|
||||||
cout << "DONE" << endl;
|
|
||||||
|
|
||||||
// run calpontUninstaller script
|
|
||||||
cout << "Run calpontUninstall script " << flush;
|
|
||||||
|
|
||||||
cmd = "./remote_command.sh " + installParentModuleIPAddr + " " + systemUser + " " + password + " '" + installDir + "/Calpont/bin/calpontUninstall.sh -d -p " + password + "' 'Uninstall Completed' FAILED 500 " + debug_flag;
|
|
||||||
rtnCode = system(cmd.c_str());
|
rtnCode = system(cmd.c_str());
|
||||||
if (rtnCode == 0)
|
if (rtnCode == 0)
|
||||||
cout << "DONE" << endl;
|
cout << "DONE" << endl;
|
||||||
@ -756,7 +773,7 @@ CONFIGDONE:
|
|||||||
installer = "parent_binary_installer.sh";
|
installer = "parent_binary_installer.sh";
|
||||||
cmd = "cd " + systemDir + ";../../" + installer + " " + installParentModuleIPAddr + " " +
|
cmd = "cd " + systemDir + ";../../" + installer + " " + installParentModuleIPAddr + " " +
|
||||||
password + " " + systemPackage + " " + release + " " + configFile + " " + systemUser + " " +
|
password + " " + systemPackage + " " + release + " " + configFile + " " + systemUser + " " +
|
||||||
installDir + " " + debug_flag;
|
installDir + " " + calpontPackagename + " " + installLocation + " " + debug_flag;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -764,14 +781,14 @@ CONFIGDONE:
|
|||||||
{
|
{
|
||||||
installer = "dm_parent_installer.sh";
|
installer = "dm_parent_installer.sh";
|
||||||
cmd = "cd " + systemDir + ";../../" + installer + " " + installParentModuleIPAddr + " " +
|
cmd = "cd " + systemDir + ";../../" + installer + " " + installParentModuleIPAddr + " " +
|
||||||
password + " " + systemPackage + " " + release + " " + configFile + " " + systemUser + " " + CE + " " + debug_flag;
|
password + " " + systemPackage + " " + release + " " + configFile + " " + systemUser + " " + CE + " " + calpontPackagename + " " + installLocation + " " + debug_flag;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
installer = "pm_parent_installer.sh";
|
installer = "pm_parent_installer.sh";
|
||||||
cmd = "cd " + systemDir + ";../../" + installer + " " + installParentModuleIPAddr + " " +
|
cmd = "cd " + systemDir + ";../../" + installer + " " + installParentModuleIPAddr + " " +
|
||||||
password + " " + systemPackage + " " + release + " " + configFile + " " + currentPrefix + " " +
|
password + " " + systemPackage + " " + release + " " + configFile + " " + currentPrefix + " " +
|
||||||
systemUser + " " + debug_flag;
|
systemUser + " " + calpontPackagename + " " + installLocation + " " + debug_flag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -790,22 +807,22 @@ CONFIGDONE:
|
|||||||
{
|
{
|
||||||
if ( MySQLport == oam::UnassignedName )
|
if ( MySQLport == oam::UnassignedName )
|
||||||
{
|
{
|
||||||
cmd = "./remote_command.sh " + installParentModuleIPAddr + " " + systemUser + " " + password + " '. " + installDir + "/Calpont/bin/" + DataFileEnvFile + ";" + installDir + "/Calpont/bin/postConfigure -i " + installDir + "/Calpont -n -p " + password + "' 'System is Active' Error 1200 " + debug_flag;
|
cmd = "./remote_command.sh " + installParentModuleIPAddr + " " + systemUser + " " + password + " '. " + installDir + "" + installLocation + "/bin/" + DataFileEnvFile + ";" + installDir + "" + installLocation + "/bin/postConfigure -i " + installDir + "" + installLocation + " -u -p " + password + "' 'System is Active' Error 1200 " + debug_flag;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cmd = "./remote_command.sh " + installParentModuleIPAddr + " " + systemUser + " " + password + " '. " + installDir + "/Calpont/bin/" + DataFileEnvFile + ";" + installDir + "/Calpont/bin/postConfigure -i " + installDir + "/Calpont -n -p " + password + " -port " + MySQLport + "' 'System is Active' Error 1200 " + debug_flag;
|
cmd = "./remote_command.sh " + installParentModuleIPAddr + " " + systemUser + " " + password + " '. " + installDir + "" + installLocation + "/bin/" + DataFileEnvFile + ";" + installDir + "" + installLocation + "/bin/postConfigure -i " + installDir + "" + installLocation + " -u -p " + password + " -port " + MySQLport + "' 'System is Active' Error 1200 " + debug_flag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( MySQLport == oam::UnassignedName )
|
if ( MySQLport == oam::UnassignedName )
|
||||||
{
|
{
|
||||||
cmd = "./remote_command.sh " + installParentModuleIPAddr + " " + systemUser + " " + password + " '" + installDir + "/Calpont/bin/postConfigure -i " + installDir + "/Calpont -n -p " + password + "' 'System is Active' Error 1200 " + debug_flag;
|
cmd = "./remote_command.sh " + installParentModuleIPAddr + " " + systemUser + " " + password + " '" + installDir + "" + installLocation + "/bin/postConfigure -i " + installDir + "" + installLocation + " -u -p " + password + "' 'System is Active' Error 1200 " + debug_flag;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cmd = "./remote_command.sh " + installParentModuleIPAddr + " " + systemUser + " " + password + " '" + installDir + "/Calpont/bin/postConfigure -i " + installDir + "/Calpont -n -p " + password + " -port " + MySQLport + "' 'System is Active' Error 1200 " + debug_flag;
|
cmd = "./remote_command.sh " + installParentModuleIPAddr + " " + systemUser + " " + password + " '" + installDir + "" + installLocation + "/bin/postConfigure -i " + installDir + "" + installLocation + " -u -p " + password + " -port " + MySQLport + "' 'System is Active' Error 1200 " + debug_flag;
|
||||||
string DataFileEnvFile = "setenv-hdfs-20";
|
string DataFileEnvFile = "setenv-hdfs-20";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,29 +16,25 @@ set RELEASE [lindex $argv 3]
|
|||||||
set CONFIGFILE [lindex $argv 4]
|
set CONFIGFILE [lindex $argv 4]
|
||||||
set USERNAME [lindex $argv 5]
|
set USERNAME [lindex $argv 5]
|
||||||
set CEFLAG [lindex $argv 6]
|
set CEFLAG [lindex $argv 6]
|
||||||
set DEBUG [lindex $argv 7]
|
set PACKAGENAME [lindex $argv 7]
|
||||||
|
set INSTALLLOCATION [lindex $argv 8]
|
||||||
|
set DEBUG [lindex $argv 9]
|
||||||
|
|
||||||
set CALPONTPACKAGE1 infinidb-libs-$PACKAGE
|
|
||||||
set CALPONTPACKAGE2 infinidb-platform-$PACKAGE
|
|
||||||
if { $CEFLAG == "1" } {
|
|
||||||
set CALPONTPACKAGE3 " "
|
|
||||||
} else {
|
|
||||||
set CALPONTPACKAGE3 infinidb-enterprise-$PACKAGE
|
|
||||||
}
|
|
||||||
set MYSQLPACKAGE infinidb-storage-engine-$PACKAGE
|
|
||||||
set MYSQLDPACKAGE infinidb-mysql-$PACKAGE
|
|
||||||
set INSTALLDIR "/usr/local"
|
set INSTALLDIR "/usr/local"
|
||||||
|
|
||||||
set SHARED "//srvhill01/shared"
|
set SHARED "//srvhill01/shared"
|
||||||
|
|
||||||
log_user $DEBUG
|
log_user $DEBUG
|
||||||
spawn -noecho /bin/bash
|
spawn -noecho /bin/bash
|
||||||
#send "rm -f $CALPONTPACKAGE1 $CALPONTPACKAGE2 $CALPONTPACKAGE3\n"
|
|
||||||
#
|
SET CONFIG "Calpont"
|
||||||
# delete and erase all old packages from Director Module
|
if { $PACKAGENAME != "NULL"} {
|
||||||
#
|
SET CONFIG "Calpont"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
set timeout 10
|
set timeout 10
|
||||||
send "ssh $USERNAME@$SERVER 'rm -f /root/calpont-*.rpm /root/infinidb*.rpm'\n"
|
send "ssh $USERNAME@$SERVER 'rm -f /root/$INSTALLLOCATION-*.rpm /root/infinidb*.rpm'\n"
|
||||||
expect {
|
expect {
|
||||||
-re "authenticity" { send "yes\n"
|
-re "authenticity" { send "yes\n"
|
||||||
expect {
|
expect {
|
||||||
@ -65,7 +61,7 @@ send "$PASSWORD\n"
|
|||||||
expect {
|
expect {
|
||||||
-re {[$#] } { }
|
-re {[$#] } { }
|
||||||
}
|
}
|
||||||
send "ssh $USERNAME@$SERVER 'rpm -e --nodeps \$(rpm -qa | grep '^InfiniDB') >/dev/null 2>&1; rpm -e --nodeps \$(rpm -qa | grep '^infinidb-')'\n"
|
send "ssh $USERNAME@$SERVER 'rpm -e --nodeps \$(rpm -qa | grep '^mariadb-columnstore') >/dev/null 2>&1; rpm -e --nodeps \$(rpm -qa | grep '^infinidb-')'\n"
|
||||||
expect -re "word: "
|
expect -re "word: "
|
||||||
# password for ssh
|
# password for ssh
|
||||||
send "$PASSWORD\n"
|
send "$PASSWORD\n"
|
||||||
@ -78,7 +74,7 @@ expect {
|
|||||||
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
|
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
|
||||||
}
|
}
|
||||||
sleep 10
|
sleep 10
|
||||||
send "ssh $USERNAME@$SERVER 'rm -f $INSTALLDIR/Calpont/releasenum >/dev/null 2>&1; test -x $INSTALLDIR/Calpont/bin/pre-uninstall && $INSTALLDIR/Calpont/bin/pre-uninstall'\n"
|
send "ssh $USERNAME@$SERVER 'rm -f $INSTALLDIR/$INSTALLLOCATION/releasenum >/dev/null 2>&1; test -x $INSTALLDIR/$INSTALLLOCATION/bin/pre-uninstall && $INSTALLDIR/$INSTALLLOCATION/bin/pre-uninstall'\n"
|
||||||
expect -re "word: "
|
expect -re "word: "
|
||||||
# password for ssh
|
# password for ssh
|
||||||
send "$PASSWORD\n"
|
send "$PASSWORD\n"
|
||||||
@ -148,7 +144,7 @@ if { $CONFIGFILE != "NULL"} {
|
|||||||
#
|
#
|
||||||
# copy over Calpont.xml file
|
# copy over Calpont.xml file
|
||||||
#
|
#
|
||||||
send "scp $CONFIGFILE $USERNAME@$SERVER:/usr/local/Calpont/etc/Calpont.xml\n"
|
send "scp $CONFIGFILE $USERNAME@$SERVER:/usr/local/$INSTALLLOCATION/etc/$CONFIG.xml\n"
|
||||||
expect -re "word: "
|
expect -re "word: "
|
||||||
# send the password
|
# send the password
|
||||||
send "$PASSWORD\n"
|
send "$PASSWORD\n"
|
||||||
@ -159,7 +155,7 @@ if { $CONFIGFILE != "NULL"} {
|
|||||||
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
|
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
|
||||||
}
|
}
|
||||||
send_user "Copy InfiniDB Configuration File "
|
send_user "Copy InfiniDB Configuration File "
|
||||||
send "scp $CONFIGFILE $USERNAME@$SERVER:/usr/local/Calpont/etc/Calpont.xml.rpmsave\n"
|
send "scp $CONFIGFILE $USERNAME@$SERVER:/usr/local/$INSTALLLOCATION/etc/$CONFIG.xml.rpmsave\n"
|
||||||
expect -re "word: "
|
expect -re "word: "
|
||||||
# send the password
|
# send the password
|
||||||
send "$PASSWORD\n"
|
send "$PASSWORD\n"
|
||||||
@ -170,7 +166,7 @@ if { $CONFIGFILE != "NULL"} {
|
|||||||
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
|
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
|
||||||
}
|
}
|
||||||
#do a dummy scp command
|
#do a dummy scp command
|
||||||
send "scp $CONFIGFILE $USERNAME@$SERVER:/tmp/Calpont.xml\n"
|
send "scp $CONFIGFILE $USERNAME@$SERVER:/tmp/$CONFIG.xml\n"
|
||||||
expect -re "word: "
|
expect -re "word: "
|
||||||
# send the password
|
# send the password
|
||||||
send "$PASSWORD\n"
|
send "$PASSWORD\n"
|
||||||
@ -182,7 +178,7 @@ if { $CONFIGFILE != "NULL"} {
|
|||||||
# rename previous installed config file
|
# rename previous installed config file
|
||||||
#
|
#
|
||||||
send_user "Copy RPM-saved InfiniDB Configuration File "
|
send_user "Copy RPM-saved InfiniDB Configuration File "
|
||||||
send "ssh $USERNAME@$SERVER 'cd /usr/local/Calpont/etc/;mv -f Calpont.xml Calpont.xml.install;cp -v Calpont.xml.rpmsave Calpont.xml'\n"
|
send "ssh $USERNAME@$SERVER 'cd /usr/local/$INSTALLLOCATION/etc/;mv -f Calpont.xml Calpont.xml.install;cp -v Calpont.xml.rpmsave Calpont.xml'\n"
|
||||||
expect -re "word: "
|
expect -re "word: "
|
||||||
# password for ssh
|
# password for ssh
|
||||||
send "$PASSWORD\n"
|
send "$PASSWORD\n"
|
||||||
|
@ -15,7 +15,9 @@ set RELEASE [lindex $argv 3]
|
|||||||
set CONFIGFILE [lindex $argv 4]
|
set CONFIGFILE [lindex $argv 4]
|
||||||
set USERNAME [lindex $argv 5]
|
set USERNAME [lindex $argv 5]
|
||||||
set INSTALLDIR [lindex $argv 6]
|
set INSTALLDIR [lindex $argv 6]
|
||||||
set DEBUG [lindex $argv 7]
|
set PACKAGENAME [lindex $argv 7]
|
||||||
|
set INSTALLLOCATION [lindex $argv 8]
|
||||||
|
set DEBUG [lindex $argv 9]
|
||||||
|
|
||||||
set CALPONTPACKAGE infinidb-ent-*$PACKAGE
|
set CALPONTPACKAGE infinidb-ent-*$PACKAGE
|
||||||
|
|
||||||
@ -24,7 +26,7 @@ set SHARED "//srvhill01/shared"
|
|||||||
set INSTALLDIRARG " "
|
set INSTALLDIRARG " "
|
||||||
set HOME "/root"
|
set HOME "/root"
|
||||||
if { $USERNAME != "root" } {
|
if { $USERNAME != "root" } {
|
||||||
set INSTALLDIRARG "--installdir=$INSTALLDIR/Calpont"
|
set INSTALLDIRARG "--installdir=$INSTALLDIR/$INSTALLLOCATION"
|
||||||
set HOME $INSTALLDIR
|
set HOME $INSTALLDIR
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,7 +38,7 @@ send "rm -f $PACKAGE\n"
|
|||||||
#
|
#
|
||||||
set timeout 30
|
set timeout 30
|
||||||
send_user "Remove Calpont Packages from System "
|
send_user "Remove Calpont Packages from System "
|
||||||
send "ssh $USERNAME@$SERVER 'rm -f $INSTALLDIR/calpont*.gz;rm -f /root/calpont*.rpm;rm -f /root/calpont*.gz'\n"
|
send "ssh $USERNAME@$SERVER 'rm -f $INSTALLDIR/$INSTALLLOCATION*.gz;rm -f /root/$INSTALLLOCATION*.rpm;rm -f /root/$INSTALLLOCATION*.gz'\n"
|
||||||
expect {
|
expect {
|
||||||
-re "authenticity" { send "yes\n"
|
-re "authenticity" { send "yes\n"
|
||||||
expect {
|
expect {
|
||||||
@ -102,7 +104,7 @@ expect {
|
|||||||
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
|
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
|
||||||
}
|
}
|
||||||
sleep 10
|
sleep 10
|
||||||
send "ssh $USERNAME@$SERVER 'rm -f $INSTALLDIR/Calpont/releasenum >/dev/null 2>&1; test -x $INSTALLDIR/Calpont/bin/pre-uninstall && $INSTALLDIR/Calpont/bin/pre-uninstall $INSTALLDIRARG'\n"
|
send "ssh $USERNAME@$SERVER 'rm -f $INSTALLDIR/$INSTALLLOCATION/releasenum >/dev/null 2>&1; test -x $INSTALLDIR/$INSTALLLOCATION/bin/pre-uninstall && $INSTALLDIR/$INSTALLLOCATION/bin/pre-uninstall $INSTALLDIRARG'\n"
|
||||||
expect -re "word: "
|
expect -re "word: "
|
||||||
# password for ssh
|
# password for ssh
|
||||||
send "$PASSWORD\n"
|
send "$PASSWORD\n"
|
||||||
@ -120,7 +122,7 @@ sleep 5
|
|||||||
#
|
#
|
||||||
set timeout 30
|
set timeout 30
|
||||||
send_user "Install New Calpont Package "
|
send_user "Install New Calpont Package "
|
||||||
send "ssh $USERNAME@$SERVER 'tar -C $INSTALLDIR --exclude db -zxf $HOME/$CALPONTPACKAGE;cat $INSTALLDIR/Calpont/releasenum'\n"
|
send "ssh $USERNAME@$SERVER 'tar -C $INSTALLDIR --exclude db -zxf $HOME/$CALPONTPACKAGE;cat $INSTALLDIR/$INSTALLLOCATION/releasenum'\n"
|
||||||
expect -re "word: "
|
expect -re "word: "
|
||||||
# password for ssh
|
# password for ssh
|
||||||
send "$PASSWORD\n"
|
send "$PASSWORD\n"
|
||||||
@ -142,7 +144,7 @@ send "rm -f $PACKAGE\n"
|
|||||||
send_user "Run post-install script "
|
send_user "Run post-install script "
|
||||||
send " \n"
|
send " \n"
|
||||||
send date\n
|
send date\n
|
||||||
send "ssh $USERNAME@$SERVER '$INSTALLDIR/Calpont/bin/post-install $INSTALLDIRARG'\n"
|
send "ssh $USERNAME@$SERVER '$INSTALLDIR/$INSTALLLOCATION/bin/post-install $INSTALLDIRARG'\n"
|
||||||
set timeout 10
|
set timeout 10
|
||||||
expect {
|
expect {
|
||||||
-re "word: " { send "$PASSWORD\n" } abort
|
-re "word: " { send "$PASSWORD\n" } abort
|
||||||
@ -165,10 +167,10 @@ sleep 10
|
|||||||
#
|
#
|
||||||
if { $CONFIGFILE != "NULL"} {
|
if { $CONFIGFILE != "NULL"} {
|
||||||
#
|
#
|
||||||
# copy over Calpont.xml file
|
# copy over $CONFIG.xml file
|
||||||
#
|
#
|
||||||
send_user "Copy Calpont Configuration File "
|
send_user "Copy Calpont Configuration File "
|
||||||
send "scp $CONFIGFILE $USERNAME@$SERVER:$INSTALLDIR/Calpont/etc/Calpont.xml.rpmsave\n"
|
send "scp $CONFIGFILE $USERNAME@$SERVER:$INSTALLDIR/$INSTALLLOCATION/etc/$CONFIG.xml.rpmsave\n"
|
||||||
expect -re "word: "
|
expect -re "word: "
|
||||||
# send the password
|
# send the password
|
||||||
send "$PASSWORD\n"
|
send "$PASSWORD\n"
|
||||||
@ -180,7 +182,7 @@ if { $CONFIGFILE != "NULL"} {
|
|||||||
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
|
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
|
||||||
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
|
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
|
||||||
}
|
}
|
||||||
send "scp $CONFIGFILE $USERNAME@$SERVER:$INSTALLDIR/Calpont/etc/Calpont.xml\n"
|
send "scp $CONFIGFILE $USERNAME@$SERVER:$INSTALLDIR/$INSTALLLOCATION/etc/$CONFIG.xml\n"
|
||||||
expect -re "word: "
|
expect -re "word: "
|
||||||
# send the password
|
# send the password
|
||||||
send "$PASSWORD\n"
|
send "$PASSWORD\n"
|
||||||
@ -197,13 +199,13 @@ if { $CONFIGFILE != "NULL"} {
|
|||||||
# rename previous installed config file
|
# rename previous installed config file
|
||||||
#
|
#
|
||||||
send_user "Copy RPM-saved Calpont Configuration File "
|
send_user "Copy RPM-saved Calpont Configuration File "
|
||||||
send "ssh $USERNAME@$SERVER 'cd $INSTALLDIR/Calpont/etc/;mv -f Calpont.xml Calpont.xml.install;cp -v Calpont.xml.rpmsave Calpont.xml'\n"
|
send "ssh $USERNAME@$SERVER 'cd $INSTALLDIR/$INSTALLLOCATION/etc/;mv -f $CONFIG.xml $CONFIG.xml.install;cp -v $CONFIG.xml.rpmsave $CONFIG.xml'\n"
|
||||||
expect -re "word: "
|
expect -re "word: "
|
||||||
# password for ssh
|
# password for ssh
|
||||||
send "$PASSWORD\n"
|
send "$PASSWORD\n"
|
||||||
# check return
|
# check return
|
||||||
expect {
|
expect {
|
||||||
-re "Calpont.xml" { send_user "DONE" } abort
|
-re "$CONFIG.xml" { send_user "DONE" } abort
|
||||||
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
|
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,24 +17,27 @@ set RELEASE [lindex $argv 3]
|
|||||||
set CONFIGFILE [lindex $argv 4]
|
set CONFIGFILE [lindex $argv 4]
|
||||||
set PREFIX [lindex $argv 5]
|
set PREFIX [lindex $argv 5]
|
||||||
set USERNAME [lindex $argv 6]
|
set USERNAME [lindex $argv 6]
|
||||||
set DEBUG [lindex $argv 7]
|
set PACKAGENAME [lindex $argv 7]
|
||||||
|
set INSTALLLOCATION [lindex $argv 8]
|
||||||
|
set DEBUG [lindex $argv 9]
|
||||||
|
|
||||||
set CALPONTPACKAGE1 infinidb-libs-$PREFIX$PACKAGE
|
|
||||||
set CALPONTPACKAGE2 infinidb-platform-$PREFIX$PACKAGE
|
|
||||||
set CALPONTPACKAGE3 infinidb-enterprise-$PREFIX$PACKAGE
|
|
||||||
set MYSQLPACKAGE infinidb-storage-engine-$PACKAGE
|
|
||||||
set MYSQLDPACKAGE infinidb-mysql-$PACKAGE
|
|
||||||
set SHARED "//srvhill01/shared"
|
set SHARED "//srvhill01/shared"
|
||||||
set INSTALLDIR "/usr/local"
|
set INSTALLDIR "/usr/local"
|
||||||
|
|
||||||
log_user $DEBUG
|
log_user $DEBUG
|
||||||
spawn -noecho /bin/bash
|
spawn -noecho /bin/bash
|
||||||
|
|
||||||
|
SET CONFIG "Calpont"
|
||||||
|
if { $PACKAGENAME != "NULL"} {
|
||||||
|
SET CONFIG "Calpont"
|
||||||
|
}
|
||||||
|
|
||||||
send "rm -f $PACKAGE\n"
|
send "rm -f $PACKAGE\n"
|
||||||
#
|
#
|
||||||
# delete and erase all old packages from Parent OAM Module
|
# delete and erase all old packages from Parent OAM Module
|
||||||
#
|
#
|
||||||
set timeout 30
|
set timeout 30
|
||||||
send "ssh $USERNAME@$SERVER 'rm -f /root/calpont-*.rpm /root/infinidb*.rpm'\n"
|
send "ssh $USERNAME@$SERVER 'rm -f /root/$INSTALLLOCATION-*.rpm /root/infinidb*.rpm /root/mariabd*.rpm '\n"
|
||||||
expect {
|
expect {
|
||||||
-re "authenticity" { send "yes\n"
|
-re "authenticity" { send "yes\n"
|
||||||
expect {
|
expect {
|
||||||
@ -82,7 +85,7 @@ send_user "\n"
|
|||||||
set timeout 60
|
set timeout 60
|
||||||
expect -re {[$#] }
|
expect -re {[$#] }
|
||||||
send_user "Erase Old InfiniDB Package "
|
send_user "Erase Old InfiniDB Package "
|
||||||
send "ssh $USERNAME@$SERVER 'rpm -e --nodeps \$(rpm -qa | grep '^InfiniDB') >/dev/null 2>&1; rpm -e --nodeps \$(rpm -qa | grep '^infinidb-')'\n"
|
send "ssh $USERNAME@$SERVER 'rpm -e --nodeps \$(rpm -qa | grep '^mariadb-columnstore') >/dev/null 2>&1; rpm -e --nodeps \$(rpm -qa | grep '^infinidb-')'\n"
|
||||||
expect -re "word: "
|
expect -re "word: "
|
||||||
# password for ssh
|
# password for ssh
|
||||||
send "$PASSWORD\n"
|
send "$PASSWORD\n"
|
||||||
@ -94,7 +97,7 @@ expect {
|
|||||||
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
|
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
|
||||||
}
|
}
|
||||||
sleep 10
|
sleep 10
|
||||||
send "ssh $USERNAME@$SERVER 'rm -f $INSTALLDIR/Calpont/releasenum >/dev/null 2>&1; test -x $INSTALLDIR/Calpont/bin/pre-uninstall && $INSTALLDIR/Calpont/bin/pre-uninstall'\n"
|
send "ssh $USERNAME@$SERVER 'rm -f $INSTALLDIR/$INSTALLLOCATION/releasenum >/dev/null 2>&1; test -x $INSTALLDIR/$INSTALLLOCATION/bin/pre-uninstall && $INSTALLDIR/$INSTALLLOCATION/bin/pre-uninstall'\n"
|
||||||
expect -re "word: "
|
expect -re "word: "
|
||||||
# password for ssh
|
# password for ssh
|
||||||
send "$PASSWORD\n"
|
send "$PASSWORD\n"
|
||||||
@ -131,7 +134,7 @@ expect -re {[$#] }
|
|||||||
send "rm -f $PACKAGE\n"
|
send "rm -f $PACKAGE\n"
|
||||||
#
|
#
|
||||||
if { $CONFIGFILE != "NULL"} {
|
if { $CONFIGFILE != "NULL"} {
|
||||||
send "scp $CONFIGFILE $USERNAME@$SERVER:/usr/local/Calpont/etc/Calpont.xml\n"
|
send "scp $CONFIGFILE $USERNAME@$SERVER:/usr/local/$INSTALLLOCATION/etc/$CONFIG.xml\n"
|
||||||
expect -re "word: "
|
expect -re "word: "
|
||||||
# send the password
|
# send the password
|
||||||
send "$PASSWORD\n"
|
send "$PASSWORD\n"
|
||||||
@ -142,10 +145,10 @@ if { $CONFIGFILE != "NULL"} {
|
|||||||
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
|
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
# copy over Calpont.xml file
|
# copy over $CONFIG.xml file
|
||||||
#
|
#
|
||||||
send_user "Copy InfiniDB Configuration File "
|
send_user "Copy InfiniDB Configuration File "
|
||||||
send "scp $CONFIGFILE $USERNAME@$SERVER:/usr/local/Calpont/etc/Calpont.xml.rpmsave\n"
|
send "scp $CONFIGFILE $USERNAME@$SERVER:/usr/local/$INSTALLLOCATION/etc/$CONFIG.xml.rpmsave\n"
|
||||||
expect -re "word: "
|
expect -re "word: "
|
||||||
# send the password
|
# send the password
|
||||||
send "$PASSWORD\n"
|
send "$PASSWORD\n"
|
||||||
@ -156,7 +159,7 @@ if { $CONFIGFILE != "NULL"} {
|
|||||||
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
|
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
|
||||||
}
|
}
|
||||||
#do a dummy scp command
|
#do a dummy scp command
|
||||||
send "scp $CONFIGFILE $USERNAME@$SERVER:/tmp/Calpont.xml\n"
|
send "scp $CONFIGFILE $USERNAME@$SERVER:/tmp/$CONFIG.xml\n"
|
||||||
expect -re "word: "
|
expect -re "word: "
|
||||||
# send the password
|
# send the password
|
||||||
send "$PASSWORD\n"
|
send "$PASSWORD\n"
|
||||||
@ -168,13 +171,13 @@ if { $CONFIGFILE != "NULL"} {
|
|||||||
# rename previous installed config file
|
# rename previous installed config file
|
||||||
#
|
#
|
||||||
send_user "Copy RPM-saved InfiniDB Configuration File "
|
send_user "Copy RPM-saved InfiniDB Configuration File "
|
||||||
send "ssh $USERNAME@$SERVER 'cd /usr/local/Calpont/etc/;mv -f Calpont.xml Calpont.xml.install;cp -v Calpont.xml.rpmsave Calpont.xml'\n"
|
send "ssh $USERNAME@$SERVER 'cd /usr/local/$INSTALLLOCATION/etc/;mv -f $CONFIG.xml $CONFIG.xml.install;cp -v $CONFIG.xml.rpmsave $CONFIG.xml'\n"
|
||||||
expect -re "word: "
|
expect -re "word: "
|
||||||
# password for ssh
|
# password for ssh
|
||||||
send "$PASSWORD\n"
|
send "$PASSWORD\n"
|
||||||
# check return
|
# check return
|
||||||
expect {
|
expect {
|
||||||
-re "Calpont.xml" { send_user "DONE" }
|
-re "$CONFIG.xml" { send_user "DONE" }
|
||||||
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
|
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user