1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-770 - change the distubute install

This commit is contained in:
david hill
2017-06-22 14:37:28 -05:00
parent 9729e88c81
commit f709a00b81
7 changed files with 127 additions and 45 deletions

View File

@ -168,6 +168,36 @@ expect {
"postConfigure" { send_user "DONE" }
}
send_user "\n"
# start service
if { $INSTALLTYPE == "initial" } {
send_user "\n"
send_user "Start columnstore service script "
send " \n"
send date\n
send "ssh $USERNAME@$SERVER '$INSTALLDIR/bin/columnstore start'\n"
set timeout 10
expect {
"word: " { send "$PASSWORD\n" }
"passphrase" { send "$PASSWORD\n" }
}
set timeout 60
# check return
expect {
"No such file" { send_user "ERROR: post-install Not Found\n" ; exit 1 }
"MariaDB Columnstore syslog logging not working" { send_user "ERROR: MariaDB Columnstore System logging not setup\n" ; exit 1 }
"Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 }
"Read-only file system" { send_user "ERROR: local disk - Read-only file system\n" ; exit 1}
"Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 }
"Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 }
"No route to host" { send_user "ERROR: No route to host\n" ; exit 1 }
"Starting MariaDB" { send_user "DONE" }
}
}
send_user "\nInstallation Successfully Completed on '$MODULE'\n"
exit 0
sleep 10
#
if { $INSTALLTYPE == "initial" || $INSTALLTYPE == "nonDistribute" } {

View File

@ -202,6 +202,37 @@ if { $INSTALLTYPE == "initial"} {
send_user "\n"
#sleep to make sure it's finished
sleep 5
# start service
if { $INSTALLTYPE == "initial" } {
send_user "\n"
send_user "Start columnstore service script "
send " \n"
send date\n
send "ssh $USERNAME@$SERVER '$INSTALLDIR/bin/columnstore start'\n"
set timeout 10
expect {
"word: " { send "$PASSWORD\n" }
"passphrase" { send "$PASSWORD\n" }
}
set timeout 60
# check return
expect {
"No such file" { send_user "ERROR: post-install Not Found\n" ; exit 1 }
"MariaDB Columnstore syslog logging not working" { send_user "ERROR: MariaDB Columnstore System logging not setup\n" ; exit 1 }
"Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 }
"Read-only file system" { send_user "ERROR: local disk - Read-only file system\n" ; exit 1}
"Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 }
"Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 }
"No route to host" { send_user "ERROR: No route to host\n" ; exit 1 }
"Starting MariaDB" { send_user "DONE" }
}
}
send_user "\nInstallation Successfully Completed on '$MODULE'\n"
exit 0
set timeout 30
#expect -re {[$#] }
if { $INSTALLTYPE == "initial"} {

View File

@ -206,6 +206,36 @@ if { $INSTALLTYPE == "initial"} {
}
#sleep to make sure it's finished
sleep 5
# start service
if { $INSTALLTYPE == "initial" } {
send_user "\n"
send_user "Start columnstore service script "
send " \n"
send date\n
send "ssh $USERNAME@$SERVER '$INSTALLDIR/bin/columnstore start'\n"
set timeout 10
expect {
"word: " { send "$PASSWORD\n" }
"passphrase" { send "$PASSWORD\n" }
}
set timeout 60
# check return
expect {
"No such file" { send_user "ERROR: post-install Not Found\n" ; exit 1 }
"MariaDB Columnstore syslog logging not working" { send_user "ERROR: MariaDB Columnstore System logging not setup\n" ; exit 1 }
"Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 }
"Read-only file system" { send_user "ERROR: local disk - Read-only file system\n" ; exit 1}
"Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 }
"Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 }
"No route to host" { send_user "ERROR: No route to host\n" ; exit 1 }
"Starting MariaDB" { send_user "DONE" }
}
}
send_user "\nInstallation Successfully Completed on '$MODULE'\n"
exit 0
#
if { $INSTALLTYPE == "initial"} {
#

View File

@ -2076,7 +2076,7 @@ int main(int argc, char *argv[])
system(cmd.c_str());
if ( newModuleName != parentOAMModuleName) {
//make module file in local/etc/"modulename"
//make module file in local/module
if( !makeModuleFile(newModuleName, parentOAMModuleName) )
cout << "makeModuleFile error" << endl;
}
@ -3301,7 +3301,7 @@ int main(int argc, char *argv[])
}
else
{
if ( !nonDistribute )
/* if ( !nonDistribute )
{
if ( password.empty() ) {
while(true)
@ -3371,7 +3371,7 @@ int main(int argc, char *argv[])
cout << "MariaDB ColumnStore successfully started" << endl;
}
}
*/
//start MariaDB ColumnStore on local server
cout << endl << "----- Starting MariaDB ColumnStore on local server -----" << endl << endl;
cmd = installDir + "/bin/columnstore restart > /dev/null 2>&1";
@ -3951,7 +3951,7 @@ bool makeRClocal(string moduleType, string moduleName, int IserverTypeInstall)
mount1 = "/mnt\\/tmp/";
else
if ( moduleType == "pm" )
mount1 = "/Calpont\\/data/";
mount1 = "/columnstore\\/data/";
else
return true;
break;
@ -3960,28 +3960,7 @@ bool makeRClocal(string moduleType, string moduleName, int IserverTypeInstall)
{
if ( moduleType == "pm" ) {
mount1 = "/mnt\\/tmp/";
mount2 = "/Calpont\\/data/";
}
else
return true;
break;
}
case (oam::INSTALL_COMBINE_DM_UM): // combined #2 dm/um on a same server
{
if ( moduleType == "um" )
mount1 = "/mnt\\/tmp/";
else
if ( moduleType == "pm" )
mount1 = "/Calpont\\/data/";
else
return true;
break;
}
case (oam::INSTALL_COMBINE_PM_UM): // combined #3 um/pm on a same server
{
if ( moduleType == "pm" ) {
mount1 = "/mnt\\/tmp/";
mount2 = "/Calpont\\/data/";
mount2 = "/columnstore\\/data/";
}
else
return true;
@ -5002,7 +4981,7 @@ bool makeModuleFile(string moduleName, string parentOAMModuleName)
if ( moduleName == parentOAMModuleName)
fileName = installDir + "/local/module";
else
fileName = installDir + "/local/etc/" + moduleName + "/module";
return true;
unlink (fileName.c_str());
ofstream newFile (fileName.c_str());

View File

@ -565,7 +565,7 @@ static void startMgrProcessThread()
}
//send out moduleName to remote nodes on non-distrubuted install
if ( DistributedInstall == "n" )
// if ( DistributedInstall == "n" )
{
int status = API_SUCCESS;
int k = 0;

View File

@ -5285,6 +5285,9 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
}
}
//distribute config file
distributeConfigFile("system");
//Start new modules by starting up local Process-Monitor
listPT = devicenetworklist.begin();
for( ; listPT != devicenetworklist.end() ; listPT++)
@ -5300,9 +5303,9 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
string remoteHostName = (*pt1).HostName;
//send start service commands
string cmd = installDir + "/bin/remote_command.sh " + remoteModuleIP + " " + password + " '" + installDir + "/bin/columnstore restart;" + installDir + "/mysql/mysqld-Calpont restart' 0";
system(cmd.c_str());
log.writeLog(__LINE__, "addModule - restart columnstore service " + remoteModuleName, LOG_TYPE_DEBUG);
// string cmd = installDir + "/bin/remote_command.sh " + remoteModuleIP + " " + password + " '" + installDir + "/bin/columnstore restart;" + installDir + "/mysql/mysqld-Calpont restart' 0";
// system(cmd.c_str());
// log.writeLog(__LINE__, "addModule - restart columnstore service " + remoteModuleName, LOG_TYPE_DEBUG);
// add to monitor list
moduleInfoList.insert(moduleList::value_type(remoteModuleName, 0));
@ -5347,6 +5350,15 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
}
}
listPT = devicenetworklist.begin();
for( ; listPT != devicenetworklist.end() ; listPT++)
{
string moduleName = (*listPT).DeviceName;
processManager.configureModule(moduleName);
sleep(10);
}
//if amazon, delay to give time for ProcMon to start
if (amazon) {
log.writeLog(__LINE__, "addModule - sleep 30 - give ProcMon time to start on new Instance", LOG_TYPE_DEBUG);

View File

@ -166,20 +166,20 @@ int main(int argc, char **argv)
MonitorConfig config;
//get Distributed Install
string DistributedInstall = "y";
// string DistributedInstall = "y";
try
{
oam.getSystemConfig("DistributedInstall", DistributedInstall);
}
catch (...)
{
log.writeLog(__LINE__, "addModule - ERROR: get DistributedInstall", LOG_TYPE_ERROR);
}
// try
// {
// oam.getSystemConfig("DistributedInstall", DistributedInstall);
// }
// catch (...)
// {
// log.writeLog(__LINE__, "addModule - ERROR: get DistributedInstall", LOG_TYPE_ERROR);
// }
//check for a non-distrubuted install setup
if ( DistributedInstall == "n" )
{
// if ( DistributedInstall == "n" )
// {
//PMwithUM config
try {
oam.getSystemConfig( "PMwithUM", PMwithUM);
@ -204,7 +204,7 @@ int main(int argc, char **argv)
log.writeLog(__LINE__, "restarting for a non-distrubuted install", LOG_TYPE_DEBUG);
exit (0);
}
// }
}
//define entry if missing