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
merge
This commit is contained in:
@ -344,6 +344,7 @@ int main(int argc, char** argv)
|
|||||||
// sleep (1);
|
// sleep (1);
|
||||||
|
|
||||||
string cmd = startup::StartUp::installDir() + "/bin/infinidb stop > /dev/null 2>&1";
|
string cmd = startup::StartUp::installDir() + "/bin/infinidb stop > /dev/null 2>&1";
|
||||||
|
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -437,7 +438,7 @@ int main(int argc, char** argv)
|
|||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
log.writeLog(__LINE__, "wating for good return from getModuleStatus", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "waiting for good return from getModuleStatus", LOG_TYPE_DEBUG);
|
||||||
sleep (1);
|
sleep (1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -553,6 +554,7 @@ int main(int argc, char** argv)
|
|||||||
if ( retry == 20 )
|
if ( retry == 20 )
|
||||||
{
|
{
|
||||||
log.writeLog(__LINE__, "Check DB mounts failed, shutting down", LOG_TYPE_CRITICAL);
|
log.writeLog(__LINE__, "Check DB mounts failed, shutting down", LOG_TYPE_CRITICAL);
|
||||||
|
|
||||||
//Set the alarm
|
//Set the alarm
|
||||||
// aMonitor.sendAlarm(config.moduleName().c_str(), STARTUP_DIAGNOTICS_FAILURE, SET);
|
// aMonitor.sendAlarm(config.moduleName().c_str(), STARTUP_DIAGNOTICS_FAILURE, SET);
|
||||||
// sleep (1);
|
// sleep (1);
|
||||||
@ -582,7 +584,7 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
while (!mainResumeFlag)
|
while (!mainResumeFlag)
|
||||||
{
|
{
|
||||||
log.writeLog(__LINE__, "WATING FOR mainResumeFlag to be set", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "WAITING FOR mainResumeFlag to be set", LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
@ -1131,9 +1133,6 @@ static void messageThread(MonitorConfig config)
|
|||||||
|
|
||||||
string cmd = "fuser -k " + port + "/tcp >/dev/null 2>&1";
|
string cmd = "fuser -k " + port + "/tcp >/dev/null 2>&1";
|
||||||
|
|
||||||
if ( !rootUser)
|
|
||||||
cmd = "sudo fuser -k " + port + "/tcp >/dev/null 2>&1";
|
|
||||||
|
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
@ -2363,10 +2362,7 @@ static void statusControlThread()
|
|||||||
string port = sysConfig->getConfig(portName, "Port");
|
string port = sysConfig->getConfig(portName, "Port");
|
||||||
string cmd = "fuser -k " + port + "/tcp >/dev/null 2>&1";
|
string cmd = "fuser -k " + port + "/tcp >/dev/null 2>&1";
|
||||||
|
|
||||||
if ( !rootUser)
|
system(cmd.c_str());
|
||||||
cmd = "sudo fuser -k " + port + "/tcp >/dev/null 2>&1";
|
|
||||||
|
|
||||||
system(cmd.c_str());
|
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
|
@ -1062,8 +1062,9 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
|
|||||||
msg >> manualFlag;
|
msg >> manualFlag;
|
||||||
int requestStatus = oam::API_SUCCESS;
|
int requestStatus = oam::API_SUCCESS;
|
||||||
log.writeLog(__LINE__, "MSG RECEIVED: Start All process request...");
|
log.writeLog(__LINE__, "MSG RECEIVED: Start All process request...");
|
||||||
|
|
||||||
//start the mysqld daemon
|
//start the mysqld daemon
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
oam.actionMysqlCalpont(MYSQL_START);
|
oam.actionMysqlCalpont(MYSQL_START);
|
||||||
@ -1762,20 +1763,10 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
|
|||||||
if (!oam.checkLogStatus("/tmp/umount.txt", "busy"))
|
if (!oam.checkLogStatus("/tmp/umount.txt", "busy"))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if ( rootUser)
|
cmd = "lsof " + startup::StartUp::installDir() + "/data" + dbrootID + " >> /tmp/umount.txt 2>&1";
|
||||||
{
|
system(cmd.c_str());
|
||||||
cmd = "lsof " + startup::StartUp::installDir() + "/data" + dbrootID + " >> /tmp/umount.txt 2>&1";
|
cmd = "fuser -muvf " + startup::StartUp::installDir() + "/data" + dbrootID + " >> /tmp/umount.txt 2>&1";
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
cmd = "fuser -muvf " + startup::StartUp::installDir() + "/data" + dbrootID + " >> /tmp/umount.txt 2>&1";
|
|
||||||
system(cmd.c_str());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cmd = "sudo lsof " + startup::StartUp::installDir() + "/data" + dbrootID + " >> /tmp/umount.txt 2>&1";
|
|
||||||
system(cmd.c_str());
|
|
||||||
cmd = "sudo fuser -muvf " + startup::StartUp::installDir() + "/data" + dbrootID + " >> /tmp/umount.txt 2>&1";
|
|
||||||
system(cmd.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
sleep(2);
|
sleep(2);
|
||||||
//Flush the cache
|
//Flush the cache
|
||||||
@ -1834,7 +1825,7 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
|
|||||||
|
|
||||||
if ( !rootUser)
|
if ( !rootUser)
|
||||||
{
|
{
|
||||||
cmd = "sudo chown -R " + USER + ":" + USER + " " + startup::StartUp::installDir() + "/data" + dbrootID + " > /dev/null";
|
cmd = "chown -R " + USER + ":" + USER + " " + startup::StartUp::installDir() + "/data" + dbrootID + " > /dev/null";
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1876,15 +1867,7 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
|
|||||||
|
|
||||||
if (WEXITSTATUS(status) != 0 )
|
if (WEXITSTATUS(status) != 0 )
|
||||||
{
|
{
|
||||||
if ( rootUser)
|
cmd = "echo " + entry + " >> /etc/fstab";
|
||||||
{
|
|
||||||
cmd = "echo " + entry + " >> /etc/fstab";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cmd = "sudo echo " + entry + " >> /etc/fstab";
|
|
||||||
}
|
|
||||||
|
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
|
|
||||||
log.writeLog(__LINE__, "Add line entry to /etc/fstab : " + entry);
|
log.writeLog(__LINE__, "Add line entry to /etc/fstab : " + entry);
|
||||||
@ -1896,14 +1879,7 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
|
|||||||
|
|
||||||
if (WEXITSTATUS(status) != 0 )
|
if (WEXITSTATUS(status) != 0 )
|
||||||
{
|
{
|
||||||
if ( rootUser)
|
cmd = "echo " + entry + " >> " + startup::StartUp::installDir() + "/local/etc/pm1/fstab";
|
||||||
{
|
|
||||||
cmd = "echo " + entry + " >> " + startup::StartUp::installDir() + "/local/etc/pm1/fstab";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cmd = "sudo echo " + entry + " >> " + startup::StartUp::installDir() + "/local/etc/pm1/fstab";
|
|
||||||
}
|
|
||||||
|
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
|
|
||||||
@ -1915,14 +1891,7 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
|
|||||||
string::size_type pos1 = entry.find(" ", pos + 1);
|
string::size_type pos1 = entry.find(" ", pos + 1);
|
||||||
string directory = entry.substr(pos + 1, pos1 - pos);
|
string directory = entry.substr(pos + 1, pos1 - pos);
|
||||||
|
|
||||||
if ( rootUser)
|
cmd = "mkdir " + directory;
|
||||||
{
|
|
||||||
cmd = "mkdir " + directory;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cmd = "sudo mkdir " + directory;
|
|
||||||
}
|
|
||||||
|
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
log.writeLog(__LINE__, "create directory: " + directory);
|
log.writeLog(__LINE__, "create directory: " + directory);
|
||||||
@ -3134,7 +3103,7 @@ int ProcessMonitor::updateLog(std::string action, std::string level)
|
|||||||
//if non-root, change file permissions so we can update it
|
//if non-root, change file permissions so we can update it
|
||||||
if ( !rootUser)
|
if ( !rootUser)
|
||||||
{
|
{
|
||||||
string cmd = "sudo chmod 666 " + fileName + " > /dev/null";
|
string cmd = "chmod 666 " + fileName + " > /dev/null";
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5224,16 +5193,10 @@ int ProcessMonitor::changeMyCnf(std::string type)
|
|||||||
// set owner and permission
|
// set owner and permission
|
||||||
string cmd = "chmod 664 " + mycnfFile + " >/dev/null 2>&1";
|
string cmd = "chmod 664 " + mycnfFile + " >/dev/null 2>&1";
|
||||||
|
|
||||||
if ( !rootUser)
|
|
||||||
cmd = "sudo chmod 644 " + mycnfFile + " >/dev/null 2>&1";
|
|
||||||
|
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
|
|
||||||
cmd = "chown mysql:mysql " + mycnfFile + " >/dev/null 2>&1";
|
cmd = "chown mysql:mysql " + mycnfFile + " >/dev/null 2>&1";
|
||||||
|
|
||||||
if ( !rootUser)
|
|
||||||
cmd = "sudo chown mysql:mysql " + mycnfFile + " >/dev/null 2>&1";
|
|
||||||
|
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
|
|
||||||
// restart mysql
|
// restart mysql
|
||||||
@ -5987,10 +5950,7 @@ bool ProcessMonitor::amazonVolumeCheck(int dbrootID)
|
|||||||
{
|
{
|
||||||
string cmd;
|
string cmd;
|
||||||
|
|
||||||
if ( rootUser)
|
cmd = "mount " + deviceName + " " + startup::StartUp::installDir() + "/mysql/db -t ext2 -o defaults > /tmp/um_mount.log";
|
||||||
cmd = "mount " + deviceName + " " + startup::StartUp::installDir() + "/mysql/db -t ext2 -o defaults > /tmp/um_mount.log";
|
|
||||||
else
|
|
||||||
cmd = "sudo mount " + deviceName + " " + startup::StartUp::installDir() + "/mysql/db -t ext2 -o defaults > /tmp/um_mount.log";
|
|
||||||
|
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
log.writeLog(__LINE__, "mount cmd: " + cmd, LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "mount cmd: " + cmd, LOG_TYPE_DEBUG);
|
||||||
@ -6399,7 +6359,7 @@ int ProcessMonitor::checkDataMount()
|
|||||||
|
|
||||||
if ( !rootUser)
|
if ( !rootUser)
|
||||||
{
|
{
|
||||||
cmd = "sudo chown -R " + USER + ":" + USER + " " + dbroot + " > /dev/null";
|
cmd = "chown -R " + USER + ":" + USER + " " + dbroot + " > /dev/null";
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6573,16 +6533,8 @@ int ProcessMonitor::glusterAssign(std::string dbrootID)
|
|||||||
moduleIPAddr = sysConfig->getConfig("SystemModuleConfig", dataDupIPaddr);
|
moduleIPAddr = sysConfig->getConfig("SystemModuleConfig", dataDupIPaddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( rootUser)
|
command = "mount -tglusterfs -odirect-io-mode=enable " + moduleIPAddr + ":/dbroot" +
|
||||||
{
|
|
||||||
command = "mount -tglusterfs -odirect-io-mode=enable " + moduleIPAddr + ":/dbroot" +
|
|
||||||
dbrootID + " " + startup::StartUp::installDir() + "/data" + dbrootID + " > /tmp/glusterAssign.txt 2>&1";
|
dbrootID + " " + startup::StartUp::installDir() + "/data" + dbrootID + " > /tmp/glusterAssign.txt 2>&1";
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
command = "sudo mount -tglusterfs -odirect-io-mode=enable " + moduleIPAddr + ":/dbroot" +
|
|
||||||
dbrootID + " " + startup::StartUp::installDir() + "/data" + dbrootID + " > /tmp/glusterAssign.txt 2>&1";
|
|
||||||
}
|
|
||||||
|
|
||||||
int ret = system(command.c_str());
|
int ret = system(command.c_str());
|
||||||
|
|
||||||
@ -6624,14 +6576,7 @@ int ProcessMonitor::glusterUnassign(std::string dbrootID)
|
|||||||
|
|
||||||
log.writeLog(__LINE__, "glusterUnassign called: " + dbrootID, LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "glusterUnassign called: " + dbrootID, LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
if ( rootUser)
|
command = "umount -f " + startup::StartUp::installDir() + "/data" + dbrootID + " > /tmp/glusterUnassign.txt 2>&1";
|
||||||
{
|
|
||||||
command = "umount -f " + startup::StartUp::installDir() + "/data" + dbrootID + " > /tmp/glusterUnassign.txt 2>&1";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
command = "sudo umount -f " + startup::StartUp::installDir() + "/data" + dbrootID + " > /tmp/glusterUnassign.txt 2>&1";
|
|
||||||
}
|
|
||||||
|
|
||||||
int ret = system(command.c_str());
|
int ret = system(command.c_str());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user