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
change code for amazon storaeg device name
This commit is contained in:
@ -6156,7 +6156,7 @@ namespace oam
|
||||
catch(...) {}
|
||||
|
||||
string deviceName = boost::get<0>(st);
|
||||
string labelName = boost::get<1>(st);
|
||||
string amazonDeviceName = boost::get<1>(st);
|
||||
|
||||
//attach volumes to local instance
|
||||
retry = 0;
|
||||
@ -6177,7 +6177,7 @@ namespace oam
|
||||
|
||||
//format attached volume
|
||||
cout << " Formatting DBRoot #" << itoa(*pt1) << ", please wait..." << endl;
|
||||
string cmd = "mkfs.ext2 -F " + deviceName + " " + "-L " + labelName + " > /tmp/format.log 2>&1";
|
||||
string cmd = "mkfs.ext2 -F " + amazonDeviceName + " > /tmp/format.log 2>&1";
|
||||
|
||||
writeLog("addDbroot format cmd: " + cmd, LOG_TYPE_DEBUG );
|
||||
|
||||
@ -6188,17 +6188,19 @@ namespace oam
|
||||
|
||||
string volumeNameID = "PMVolumeName" + itoa(*pt1);
|
||||
string deviceNameID = "PMVolumeDeviceName" + itoa(*pt1);
|
||||
string amazonDeviceNameID = "PMVolumeAmazonDeviceName" + itoa(*pt1);
|
||||
|
||||
//write volume and device name
|
||||
try {
|
||||
sysConfig->setConfig(Section, volumeNameID, volumeName);
|
||||
sysConfig->setConfig(Section, deviceNameID, labelName);
|
||||
sysConfig->setConfig(Section, deviceNameID, deviceName);
|
||||
sysConfig->setConfig(Section, amazonDeviceNameID, amazonDeviceName);
|
||||
}
|
||||
catch(...)
|
||||
{}
|
||||
|
||||
//update /etc/fstab with mount
|
||||
string entry = labelName + " " + InstallDir + "/data" + itoa(*pt1) + " ext2 noatime,nodiratime,noauto 0 0";
|
||||
string entry = amazonDeviceName + " " + InstallDir + "/data" + itoa(*pt1) + " ext2 noatime,nodiratime,noauto 0 0";
|
||||
|
||||
//use from addmodule later
|
||||
cmd = "echo " + entry + " >> " + InstallDir + "/local/etc/pm1/fstab";
|
||||
@ -6895,6 +6897,7 @@ namespace oam
|
||||
|
||||
//current amazon max dbroot id support = 190;
|
||||
string PMdeviceName = "/dev/sd";
|
||||
string amazondeviceName = "/dev/xvd";
|
||||
string deviceLetter[] = {"g","h","i","j","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","end"};
|
||||
|
||||
/***************************************************************************
|
||||
@ -6911,7 +6914,7 @@ namespace oam
|
||||
int lid = (dbrootid-1) / 10;
|
||||
int did = dbrootid - (dbrootid * lid);
|
||||
|
||||
return boost::make_tuple(PMdeviceName + deviceLetter[lid] + itoa(did), "LABEL=DBROOT" + itoa(dbrootid));
|
||||
return boost::make_tuple(PMdeviceName + deviceLetter[lid] + itoa(did), amazondeviceName + deviceLetter[lid] + itoa(did));
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
|
@ -2491,7 +2491,6 @@ int main(int argc, char *argv[])
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
string volumeNameID = "PMVolumeName" + *it;
|
||||
string volumeName = oam::UnassignedName;
|
||||
string deviceNameID = "PMVolumeDeviceName" + *it;
|
||||
@ -2503,7 +2502,6 @@ int main(int argc, char *argv[])
|
||||
catch(...)
|
||||
{}
|
||||
|
||||
|
||||
if ( create == "n" ) {
|
||||
prompt = "Enter Volume ID for '" + DBrootID + "' (" + volumeName + ") > ";
|
||||
pcommand = callReadline(prompt.c_str());
|
||||
@ -2512,7 +2510,6 @@ int main(int argc, char *argv[])
|
||||
if (strlen(pcommand) > 0) volumeName = pcommand;
|
||||
callFree(pcommand);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1456,9 +1456,13 @@ int main(int argc, char *argv[])
|
||||
string volumeName = oam::UnassignedName;
|
||||
string deviceNameID = "PMVolumeDeviceName" + oam.itoa(id);
|
||||
string deviceName = oam::UnassignedName;
|
||||
string amazondeviceNameID = "PMVolumeAmazonDeviceName" + oam.itoa(id);
|
||||
string amazondeviceName = oam::UnassignedName;
|
||||
|
||||
try {
|
||||
volumeName = sysConfigOld->getConfig(InstallSection, volumeNameID);
|
||||
deviceName = sysConfigOld->getConfig(InstallSection, deviceNameID);
|
||||
amazondeviceName = sysConfigOld->getConfig(InstallSection, amazondeviceNameID);
|
||||
}
|
||||
catch(...)
|
||||
{}
|
||||
@ -1466,6 +1470,25 @@ int main(int argc, char *argv[])
|
||||
try {
|
||||
sysConfigNew->setConfig(InstallSection, volumeNameID, volumeName);
|
||||
sysConfigNew->setConfig(InstallSection, deviceNameID, deviceName);
|
||||
sysConfigNew->setConfig(InstallSection, amazondeviceNameID, amazondeviceName);
|
||||
}
|
||||
catch(...)
|
||||
{}
|
||||
|
||||
|
||||
string UMVolumeSize = oam::UnassignedName;
|
||||
string PMVolumeSize = oam::UnassignedName;
|
||||
|
||||
try {
|
||||
UMVolumeSize = sysConfigOld->getConfig(InstallSection, "UMVolumeSize");
|
||||
PMVolumeSize = sysConfigOld->getConfig(InstallSection, "PMVolumeSize");
|
||||
}
|
||||
catch(...)
|
||||
{}
|
||||
|
||||
try {
|
||||
sysConfigNew->setConfig(InstallSection, "UMVolumeSize", UMVolumeSize);
|
||||
sysConfigNew->setConfig(InstallSection, "PMVolumeSize", PMVolumeSize);
|
||||
}
|
||||
catch(...)
|
||||
{}
|
||||
|
Reference in New Issue
Block a user