You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-08 14:22:09 +03:00
fix commands again
This commit is contained in:
@@ -83,7 +83,7 @@ if [ "$1" = "deassignElasticIP" ]; then
|
|||||||
echo "Enter Elastic IP Address"
|
echo "Enter Elastic IP Address"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
IPAddress="$2"getType
|
IPAddress="$2"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -150,11 +150,11 @@ getInstance() {
|
|||||||
localIP=`ifconfig eth0 | grep "inet addr:" | awk '{print substr($2,6,20)}'`
|
localIP=`ifconfig eth0 | grep "inet addr:" | awk '{print substr($2,6,20)}'`
|
||||||
|
|
||||||
#get local Instance ID
|
#get local Instance ID
|
||||||
instance=`cat $describeInstanceFile | grep -m 1 $localIP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
instance=`cat $describeInstanceFile | grep -m 1 -w $localIP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||||
if [ "$instance" == "" ]; then
|
if [ "$instance" == "" ]; then
|
||||||
describeInstance
|
describeInstance
|
||||||
fi
|
fi
|
||||||
instance=`cat $describeInstanceFile | grep -m 1 $localIP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
instance=`cat $describeInstanceFile | grep -m 1 -w $localIP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||||
|
|
||||||
echo $instance
|
echo $instance
|
||||||
return
|
return
|
||||||
@@ -170,11 +170,11 @@ getInstancePrivate() {
|
|||||||
localIP=`ifconfig eth0 | grep "inet addr:" | awk '{print substr($2,6,20)}'`
|
localIP=`ifconfig eth0 | grep "inet addr:" | awk '{print substr($2,6,20)}'`
|
||||||
|
|
||||||
#get local Instance ID
|
#get local Instance ID
|
||||||
instance=`cat $describeInstanceFile | grep -m 1 $localIP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
instance=`cat $describeInstanceFile | grep -m 1 -w $localIP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||||
if [ "$instance" == "" ]; then
|
if [ "$instance" == "" ]; then
|
||||||
describeInstance
|
describeInstance
|
||||||
fi
|
fi
|
||||||
instance=`cat $describeInstanceFile | grep -m 1 $localIP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
instance=`cat $describeInstanceFile | grep -m 1 -w $localIP | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $2}'`
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -184,7 +184,7 @@ getZone() {
|
|||||||
#get from Calpont.xml if it's there, if not, get from instance then store
|
#get from Calpont.xml if it's there, if not, get from instance then store
|
||||||
zone=`$prefix/Calpont/bin/getConfig Installation AmazonZone`
|
zone=`$prefix/Calpont/bin/getConfig Installation AmazonZone`
|
||||||
|
|
||||||
if [ "$zone" = "unassigned" ]; then
|
if [ "$zone" = "unassigned" ] || [ "$zone" = "" ]; then
|
||||||
#get local Instance ID
|
#get local Instance ID
|
||||||
getInstancePrivate >/dev/null 2>&1
|
getInstancePrivate >/dev/null 2>&1
|
||||||
#get zone
|
#get zone
|
||||||
@@ -196,11 +196,11 @@ getZone() {
|
|||||||
zone=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $11}'`
|
zone=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $11}'`
|
||||||
|
|
||||||
else
|
else
|
||||||
zone=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $10}'`
|
zone=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $11}'`
|
||||||
if [ "$zone" == "" ]; then
|
if [ "$zone" == "" ]; then
|
||||||
describeInstance
|
describeInstance
|
||||||
fi
|
fi
|
||||||
zone=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $10}'`
|
zone=`cat $describeInstanceFile | grep -m 1 $instance | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $11}'`
|
||||||
fi
|
fi
|
||||||
$prefix/Calpont/bin/setConfig Installation AmazonZone $zone
|
$prefix/Calpont/bin/setConfig Installation AmazonZone $zone
|
||||||
fi
|
fi
|
||||||
@@ -494,6 +494,7 @@ getSubnet() {
|
|||||||
echo $subnet
|
echo $subnet
|
||||||
else
|
else
|
||||||
echo "failed"
|
echo "failed"
|
||||||
|
fi
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@@ -715,51 +715,6 @@ int main(int argc, char *argv[])
|
|||||||
if ( MySQLRep == "y" )
|
if ( MySQLRep == "y" )
|
||||||
mysqlRep = true;
|
mysqlRep = true;
|
||||||
|
|
||||||
string answer = "n";
|
|
||||||
while(true) {
|
|
||||||
if ( !mysqlRep )
|
|
||||||
prompt = "Enable MySQL Replication feature? [y,n] (n) > ";
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
|
|
||||||
pcommand = callReadline(prompt.c_str());
|
|
||||||
if (pcommand) {
|
|
||||||
if (strlen(pcommand) > 0) answer = pcommand;
|
|
||||||
callFree(pcommand);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( answer == "y" || answer == "n" ) {
|
|
||||||
cout << endl;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
cout << "Invalid Entry, please enter 'y' for yes or 'n' for no" << endl;
|
|
||||||
if ( noPrompting )
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( answer == "y" ) {
|
|
||||||
mysqlRep = true;
|
|
||||||
MySQLRep = "y";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( MySQLRep == "y" )
|
|
||||||
mysqlRep = true;
|
|
||||||
else
|
|
||||||
mysqlRep = false;
|
|
||||||
|
|
||||||
try {
|
|
||||||
sysConfig->setConfig(InstallSection, "PMwithUM", PMwithUM);
|
|
||||||
}
|
|
||||||
catch(...)
|
|
||||||
{}
|
|
||||||
|
|
||||||
try {
|
|
||||||
sysConfig->setConfig(InstallSection, "MySQLRep", MySQLRep);
|
|
||||||
}
|
|
||||||
catch(...)
|
|
||||||
{}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: // normal, separate UM and PM
|
default: // normal, separate UM and PM
|
||||||
@@ -825,42 +780,6 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !pmwithum )
|
|
||||||
{
|
|
||||||
answer = "n";
|
|
||||||
while(true) {
|
|
||||||
if ( mysqlRep )
|
|
||||||
prompt = "Enable MySQL Replication feature? [y,n] (n) > ";
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
|
|
||||||
pcommand = callReadline(prompt.c_str());
|
|
||||||
if (pcommand) {
|
|
||||||
if (strlen(pcommand) > 0) answer = pcommand;
|
|
||||||
callFree(pcommand);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( answer == "y" || answer == "n" ) {
|
|
||||||
cout << endl;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
cout << "Invalid Entry, please enter 'y' for yes or 'n' for no" << endl;
|
|
||||||
if ( noPrompting )
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( answer == "y" ) {
|
|
||||||
mysqlRep = true;
|
|
||||||
MySQLRep = "y";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( MySQLRep == "y" )
|
|
||||||
mysqlRep = true;
|
|
||||||
else
|
|
||||||
mysqlRep = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
sysConfig->setConfig(InstallSection, "PMwithUM", PMwithUM);
|
sysConfig->setConfig(InstallSection, "PMwithUM", PMwithUM);
|
||||||
}
|
}
|
||||||
@@ -1483,12 +1402,34 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( moduleType == "pm" )
|
if ( moduleType == "pm" ) {
|
||||||
pmNumber = moduleCount;
|
pmNumber = moduleCount;
|
||||||
|
|
||||||
if ( moduleType == "um" )
|
if ( pmNumber > 1 && ( IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM ) )
|
||||||
|
{
|
||||||
|
mysqlRep = true;
|
||||||
|
try {
|
||||||
|
sysConfig->setConfig(InstallSection, "MySQLRep", "y");
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
|
{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( moduleType == "um" ) {
|
||||||
umNumber = moduleCount;
|
umNumber = moduleCount;
|
||||||
|
|
||||||
|
if ( umNumber > 1 )
|
||||||
|
{
|
||||||
|
mysqlRep = true;
|
||||||
|
try {
|
||||||
|
sysConfig->setConfig(InstallSection, "MySQLRep", "y");
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
|
{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int moduleID = 1;
|
int moduleID = 1;
|
||||||
|
|
||||||
int listSize = sysModuleTypeConfig.moduletypeconfig[i].ModuleNetworkList.size();
|
int listSize = sysModuleTypeConfig.moduletypeconfig[i].ModuleNetworkList.size();
|
||||||
|
@@ -4737,9 +4737,14 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
|
|||||||
sysConfig->setConfig(Section, "Port", "8622");
|
sysConfig->setConfig(Section, "Port", "8622");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool setMysqlRep = false;
|
||||||
|
|
||||||
if ( moduleType == "um" ||
|
if ( moduleType == "um" ||
|
||||||
( moduleType == "pm" && config.ServerInstallType() == oam::INSTALL_COMBINE_DM_UM_PM ) ||
|
( moduleType == "pm" && config.ServerInstallType() == oam::INSTALL_COMBINE_DM_UM_PM ) ||
|
||||||
( moduleType == "pm" && PMwithUM == "y") ) {
|
( moduleType == "pm" && PMwithUM == "y") ) {
|
||||||
|
|
||||||
|
setMysqlRep = true;
|
||||||
|
|
||||||
listPT = devicenetworklist.begin();
|
listPT = devicenetworklist.begin();
|
||||||
for( ; listPT != devicenetworklist.end() ; listPT++)
|
for( ; listPT != devicenetworklist.end() ; listPT++)
|
||||||
{
|
{
|
||||||
@@ -5229,10 +5234,25 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
|
|||||||
sleep(30);
|
sleep(30);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//check and add MySQL Replication slave
|
||||||
|
string MySQLRep;
|
||||||
|
try {
|
||||||
|
oam.getSystemConfig("MySQLRep", MySQLRep);
|
||||||
|
}
|
||||||
|
catch(...) {
|
||||||
|
MySQLRep = "n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( MySQLRep == "n" && setMysqlRep ) {
|
||||||
|
try {
|
||||||
|
oam.setSystemConfig("MySQLRep", "y");
|
||||||
|
}
|
||||||
|
catch(...) {}
|
||||||
|
}
|
||||||
|
|
||||||
//distribute config file
|
//distribute config file
|
||||||
distributeConfigFile("system");
|
distributeConfigFile("system");
|
||||||
|
|
||||||
//add MySQL Replication slave
|
|
||||||
log.writeLog(__LINE__, "Setup MySQL Replication for new Modules being Added", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "Setup MySQL Replication for new Modules being Added", LOG_TYPE_DEBUG);
|
||||||
processManager.setMySQLReplication(devicenetworklist, oam::UnassignedName, false, true, password );
|
processManager.setMySQLReplication(devicenetworklist, oam::UnassignedName, false, true, password );
|
||||||
|
|
||||||
@@ -5247,6 +5267,10 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
|
|||||||
******************************************************************************************/
|
******************************************************************************************/
|
||||||
int ProcessManager::removeModule(oam::DeviceNetworkList devicenetworklist, bool manualFlag)
|
int ProcessManager::removeModule(oam::DeviceNetworkList devicenetworklist, bool manualFlag)
|
||||||
{
|
{
|
||||||
|
ProcessLog log;
|
||||||
|
Configuration config;
|
||||||
|
ProcessManager processManager(config, log);
|
||||||
|
|
||||||
ModuleTypeConfig moduletypeconfig;
|
ModuleTypeConfig moduletypeconfig;
|
||||||
ModuleTypeConfig setmoduletypeconfig;
|
ModuleTypeConfig setmoduletypeconfig;
|
||||||
Oam oam;
|
Oam oam;
|
||||||
@@ -5588,6 +5612,21 @@ int ProcessManager::removeModule(oam::DeviceNetworkList devicenetworklist, bool
|
|||||||
//distribute config file
|
//distribute config file
|
||||||
distributeConfigFile("system");
|
distributeConfigFile("system");
|
||||||
|
|
||||||
|
string password;
|
||||||
|
// check if there is a root password stored
|
||||||
|
string rpw = oam::UnassignedName;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
oam.getSystemConfig("rpw", password);
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
|
{
|
||||||
|
rpw = "root";
|
||||||
|
}
|
||||||
|
|
||||||
|
log.writeLog(__LINE__, "Setup MySQL Replication for new Modules being Added", LOG_TYPE_DEBUG);
|
||||||
|
processManager.setMySQLReplication(devicenetworklist, oam::UnassignedName, false, true, password );
|
||||||
|
|
||||||
return API_SUCCESS;
|
return API_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9966,8 +10005,17 @@ int ProcessManager::setMySQLReplication(oam::DeviceNetworkList devicenetworklist
|
|||||||
if ( config.ServerInstallType() == oam::INSTALL_COMBINE_DM_UM_PM && !failover ) {
|
if ( config.ServerInstallType() == oam::INSTALL_COMBINE_DM_UM_PM && !failover ) {
|
||||||
try {
|
try {
|
||||||
Config* sysConfig = Config::makeConfig();
|
Config* sysConfig = Config::makeConfig();
|
||||||
if ( sysConfig->getConfig("DBRM_Controller", "NumWorkers") == "1" )
|
if ( sysConfig->getConfig("DBRM_Controller", "NumWorkers") == "1" ) {
|
||||||
return oam::API_SUCCESS;
|
//disable mysqlrep
|
||||||
|
log.writeLog(__LINE__, "Disable MySQL Replication", LOG_TYPE_DEBUG);
|
||||||
|
try {
|
||||||
|
oam.setSystemConfig("MySQLRep", "n");
|
||||||
|
}
|
||||||
|
catch(...) {}
|
||||||
|
|
||||||
|
enable = false;
|
||||||
|
distributeDB = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
@@ -9985,7 +10033,17 @@ int ProcessManager::setMySQLReplication(oam::DeviceNetworkList devicenetworklist
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
if ( moduletypeconfig.ModuleCount < 1 )
|
if ( moduletypeconfig.ModuleCount < 1 )
|
||||||
return oam::API_SUCCESS;
|
{
|
||||||
|
//disable mysqlrep
|
||||||
|
log.writeLog(__LINE__, "Disable MySQL Replication", LOG_TYPE_DEBUG);
|
||||||
|
try {
|
||||||
|
oam.setSystemConfig("MySQLRep", "n");
|
||||||
|
}
|
||||||
|
catch(...) {}
|
||||||
|
|
||||||
|
enable = false;
|
||||||
|
distributeDB = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.writeLog(__LINE__, "Setup MySQL Replication", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "Setup MySQL Replication", LOG_TYPE_DEBUG);
|
||||||
|
Reference in New Issue
Block a user