1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2026-01-06 08:21:10 +03:00

MCOL-770 - remove password need in addmodule

This commit is contained in:
david hill
2017-06-22 10:32:33 -05:00
parent 743fec5c5e
commit 9729e88c81
3 changed files with 93 additions and 75 deletions

View File

@@ -5067,12 +5067,14 @@ int processCommand(string* arguments)
string cloud = oam::UnassignedName;
string GlusterStorageType;
string AmazonVPCNextPrivateIP;
string DistributedInstall = "y";
try {
oam.getSystemConfig("Cloud", cloud);
oam.getSystemConfig("AmazonVPCNextPrivateIP", AmazonVPCNextPrivateIP);
oam.getSystemConfig("GlusterConfig", GlusterConfig);
oam.getSystemConfig("GlusterCopies", GlusterCopies);
oam.getSystemConfig("GlusterStorageType", GlusterStorageType);
oam.getSystemConfig("DistributedInstall", DistributedInstall);
}
catch(...) {}
@@ -5107,15 +5109,20 @@ int processCommand(string* arguments)
moduleType = arguments[1];
moduleCount = atoi(arguments[2].c_str());
hostArg = 3;
if (arguments[4] != "")
password = arguments[4];
else
{
cout << endl;
string prompt = "Enter the 'User' Password or 'ssh' if configured with ssh-keys";
password = dataPrompt(prompt);
}
//check for a non-distrubuted install setup, dont need password
if ( DistributedInstall == "y" )
{
if (arguments[4] != "")
password = arguments[4];
else
{
cout << endl;
string prompt = "Enter the 'User' Password or 'ssh' if configured with ssh-keys";
password = dataPrompt(prompt);
}
}
if (arguments[5] != "")
dbrootPerPM = atoi(arguments[5].c_str());
}
@@ -5133,15 +5140,20 @@ int processCommand(string* arguments)
moduleType = arguments[1].substr(0,MAX_MODULE_TYPE_SIZE);
moduleCount = 1;
hostArg = 2;
if (arguments[3] != "")
password = arguments[3];
else
{
cout << endl;
string prompt = "Enter the 'User' Password or 'ssh' if configured with ssh-keys";
password = dataPrompt(prompt);
}
//check for a non-distrubuted install setup, dont need password
if ( DistributedInstall == "y" )
{
if (arguments[3] != "")
password = arguments[3];
else
{
cout << endl;
string prompt = "Enter the 'User' Password or 'ssh' if configured with ssh-keys";
password = dataPrompt(prompt);
}
}
if (arguments[4] != "")
dbrootPerPM = atoi(arguments[4].c_str());
}

View File

