1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-07 03:22:57 +03:00
This commit is contained in:
David Hall
2016-05-27 14:40:44 -05:00
11 changed files with 43 additions and 77 deletions

View File

@@ -29,7 +29,6 @@ df=$installdir/mysql/my.cnf
$installdir/mysql/bin/mysql --defaults-file=$df --force --user=root $pwprompt mysql 2>/tmp/mysql_install.log <<EOD
INSTALL PLUGIN columnstore SONAME 'libcalmysql.so';
$installdir/mysql/bin/mysql --defaults-file=$df --force --user=root $pwprompt mysql 2>>/tmp/mysql_install.log <<EOD
INSTALL PLUGIN infinidb SONAME 'libcalmysql.so';
-- these are deprecated names
DELETE FROM mysql.func WHERE name='caldisablepartition';

View File

@@ -347,6 +347,9 @@ getGroup() {
describeInstance
fi
group=`grep -B1 -A6 -m 1 $instance $describeInstanceFile | grep -m 1 GROUP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
if [ "$group" == "" ]; then
group=`grep -B1 -A4 -m 1 $instance $describeInstanceFile | grep -m 1 INSTANCE | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $21}'`
fi
fi
echo $group

View File

@@ -231,7 +231,7 @@
<PrimaryUMModuleName>unassigned</PrimaryUMModuleName>
<ModuleHeartbeatPeriod>1</ModuleHeartbeatPeriod>
<ModuleHeartbeatCount>3</ModuleHeartbeatCount>
<ModuleProcMonWaitCount>30</ModuleProcMonWaitCount> // 2.5 minutes
<ModuleProcMonWaitCount>6</ModuleProcMonWaitCount> // 2.5 minutes
<!-- Disabled
<ProcessHeartbeatPeriod>-1</ProcessHeartbeatPeriod>
-->
@@ -251,7 +251,7 @@
<NMSIPAddress>0.0.0.0</NMSIPAddress>
<TempSaveSize>128M</TempSaveSize> <!-- default SWSDL max element save size -->
<WaitPeriod>10</WaitPeriod> <!-- in seconds -->
<TempFileDir>/tmp/infinidb_tmp_files</TempFileDir>
<TempFileDir>/tmp/columnstore_tmp_files</TempFileDir>
<CalpontHome>$INSTALLDIR</CalpontHome>
<ProcessRestartCount>10</ProcessRestartCount>
<ProcessRestartPeriod>120</ProcessRestartPeriod>

View File

@@ -236,7 +236,7 @@
<NMSIPAddress>0.0.0.0</NMSIPAddress>
<TempSaveSize>128M</TempSaveSize> <!-- default SWSDL max element save size -->
<WaitPeriod>10</WaitPeriod> <!-- in seconds -->
<TempFileDir>/tmp/infinidb_tmp_files</TempFileDir>
<TempFileDir>/tmp/columnstore_tmp_files</TempFileDir>
<CalpontHome>$INSTALLDIR</CalpontHome>
<ModuleHeartbeatPeriod>10</ModuleHeartbeatPeriod>
<ModuleHeartbeatCount>3</ModuleHeartbeatCount>

View File

