You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-520 gluster changes
This commit is contained in:
@ -8796,20 +8796,20 @@ int Oam::glusterctl(GLUSTER_COMMANDS command, std::string argument1, std::string
|
|||||||
int user, group;
|
int user, group;
|
||||||
user = getuid();
|
user = getuid();
|
||||||
group = getgid();
|
group = getgid();
|
||||||
|
|
||||||
string glustercmd = "gluster ";
|
|
||||||
|
|
||||||
string SUDO = "";
|
string SUDO = "";
|
||||||
if ( user != 0 )
|
if ( user != 0 )
|
||||||
SUDO = "sudo ";
|
SUDO = "sudo ";
|
||||||
|
|
||||||
|
string glustercmd = SUDO + "gluster ";
|
||||||
|
|
||||||
errmsg = "";
|
errmsg = "";
|
||||||
|
|
||||||
switch ( command )
|
switch ( command )
|
||||||
{
|
{
|
||||||
case (oam::GLUSTER_STATUS):
|
case (oam::GLUSTER_STATUS):
|
||||||
{
|
{
|
||||||
string command = SUDO + glustercmd + "volume status";
|
string command = glustercmd + "volume status";
|
||||||
|
|
||||||
char buffer[128];
|
char buffer[128];
|
||||||
string result = "";
|
string result = "";
|
||||||
@ -8995,12 +8995,14 @@ int Oam::glusterctl(GLUSTER_COMMANDS command, std::string argument1, std::string
|
|||||||
for (int pm = (pmID - 1); pm < numberPMs; pm++)
|
for (int pm = (pmID - 1); pm < numberPMs; pm++)
|
||||||
{
|
{
|
||||||
cout << "gluster peer probe " + DataRedundancyConfigs[pm].pmIpAddr << endl;
|
cout << "gluster peer probe " + DataRedundancyConfigs[pm].pmIpAddr << endl;
|
||||||
|
cout << command << endl;
|
||||||
status = system(command.c_str());
|
status = system(command.c_str());
|
||||||
|
|
||||||
if (WEXITSTATUS(status) != 0 )
|
if (WEXITSTATUS(status) != 0 )
|
||||||
{
|
{
|
||||||
cout << "ERROR: peer probe command failed." << endl;
|
cout << "ERROR: peer probe command failed." << endl;
|
||||||
command = InstallDir + "/bin/remote_command.sh " + DataRedundancyConfigs[pm].pmIpAddr + " " + password + " 'stat /var/run/glusterd.pid > /dev/null 2>&1'";
|
command = InstallDir + "/bin/remote_command.sh " + DataRedundancyConfigs[pm].pmIpAddr + " " + password + " 'stat /var/run/glusterd.pid > /dev/null 2>&1'";
|
||||||
|
cout << command << endl;
|
||||||
status = system(command.c_str());
|
status = system(command.c_str());
|
||||||
|
|
||||||
if (WEXITSTATUS(status) != 0 )
|
if (WEXITSTATUS(status) != 0 )
|
||||||
@ -9015,6 +9017,7 @@ int Oam::glusterctl(GLUSTER_COMMANDS command, std::string argument1, std::string
|
|||||||
|
|
||||||
sleep(5);
|
sleep(5);
|
||||||
command = SUDO + glustercmd + "peer status " + " >> " + tmpdir + "/glusterCommands.log 2>&1";
|
command = SUDO + glustercmd + "peer status " + " >> " + tmpdir + "/glusterCommands.log 2>&1";
|
||||||
|
cout << command << endl;
|
||||||
status = system(command.c_str());
|
status = system(command.c_str());
|
||||||
|
|
||||||
if (WEXITSTATUS(status) != 0 )
|
if (WEXITSTATUS(status) != 0 )
|
||||||
@ -9049,6 +9052,7 @@ int Oam::glusterctl(GLUSTER_COMMANDS command, std::string argument1, std::string
|
|||||||
|
|
||||||
command += "force >> " + tmpdir + "/glusterCommands.log 2>&1";
|
command += "force >> " + tmpdir + "/glusterCommands.log 2>&1";
|
||||||
cout << "Gluster create and start volume dbroot" << itoa(newDbrootID) << "...";
|
cout << "Gluster create and start volume dbroot" << itoa(newDbrootID) << "...";
|
||||||
|
cout << command << endl;
|
||||||
status = system(command.c_str());
|
status = system(command.c_str());
|
||||||
|
|
||||||
if (WEXITSTATUS(status) != 0 )
|
if (WEXITSTATUS(status) != 0 )
|
||||||
@ -9059,7 +9063,8 @@ int Oam::glusterctl(GLUSTER_COMMANDS command, std::string argument1, std::string
|
|||||||
|
|
||||||
if (user != 0)
|
if (user != 0)
|
||||||
{
|
{
|
||||||
command = "gluster volume set dbroot" + itoa(newDbrootID) + " storage.owner-uid " + itoa(user) + " >> " + tmpdir + "/glusterCommands.log 2>&1";;
|
command = SUDO + "gluster volume set dbroot" + itoa(newDbrootID) + " storage.owner-uid " + itoa(user) + " >> " + tmpdir + "/glusterCommands.log 2>&1";;
|
||||||
|
cout << command << endl;
|
||||||
status = system(command.c_str());
|
status = system(command.c_str());
|
||||||
|
|
||||||
if (WEXITSTATUS(status) != 0 )
|
if (WEXITSTATUS(status) != 0 )
|
||||||
@ -9068,7 +9073,8 @@ int Oam::glusterctl(GLUSTER_COMMANDS command, std::string argument1, std::string
|
|||||||
exceptionControl("GLUSTER_ADD", API_FAILURE);
|
exceptionControl("GLUSTER_ADD", API_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
command = "gluster volume set dbroot" + itoa(newDbrootID) + " storage.owner-gid " + itoa(group) + " >> " + tmpdir + "/glusterCommands.log 2>&1";;
|
command = SUDO + "gluster volume set dbroot" + itoa(newDbrootID) + " storage.owner-gid " + itoa(group) + " >> " + tmpdir + "/glusterCommands.log 2>&1";;
|
||||||
|
cout << command << endl;
|
||||||
status = system(command.c_str());
|
status = system(command.c_str());
|
||||||
|
|
||||||
if (WEXITSTATUS(status) != 0 )
|
if (WEXITSTATUS(status) != 0 )
|
||||||
@ -9079,6 +9085,7 @@ int Oam::glusterctl(GLUSTER_COMMANDS command, std::string argument1, std::string
|
|||||||
}
|
}
|
||||||
|
|
||||||
command = SUDO + glustercmd + "volume start dbroot" + itoa(newDbrootID) + " >> " + tmpdir + "/glusterCommands.log 2>&1";
|
command = SUDO + glustercmd + "volume start dbroot" + itoa(newDbrootID) + " >> " + tmpdir + "/glusterCommands.log 2>&1";
|
||||||
|
cout << command << endl;
|
||||||
status = system(command.c_str());
|
status = system(command.c_str());
|
||||||
|
|
||||||
if (WEXITSTATUS(status) != 0 )
|
if (WEXITSTATUS(status) != 0 )
|
||||||
@ -9125,8 +9132,9 @@ int Oam::glusterctl(GLUSTER_COMMANDS command, std::string argument1, std::string
|
|||||||
int status;
|
int status;
|
||||||
writeLog("glusterctl: GLUSTER_DELETE: dbroot = " + dbrootID, LOG_TYPE_DEBUG );
|
writeLog("glusterctl: GLUSTER_DELETE: dbroot = " + dbrootID, LOG_TYPE_DEBUG );
|
||||||
|
|
||||||
command = SUDO + glustercmd + "--mode=script volume stop dbroot" + dbrootID + " >> " + tmpdir + "/glusterCommands.log 2>&1";
|
command = glustercmd + "--mode=script volume stop dbroot" + dbrootID + " >> " + tmpdir + "/glusterCommands.log 2>&1";
|
||||||
|
|
||||||
|
cout << command << endl;
|
||||||
status = system(command.c_str());
|
status = system(command.c_str());
|
||||||
|
|
||||||
if (WEXITSTATUS(status) != 0 )
|
if (WEXITSTATUS(status) != 0 )
|
||||||
@ -9140,6 +9148,7 @@ int Oam::glusterctl(GLUSTER_COMMANDS command, std::string argument1, std::string
|
|||||||
|
|
||||||
command = SUDO + glustercmd + " --mode=script volume delete dbroot" + dbrootID + " >> " + tmpdir + "/glusterCommands.log 2>&1";
|
command = SUDO + glustercmd + " --mode=script volume delete dbroot" + dbrootID + " >> " + tmpdir + "/glusterCommands.log 2>&1";
|
||||||
|
|
||||||
|
cout << command << endl;
|
||||||
status = system(command.c_str());
|
status = system(command.c_str());
|
||||||
|
|
||||||
if (WEXITSTATUS(status) != 0 )
|
if (WEXITSTATUS(status) != 0 )
|
||||||
@ -9161,12 +9170,14 @@ int Oam::glusterctl(GLUSTER_COMMANDS command, std::string argument1, std::string
|
|||||||
command = SUDO + glustercmd + "peer probe " + ipAddress + " >> " + tmpdir + "/glusterCommands.log 2>&1";
|
command = SUDO + glustercmd + "peer probe " + ipAddress + " >> " + tmpdir + "/glusterCommands.log 2>&1";
|
||||||
|
|
||||||
cout << "gluster peer probe " + ipAddress << endl;
|
cout << "gluster peer probe " + ipAddress << endl;
|
||||||
|
cout << command << endl;
|
||||||
status = system(command.c_str());
|
status = system(command.c_str());
|
||||||
|
|
||||||
if (WEXITSTATUS(status) != 0 )
|
if (WEXITSTATUS(status) != 0 )
|
||||||
{
|
{
|
||||||
cout << "ERROR: peer probe command failed." << endl;
|
cout << "ERROR: peer probe command failed." << endl;
|
||||||
command = InstallDir + "/bin/remote_command.sh " + ipAddress + " " + password + " 'stat /var/run/glusterd.pid > /dev/null 2>&1'";
|
command = InstallDir + "/bin/remote_command.sh " + ipAddress + " " + password + " 'stat /var/run/glusterd.pid > /dev/null 2>&1'";
|
||||||
|
cout << command << endl;
|
||||||
status = system(command.c_str());
|
status = system(command.c_str());
|
||||||
|
|
||||||
if (WEXITSTATUS(status) != 0 )
|
if (WEXITSTATUS(status) != 0 )
|
||||||
|
Reference in New Issue
Block a user