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

MCOL-1523

This commit is contained in:
David Hill
2018-09-04 16:41:44 -05:00
parent a3862a42f7
commit e5f18964f0
4 changed files with 212 additions and 158 deletions

View File

@ -7036,15 +7036,33 @@ int processCommand(string* arguments)
if (systemstatus.SystemOpState == oam::ACTIVE ) {
try
{
cout << endl << " Starting Modules" << endl;
oam.startModule(devicenetworklist, ackTemp);
// cout << endl << " Starting Modules" << endl;
// oam.startModule(devicenetworklist, ackTemp);
//reload DBRM with new configuration, needs to be done here after startModule
cmd = startup::StartUp::installDir() + "/bin/dbrmctl reload > /dev/null 2>&1";
system(cmd.c_str());
sleep(15);
// cmd = startup::StartUp::installDir() + "/bin/dbrmctl reload > /dev/null 2>&1";
// system(cmd.c_str());
// sleep(15);
cout << " Successful start of Modules " << endl;
// cout << " Successful start of Modules " << endl;
cout << endl << " Restarting System ";
int returnStatus = oam.restartSystem(gracefulTemp, ackTemp);
switch (returnStatus)
{
case API_SUCCESS:
if ( waitForActive() )
cout << endl << " Successful restart of System " << endl << endl;
else
cout << endl << "**** restartSystem Failed : check log files" << endl;
break;
case API_CANCELLED:
cout << endl << " Restart of System canceled" << endl << endl;
break;
default:
cout << endl << "**** restartSystem Failed : Check system logs" << endl;
break;
}
}
catch (exception& e)
{

View File

@ -1247,26 +1247,16 @@ int main(int argc, char *argv[])
//amazon install setup check
bool amazonInstall = false;
string cloud = oam::UnassignedName;
system("aws --version > /tmp/amazon.log 2>&1");
ifstream in("/tmp/amazon.log");
in.seekg(0, std::ios::end);
int size = in.tellg();
if ( size == 0 || oam.checkLogStatus("/tmp/amazon.log", "not found"))
if (!multi_server_quick_install)
{
// 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);
}
system("aws --version > /tmp/amazon.log 2>&1");
amazonInstall = false;
}
else
{
if ( size == 0 || oam.checkLogStatus("/tmp/amazon.log", "not installed"))
ifstream in("/tmp/amazon.log");
in.seekg(0, std::ios::end);
int size = in.tellg();
if ( size == 0 || oam.checkLogStatus("/tmp/amazon.log", "not found"))
{
// not running on amazon with ec2-api-tools
if (amazon_quick_install)
@ -1278,9 +1268,23 @@ int main(int argc, char *argv[])
amazonInstall = false;
}
else
amazonInstall = true;
}
{
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;
}
else
amazonInstall = true;
}
}
try {
cloud = sysConfig->getConfig(InstallSection, "Cloud");
}
@ -3090,7 +3094,9 @@ int main(int argc, char *argv[])
//check if dbrm data resides in older directory path and inform user if it does
dbrmDirCheck();
if ( IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM && pmNumber == 1) {
if ( ( IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM ) ||
( (IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM) && pmwithum ) )
{
//run the mysql / mysqld setup scripts
cout << endl << "===== Running the MariaDB ColumnStore MariaDB Server setup scripts =====" << endl << endl;
@ -3098,7 +3104,57 @@ int main(int argc, char *argv[])
// call the mysql setup scripts
mysqlSetup();
sleep(5);
sleep(3);
}
if ( IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM ||
pmNumber > 1 )
{
if ( password.empty() )
{
cout << endl;
cout << "Next step is to enter the password to access the other Servers." << endl;
cout << "This is either your password or you can default to using a ssh key" << endl;
cout << "If using a password, the password needs to be the same on all Servers." << endl << endl;
if ( noPrompting ) {
cout << "Enter password, hit 'enter' to default to using a ssh key, or 'exit' > " << endl;
password = "ssh";
}
else
{
while(true)
{
char *pass1, *pass2;
pass1=getpass("Enter password, hit 'enter' to default to using a ssh key, or 'exit' > ");
if ( strcmp(pass1, "") == 0 ) {
password = "ssh";
break;
}
string p1 = pass1;
if ( p1 == "exit")
exit(0);
pass2=getpass("Confirm password > ");
string p2 = pass2;
if ( p1 == p2 ) {
password = p2;
break;
}
else
cout << "Password mismatch, please re-enter" << endl;
}
//add single quote for special characters
if ( password != "ssh" )
{
password = "'" + password + "'";
}
}
}
}
int thread_id = 0;
@ -3116,7 +3172,7 @@ int main(int argc, char *argv[])
//skip interface with remote servers and perform install
if ( !nonDistribute )
{
//
//
// perform remote install of other servers in the system
//
cout << endl << "===== System Installation =====" << endl << endl;
@ -3173,67 +3229,8 @@ int main(int argc, char *argv[])
if( !pkgCheck(columnstorePackage) )
exit(1);
if ( password.empty() )
{
cout << endl;
cout << "Next step is to enter the password to access the other Servers." << endl;
cout << "This is either your password or you can default to using a ssh key" << endl;
cout << "If using a password, the password needs to be the same on all Servers." << endl << endl;
}
while(true)
{
char *pass1, *pass2;
if ( noPrompting ) {
cout << "Enter password, hit 'enter' to default to using a ssh key, or 'exit' > " << endl;
if ( password.empty() )
password = "ssh";
break;
}
//check for command line option password
if ( !password.empty() )
break;
pass1=getpass("Enter password, hit 'enter' to default to using a ssh key, or 'exit' > ");
if ( strcmp(pass1, "") == 0 ) {
password = "ssh";
break;
}
if ( pass1 == "exit")
exit(0);
string p1 = pass1;
pass2=getpass("Confirm password > ");
string p2 = pass2;
if ( p1 == p2 ) {
password = p2;
break;
}
else
cout << "Password mismatch, please re-enter" << endl;
}
//add single quote for special characters
if ( password != "ssh" )
{
password = "'" + password + "'";
}
checkSystemMySQLPort(mysqlPort, sysConfig, USER, password, childmodulelist, IserverTypeInstall, pmwithum);
if ( ( IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM ) ||
( (IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM) && pmwithum ) )
{
cout << endl << "===== Running the MariaDB ColumnStore MariaDB ColumnStore setup scripts =====" << endl << endl;
// call the mysql setup scripts
mysqlSetup();
sleep(5);
}
string AmazonInstall = "0";
if ( amazonInstall )
AmazonInstall = "1";
@ -3411,19 +3408,7 @@ int main(int argc, char *argv[])
cout << " DONE" << endl;
}
}
else
{
if ( ( IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM ) ||
( (IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM) && pmwithum ) )
{
cout << endl << "===== Running the MariaDB ColumnStore MariaDB ColumnStore setup scripts =====" << endl << endl;
// call the mysql setup scripts
mysqlSetup();
sleep(5);
}
}
//configure data redundancy
if (DataRedundancy)
{
@ -3641,9 +3626,6 @@ int main(int argc, char *argv[])
}
//set mysql replication, if wasn't setup before on system
// if ( ( mysqlRep && pmwithum ) ||
// ( mysqlRep && (umNumber > 1) ) ||
// ( mysqlRep && (pmNumber > 1) && (IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM) ) )
if ( mysqlRep )
{
cout << endl << "Run MariaDB ColumnStore Replication Setup.. ";
@ -3665,7 +3647,10 @@ int main(int argc, char *argv[])
cout << "Enter the following command to define MariaDB ColumnStore Alias Commands" << endl << endl;
cout << ". " + installDir + "/bin/columnstoreAlias" << endl << endl;
if ( !rootUser )
cout << ". /etc/profile.d/columnstoreEnv.sh" << endl;
cout << ". /etc/profile.d/columnstoreAlias.sh" << endl << endl;
cout << "Enter 'mcsmysql' to access the MariaDB ColumnStore SQL console" << endl;
cout << "Enter 'mcsadmin' to access the MariaDB ColumnStore Admin console" << endl << endl;
@ -3682,7 +3667,10 @@ int main(int argc, char *argv[])
cout << "Enter the following command to define MariaDB ColumnStore Alias Commands" << endl << endl;
cout << ". " + installDir + "/bin/columnstoreAlias" << endl << endl;
if ( !rootUser )
cout << ". /etc/profile.d/columnstoreEnv.sh" << endl;
cout << ". /etc/profile.d/columnstoreAlias.sh" << endl << endl;
cout << "Enter 'mcsmysql' to access the MariaDB ColumnStore SQL console" << endl;
cout << "Enter 'mcsadmin' to access the MariaDB ColumnStore Admin console" << endl << endl;