@@ -4657,7 +4657,7 @@ namespace oam
{
buf = line;
string::size_type pos = buf.find("Offending RSA key",0);
string::size_type pos = buf.find("Offending",0);
if (pos != string::npos) {
// line ID
pos = buf.find(":",0);

View File

@@ -2327,7 +2327,7 @@ int processCommand(string* arguments)
else
{
//just kick off local server
cout << " System being started, please wait...";
cout << endl << " System being started, please wait...";
cout.flush();
cmd = startup::StartUp::installDir() + "/bin/columnstore restart > /tmp/start.log 2>&1";
int rtnCode = system(cmd.c_str());
@@ -2349,7 +2349,7 @@ int processCommand(string* arguments)
try
{
cout << " System being started, please wait...";
cout << endl << " System being started, please wait...";
cout.flush();
oam.startSystem(ackTemp);
if ( waitForActive() )
@@ -6835,9 +6835,13 @@ int ProcessSupportCommand(int CommandID, std::string arguments[])
getFlags(arguments, gracefulTemp, ackTemp, suspendAnswer, bNeedsConfirm);
if (arguments[3] != "y")
{
// confirm request
if (confirmPrompt("This command restarts the processing of an application on a Module within the MariaDB Columnstore System"))
break;
}
try
{

View File

@@ -1651,7 +1651,7 @@ int main(int argc, char *argv[])
newModuleHostName = moduleHostName;
if (amazonInstall) {
if ( moduleHostName == oam::UnassignedName &&
newModuleName == "pm1" )
newModuleName == "pm1" && nicID == 1)
{
//get local instance name (pm1)
string localInstance = oam.getEC2LocalInstance();
@@ -1721,7 +1721,17 @@ int main(int argc, char *argv[])
}
}
else
{
if ( moduleHostName == oam::UnassignedName &&
newModuleName == "pm1" && nicID == 1)
{
char hostname[128];
gethostname(hostname, sizeof hostname);
moduleHostName = hostname;
}
prompt = "Enter Nic Interface #" + oam.itoa(nicID) + " Host Name (" + moduleHostName + ") > ";
}
if ( prompt != "" )
{

View File

@@ -479,9 +479,9 @@ void ServerMonitor::getCPUdata()
{
pcl.clear();
system("top -b -n1 | head -12 | awk '{print $9,$12}' | tail -5 > /tmp/infinidb_tmp_files/processCpu");
system("top -b -n1 | head -12 | awk '{print $9,$12}' | tail -5 > /tmp/columnstore_tmp_files/processCpu");
ifstream oldFile1 ("/tmp/infinidb_tmp_files/processCpu");
ifstream oldFile1 ("/tmp/columnstore_tmp_files/processCpu");
// read top 5 users
int i = 0;
@@ -503,9 +503,9 @@ void ServerMonitor::getCPUdata()
//
// get and check Total CPU usage
//
system("top -b -n 6 -d 1 | awk '{print $5}' | grep %id > /tmp/infinidb_tmp_files/systemCpu");
system("top -b -n 6 -d 1 | awk '{print $5}' | grep %id > /tmp/columnstore_tmp_files/systemCpu");
ifstream oldFile ("/tmp/infinidb_tmp_files/systemCpu");
ifstream oldFile ("/tmp/columnstore_tmp_files/systemCpu");
float systemIdle = 0;
// skip first line in file, and average the next 5 entries which contains idle times

View File

@@ -427,9 +427,9 @@ void ServerMonitor::outputProcMemory(bool log)
// get top 5 Memory users by process
//
system("ps -e -orss=1,args= | sort -b -k1,1n |tail -n 5 | awk '{print $1,$2}' > /tmp/infinidb_tmp_files/processMem");
system("ps -e -orss=1,args= | sort -b -k1,1n |tail -n 5 | awk '{print $1,$2}' > /tmp/columnstore_tmp_files/processMem");
ifstream oldFile ("/tmp/infinidb_tmp_files/processMem");
ifstream oldFile ("/tmp/columnstore_tmp_files/processMem");
string process;
long long memory;

View File

@@ -1383,12 +1383,12 @@ void pingDeviceThread()
//restart module processes
int retry = 0;
int ModuleProcMonWaitCount = 30;
int ModuleProcMonWaitCount = 6;
try{
oam.getSystemConfig("ModuleProcMonWaitCount", ModuleProcMonWaitCount);
}
catch(...) {
ModuleProcMonWaitCount = 30;
ModuleProcMonWaitCount = 6;
}
for ( ; retry < ModuleProcMonWaitCount ; retry ++ )
@@ -1609,9 +1609,12 @@ void pingDeviceThread()
break;
case oam::DOWN:
// if disabled or initial state, skip
if (opState == oam::AUTO_DISABLED ||
opState == oam::INITIAL)
// if initial state, skip
if (opState == oam::INITIAL)
break;
// if disabled and not amazon, skip
if (opState == oam::AUTO_DISABLED && !amazon)
break;
log.writeLog(__LINE__, "module failed to respond to pings: " + moduleName, LOG_TYPE_WARNING);
@@ -1702,59 +1705,6 @@ void pingDeviceThread()
// return values = 'ip address' for running or rebooting, stopped or terminated
string currentIPAddr = oam.getEC2InstanceIpAddress(hostName);
if (currentIPAddr == "stopped")
{ // start instance
log.writeLog(__LINE__, "Instance in stopped state, try starting it: " + hostName, LOG_TYPE_DEBUG);
int retryCount = 6; // 1 minutes
if( moduleName.find("pm") == 0 )
{
if ( PMInstanceType == "m2.4xlarge" )
retryCount = 15; // 2.5 minutes
}
else
{
if( moduleName.find("um") == 0 )
if ( UMInstanceType == "m2.4xlarge" )
retryCount = 15; // 2.5 minutes
}
int retry = 0;
for ( ; retry < retryCount ; retry++ )
{
if ( oam.startEC2Instance(hostName) )
{
log.writeLog(__LINE__, "Instance started, sleep for 30 seconds to allow it to fully come up: " + hostName, LOG_TYPE_DEBUG);
//delay then get new IP Address
sleep(30);
string currentIPAddr = oam.getEC2InstanceIpAddress(hostName);
if (currentIPAddr == "stopped" || currentIPAddr == "terminated") {
log.writeLog(__LINE__, "Instance failed to start (no ip-address), retry: " + hostName, LOG_TYPE_DEBUG);
}
else
{
// update the Calpont.xml with the new IP Address
string cmd = "sed -i s/" + ipAddr + "/" + currentIPAddr + "/g " + startup::StartUp::installDir() + "/etc/Calpont.xml";
system(cmd.c_str());
break;
}
}
else
{
log.writeLog(__LINE__, "Instance failed to start, retry: " + hostName, LOG_TYPE_DEBUG);
sleep(10);
}
}
if ( retry >= retryCount )
{
log.writeLog(__LINE__, "Instance failed to start, restart a new instance: " + hostName, LOG_TYPE_DEBUG);
currentIPAddr = "terminated";
}
}
if ( currentIPAddr == "terminated")
{
//check if down module was Standby OAM, if so find another one

View File

@@ -4602,8 +4602,8 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
system(cmd.c_str());
if (!oam.checkLogStatus("/tmp/login_test.log", "README")) {
//check for RSA KEY ISSUE and fix
if (oam.checkLogStatus("/tmp/login_test.log", "Offending RSA key")) {
log.writeLog(__LINE__, "addModule - login failed, RSA key issue, try fixing: " + moduleName, LOG_TYPE_DEBUG);
if (oam.checkLogStatus("/tmp/login_test.log", "Offending")) {
log.writeLog(__LINE__, "addModule - login failed, Offending key issue, try fixing: " + moduleName, LOG_TYPE_DEBUG);
string file = "/tmp/login_test.log";
oam.fixRSAkey(file);
}