@@ -2772,6 +2772,10 @@ int main(int argc, char *argv[])
if ( IserverTypeInstall != oam::INSTALL_COMBINE_DM_UM_PM ||
pmNumber > 1 ) {
//skip interface with remote servers and perform install
if ( !nonDistribute )
{
//
// perform remote install of other servers in the system
//
@@ -2797,11 +2801,7 @@ int main(int argc, char *argv[])
}
if ( install == "y" ) {
//skip interface with remote servers and perform install
if ( !nonDistribute )
{
SystemSoftware systemsoftware;
SystemSoftware systemsoftware;
try
{
@@ -3169,19 +3169,19 @@ 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;
}
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);
}
}
// call the mysql setup scripts
mysqlSetup();
sleep(5);
}
}
}
//configure data redundancy
@@ -3265,6 +3265,11 @@ int main(int argc, char *argv[])
string start = "y";
cout << "System Installation is complete. If any part of the install failed," << endl;
cout << "the problem should be investigated and resolved before continuing." << endl << endl;
if ( nonDistribute )
cout << "Non-Distrubuted Install: make sure all other modules have MariaDB ColumnStore" << endl;
cout << "package installed and the associated service started."<< endl << endl;
while(true)
{
pcommand = callReadline("Would you like to startup the MariaDB ColumnStore System? [y,n] (y) > ");

View File

@@ -618,11 +618,11 @@ void processMSG(messageqcpp::IOSocket* cfIos)
oam.dbrmctl("resume");
log.writeLog(__LINE__, "'dbrmctl resume' done", LOG_TYPE_DEBUG);
processManager.restartProcessType("ExeMgr");
// processManager.restartProcessType("ExeMgr");
//setup MySQL Replication for started modules
log.writeLog(__LINE__, "Setup MySQL Replication for module being started", LOG_TYPE_DEBUG);
processManager.setMySQLReplication(startdevicenetworklist);
// log.writeLog(__LINE__, "Setup MySQL Replication for module being started", LOG_TYPE_DEBUG);
// processManager.setMySQLReplication(startdevicenetworklist);
}
}
else
@@ -4546,48 +4546,48 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
return API_FILE_OPEN_ERROR;
}
log.writeLog(__LINE__, "addModule - ColumnStore Package found:" + calpontPackage, LOG_TYPE_DEBUG);
//
// Verify Host IP and Password
//
if ( password == "ssh" && amazon )
{ // check if there is a root password stored
string rpw = oam::UnassignedName;
try
{
oam.getSystemConfig("rpw", rpw);
}
catch(...)
{
rpw = "mariadb1";
}
if (rpw != oam::UnassignedName)
password = rpw;
}
listPT = devicenetworklist.begin();
for( ; listPT != devicenetworklist.end() ; listPT++)
{
HostConfigList::iterator pt1 = (*listPT).hostConfigList.begin();
string newHostName = (*pt1).HostName;
if ( newHostName == oam::UnassignedName )
continue;
string newIPAddr = (*pt1).IPAddr;
string cmd = installDir + "/bin/remote_command.sh " + newIPAddr + " " + password + " ls";
log.writeLog(__LINE__, cmd, LOG_TYPE_DEBUG);
int rtnCode = system(cmd.c_str());
if (WEXITSTATUS(rtnCode) != 0) {
log.writeLog(__LINE__, "addModule - ERROR: Remote login test failed, Invalid IP / Password " + newIPAddr, LOG_TYPE_ERROR);
pthread_mutex_unlock(&THREAD_LOCK);
return API_FAILURE;
}
log.writeLog(__LINE__, "addModule - Remote login test successful: " + newIPAddr, LOG_TYPE_DEBUG);
}
}
//
// Verify Host IP and Password
//
if ( password == "ssh" && amazon )
{ // check if there is a root password stored
string rpw = oam::UnassignedName;
try
{
oam.getSystemConfig("rpw", rpw);
}
catch(...)
{
rpw = "mariadb1";
}
if (rpw != oam::UnassignedName)
password = rpw;
}
listPT = devicenetworklist.begin();
for( ; listPT != devicenetworklist.end() ; listPT++)
{
HostConfigList::iterator pt1 = (*listPT).hostConfigList.begin();
string newHostName = (*pt1).HostName;
if ( newHostName == oam::UnassignedName )
continue;
string newIPAddr = (*pt1).IPAddr;
string cmd = installDir + "/bin/remote_command.sh " + newIPAddr + " " + password + " ls";
log.writeLog(__LINE__, cmd, LOG_TYPE_DEBUG);
int rtnCode = system(cmd.c_str());
if (WEXITSTATUS(rtnCode) != 0) {
log.writeLog(__LINE__, "addModule - ERROR: Remote login test failed, Invalid IP / Password " + newIPAddr, LOG_TYPE_ERROR);
pthread_mutex_unlock(&THREAD_LOCK);
return API_FAILURE;
}
log.writeLog(__LINE__, "addModule - Remote login test successful: " + newIPAddr, LOG_TYPE_DEBUG);
}
//
//Get System Configuration file
//
@@ -5361,6 +5361,7 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
string moduleName = (*listPT).DeviceName;
processManager.configureModule(moduleName);
sleep(10);
}
}