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
MCOL-943
This commit is contained in:
@ -463,7 +463,6 @@
|
||||
<DataRedundancyStorageType>unassigned</DataRedundancyStorageType>
|
||||
<CoreFileFlag>n</CoreFileFlag>
|
||||
<MySQLPort>3306</MySQLPort>
|
||||
<MySQLPasswordConfig>unassigned</MySQLPasswordConfig>
|
||||
<AmazonDeviceName>/dev/xvd</AmazonDeviceName>
|
||||
<DistributedInstall>y</DistributedInstall>
|
||||
</Installation>
|
||||
|
@ -458,7 +458,6 @@
|
||||
<JavaHome>unassigned</JavaHome>
|
||||
<JavaPath>unassigned</JavaPath>
|
||||
<MySQLPort>3306</MySQLPort>
|
||||
<MySQLPasswordConfig>unassigned</MySQLPasswordConfig>
|
||||
</Installation>
|
||||
<ExtentMap>
|
||||
<!--
|
||||
|
@ -49,7 +49,7 @@ cat /tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
||||
calpontsys </tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
@ -65,7 +65,7 @@ cat /tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
||||
calpontsys </tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
|
@ -47,7 +47,7 @@ password="Calpont1"
|
||||
#
|
||||
echo "Create Replication User $repUser for node $hostipaddr" >>/tmp/master-rep-status-$hostipaddr.log
|
||||
cat >/tmp/idb_master-rep.sql <<EOD
|
||||
CREATE USER '$repUser'@'$hostipaddr' IDENTIFIED BY '$password';
|
||||
CREATE USER IF NOT EXISTS '$repUser'@'$hostipaddr' IDENTIFIED BY '$password';
|
||||
GRANT REPLICATION SLAVE ON *.* TO '$repUser'@'$hostipaddr';
|
||||
EOD
|
||||
|
||||
@ -55,7 +55,7 @@ cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
@ -73,7 +73,7 @@ cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
@ -89,7 +89,7 @@ cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
|
@ -155,7 +155,13 @@ if [ $module = "um" ] || ( [ $module = "pm" ] && [ $PMwithUM = "y" ] ) || [ $Ser
|
||||
exit 1
|
||||
fi
|
||||
echo "Run post-mysql-install"
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/post-mysql-install --installdir=$COLUMNSTORE_INSTALL_DIR > /tmp/post-mysql-install.log 2>&1
|
||||
|
||||
password=`$COLUMNSTORE_INSTALL_DIR/bin/getMySQLpw`
|
||||
if [ $password = "unassigned" ]; then
|
||||
password=""
|
||||
fi
|
||||
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/post-mysql-install --installdir=$COLUMNSTORE_INSTALL_DIR --password=$password > /tmp/post-mysql-install.log 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: post-mysql-install failed: check /tmp/post-mysql-install.log"
|
||||
exit 1
|
||||
|
@ -60,7 +60,9 @@ cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Run Change Master Command
|
||||
@ -81,7 +83,9 @@ cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Run start slave command
|
||||
@ -95,7 +99,9 @@ cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
#
|
||||
# Run SHOW SLAVE STATUS
|
||||
@ -109,7 +115,7 @@ cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log 2>&1
|
||||
|
||||
checkForError
|
||||
|
||||
|
@ -8727,22 +8727,8 @@ namespace oam
|
||||
* purpose: check and get mysql user password
|
||||
*
|
||||
******************************************************************************************/
|
||||
std::string Oam::getMySQLPassword(bool bypassConfig)
|
||||
std::string Oam::getMySQLPassword()
|
||||
{
|
||||
if ( !bypassConfig )
|
||||
{
|
||||
string MySQLPasswordConfig;
|
||||
try {
|
||||
getSystemConfig("MySQLPasswordConfig", MySQLPasswordConfig);
|
||||
}
|
||||
catch(...) {
|
||||
MySQLPasswordConfig = "n";
|
||||
}
|
||||
|
||||
if ( MySQLPasswordConfig == "n" )
|
||||
return oam::UnassignedName;
|
||||
}
|
||||
|
||||
string USER = "root";
|
||||
char* p= getenv("USER");
|
||||
if (p && *p)
|
||||
@ -8755,10 +8741,15 @@ namespace oam
|
||||
|
||||
string fileName = HOME + "/.my.cnf";
|
||||
|
||||
writeLog("getMySQLPassword: checking: " + fileName, LOG_TYPE_DEBUG);
|
||||
|
||||
ifstream file (fileName.c_str());
|
||||
|
||||
if (!file)
|
||||
{
|
||||
writeLog("getMySQLPassword: doesn't exist: " + fileName, LOG_TYPE_DEBUG);
|
||||
exceptionControl("getMySQLPassword", API_FILE_OPEN_ERROR);
|
||||
}
|
||||
|
||||
char line[400];
|
||||
string buf;
|
||||
@ -8779,16 +8770,10 @@ namespace oam
|
||||
string::size_type pos1 = buf.find("=",pos);
|
||||
if (pos1 != string::npos) {
|
||||
//password found
|
||||
if ( bypassConfig )
|
||||
{
|
||||
try {
|
||||
setSystemConfig("MySQLPasswordConfig", "y");
|
||||
}
|
||||
catch(...) {}
|
||||
}
|
||||
|
||||
string password = buf.substr(pos1+2, 80);
|
||||
|
||||
writeLog("getMySQLPassword: password found", LOG_TYPE_DEBUG);
|
||||
return password;
|
||||
}
|
||||
}
|
||||
@ -8796,7 +8781,9 @@ namespace oam
|
||||
}
|
||||
file.close();
|
||||
|
||||
writeLog("getMySQLPassword: no password found", LOG_TYPE_DEBUG);
|
||||
exceptionControl("getMySQLPassword", API_FAILURE);
|
||||
|
||||
return oam::UnassignedName;
|
||||
}
|
||||
|
||||
|
@ -3416,24 +3416,8 @@ int processCommand(string* arguments)
|
||||
}
|
||||
|
||||
string MySQLRep;
|
||||
string MySQLPasswordConfig;
|
||||
try {
|
||||
oam.getSystemConfig("MySQLRep", MySQLRep);
|
||||
oam.getSystemConfig("MySQLPasswordConfig", MySQLPasswordConfig);
|
||||
}
|
||||
catch(...) {}
|
||||
|
||||
if ( MySQLRep == "y" && MySQLPasswordConfig == oam::UnassignedName ) {
|
||||
cout << endl;
|
||||
string prompt = "MariaDB ColumnStore Replication is enabled, is there a 'MariaDB ColumnStore' Password configured in " + HOME + "/.my.cnf (y,n): ";
|
||||
MySQLPasswordConfig = dataPrompt(prompt);
|
||||
}
|
||||
|
||||
if ( MySQLPasswordConfig != "y" )
|
||||
MySQLPasswordConfig = "n";
|
||||
|
||||
try {
|
||||
oam.setSystemConfig("MySQLPasswordConfig", MySQLPasswordConfig);
|
||||
}
|
||||
catch(...) {}
|
||||
|
||||
@ -5015,26 +4999,6 @@ int processCommand(string* arguments)
|
||||
if ( password == "")
|
||||
password = oam::UnassignedName;
|
||||
|
||||
string MySQLPasswordConfig;
|
||||
try {
|
||||
oam.getSystemConfig("MySQLPasswordConfig", MySQLPasswordConfig);
|
||||
}
|
||||
catch(...) {}
|
||||
|
||||
if ( MySQLPasswordConfig == oam::UnassignedName ) {
|
||||
cout << endl;
|
||||
string prompt = "Is there a 'MariaDB ColumnStore' Password configured on the MariaDB ColumnStore Front-end Modules in " + HOME + "/.my.cnf (y,n): ";
|
||||
MySQLPasswordConfig = dataPrompt(prompt);
|
||||
}
|
||||
|
||||
if ( MySQLPasswordConfig != "y" )
|
||||
MySQLPasswordConfig = "n";
|
||||
|
||||
try {
|
||||
oam.setSystemConfig("MySQLPasswordConfig", MySQLPasswordConfig);
|
||||
}
|
||||
catch(...) {}
|
||||
|
||||
//set flag
|
||||
try {
|
||||
oam.setSystemConfig("MySQLRep", "y");
|
||||
@ -6130,26 +6094,6 @@ int processCommand(string* arguments)
|
||||
break;
|
||||
}
|
||||
|
||||
string MySQLPasswordConfig;
|
||||
try {
|
||||
oam.getSystemConfig("MySQLPasswordConfig", MySQLPasswordConfig);
|
||||
}
|
||||
catch(...) {}
|
||||
|
||||
if ( MySQLPasswordConfig == oam::UnassignedName ) {
|
||||
cout << endl;
|
||||
string prompt = "Is there a 'MariaDB ColumnStore' Password configured on the MariaDB ColumnStore Front-end Modules in " + HOME + "/.my.cnf (y,n): ";
|
||||
MySQLPasswordConfig = dataPrompt(prompt);
|
||||
}
|
||||
|
||||
if ( MySQLPasswordConfig != "y" )
|
||||
MySQLPasswordConfig = "n";
|
||||
|
||||
try {
|
||||
oam.setSystemConfig("MySQLPasswordConfig", MySQLPasswordConfig);
|
||||
}
|
||||
catch(...) {}
|
||||
|
||||
//set flag
|
||||
try {
|
||||
oam.setSystemConfig("MySQLRep", "n");
|
||||
|
@ -57,30 +57,59 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
Oam oam;
|
||||
|
||||
//get mysql user password
|
||||
string mysqlpw = oam::UnassignedName;
|
||||
try {
|
||||
mysqlpw = oam.getMySQLPassword();
|
||||
}
|
||||
catch (...)
|
||||
string USER = "root";
|
||||
char* p= getenv("USER");
|
||||
if (p && *p)
|
||||
USER = p;
|
||||
|
||||
string HOME = "/root";
|
||||
p= getenv("HOME");
|
||||
if (p && *p)
|
||||
HOME = p;
|
||||
|
||||
string fileName = HOME + "/.my.cnf";
|
||||
|
||||
ifstream file (fileName.c_str());
|
||||
|
||||
if (!file)
|
||||
{
|
||||
cout << oam::UnassignedName << endl;
|
||||
exit (1);
|
||||
}
|
||||
|
||||
if ( mysqlpw == oam::UnassignedName ) {
|
||||
cout << oam::UnassignedName << endl;
|
||||
exit (1);
|
||||
}
|
||||
char line[400];
|
||||
string buf;
|
||||
|
||||
cout << mysqlpw << endl;
|
||||
while (file.getline(line, 400))
|
||||
{
|
||||
buf = line;
|
||||
|
||||
try {
|
||||
oam.setSystemConfig("MySQLPasswordConfig", "y");
|
||||
}
|
||||
catch(...) {}
|
||||
string::size_type pos = buf.find(USER,0);
|
||||
if (pos != string::npos)
|
||||
{
|
||||
file.getline(line, 400);
|
||||
buf = line;
|
||||
|
||||
pos = buf.find("password",0);
|
||||
if (pos != string::npos)
|
||||
{
|
||||
string::size_type pos1 = buf.find("=",pos);
|
||||
if (pos1 != string::npos) {
|
||||
//password found
|
||||
|
||||
string password = buf.substr(pos1+2, 80);
|
||||
|
||||
cout << password << endl;
|
||||
exit (0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
file.close();
|
||||
|
||||
cout << oam::UnassignedName << endl;
|
||||
|
||||
exit (1);
|
||||
|
||||
}
|
||||
// vim:ts=4 sw=4:
|
||||
|
@ -874,29 +874,6 @@ bool writeConfig( Config* sysConfig )
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string getmysqlpw(std::string logFile)
|
||||
{
|
||||
ifstream oldFile (logFile.c_str());
|
||||
if (oldFile) {
|
||||
char line[200];
|
||||
string buf;
|
||||
while (oldFile.getline(line, 200))
|
||||
{
|
||||
buf = line;
|
||||
string::size_type pos = buf.find("mysqlpw=",0);
|
||||
if (pos != string::npos)
|
||||
{
|
||||
string mysqlpw = buf.substr(pos+8, 80);
|
||||
// unlink(logFile);
|
||||
return mysqlpw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return oam::UnassignedName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,6 @@ extern bool writeConfig(Config* sysConfig);
|
||||
extern void checkSystemMySQLPort(std::string& mysqlPort, Config* sysConfig, std::string USER, std::string password, ChildModuleList childmodulelist, int IserverTypeInstall, bool pmwithum);
|
||||
extern const char* callReadline(string prompt);
|
||||
extern void callFree(const char* );
|
||||
extern std::string getmysqlpw(std::string logFile);
|
||||
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ string installDir;
|
||||
string HOME = "/root";
|
||||
|
||||
extern string pwprompt;
|
||||
string mysqlpw = " ";
|
||||
string mysqlpw = oam::UnassignedName;
|
||||
|
||||
extern const char* pcommand;
|
||||
extern string prompt;
|
||||
@ -592,11 +592,6 @@ int main(int argc, char *argv[])
|
||||
{}
|
||||
}
|
||||
|
||||
try {
|
||||
oam.setSystemConfig("MySQLPasswordConfig", oam::UnassignedName);
|
||||
}
|
||||
catch(...) {}
|
||||
|
||||
//check for non-Distributed Install
|
||||
if ( nonDistribute )
|
||||
{
|
||||
@ -2971,7 +2966,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
//check for mysql password on remote UM
|
||||
if ( pwprompt == " " ) {
|
||||
/* if ( pwprompt == " " ) {
|
||||
//start mysqld
|
||||
cmd = installDir + "/bin/remote_command.sh " + remoteModuleIP + " " + password + " '" + installDir + "/mysql/mysql-Columnstore start'";
|
||||
int rtnCode = system(cmd.c_str());
|
||||
@ -2999,7 +2994,13 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
//get password from local tmp file
|
||||
mysqlpw = getmysqlpw("/tmp/mysqlpw.log");
|
||||
try {
|
||||
mysqlpw = oam.getMySQLPassword();
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
mysqlpw = oam::UnassignedName;
|
||||
}
|
||||
|
||||
if ( mysqlpw != oam::UnassignedName )
|
||||
{
|
||||
@ -3046,7 +3047,7 @@ int main(int argc, char *argv[])
|
||||
else
|
||||
cout << endl << "post-mysql-install Successfully Completed" << endl;
|
||||
}
|
||||
}
|
||||
*/ }
|
||||
}
|
||||
else
|
||||
{ // do a binary package install
|
||||
@ -3498,14 +3499,15 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
//set mysql replication, if wasn't setup before on system
|
||||
/* if ( ( mysqlRep && pmwithum ) ||
|
||||
( mysqlRep && (umNumber > 1) ) ||
|
||||
( mysqlRep && (pmNumber > 1) && (IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM) ) )
|
||||
// if ( ( mysqlRep && pmwithum ) ||
|
||||
// ( mysqlRep && (umNumber > 1) ) ||
|
||||
// ( mysqlRep && (pmNumber > 1) && (IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM) ) )
|
||||
if ( mysqlRep )
|
||||
{
|
||||
cout << endl << "Run MariaDB ColumnStore Replication Setup.. ";
|
||||
cout.flush();
|
||||
|
||||
//send message to procmon's to run upgrade script
|
||||
//send message to procmon's to run mysql replication script
|
||||
int status = sendReplicationRequest(IserverTypeInstall, password, mysqlPort, pmwithum);
|
||||
|
||||
if ( status != 0 ) {
|
||||
@ -3515,7 +3517,7 @@ int main(int argc, char *argv[])
|
||||
else
|
||||
cout << " DONE" << endl;
|
||||
}
|
||||
*/
|
||||
|
||||
cout << endl << "MariaDB ColumnStore Install Successfully Completed, System is Active" << endl << endl;
|
||||
|
||||
cout << "Enter the following command to define MariaDB ColumnStore Alias Commands" << endl << endl;
|
||||
|
@ -502,6 +502,8 @@ static void startMgrProcessThread()
|
||||
ModuleTypeConfig PMSmoduletypeconfig;
|
||||
ALARMManager aManager;
|
||||
|
||||
int waitTime = 60;
|
||||
|
||||
log.writeLog(__LINE__, "startMgrProcessThread launched", LOG_TYPE_DEBUG);
|
||||
|
||||
//get calpont software version and release
|
||||
@ -597,7 +599,7 @@ static void startMgrProcessThread()
|
||||
{
|
||||
int status = API_SUCCESS;
|
||||
int k = 0;
|
||||
for( ; k < 200 ; k++ )
|
||||
for( ; k < waitTime ; k++ )
|
||||
{
|
||||
if ( startsystemthreadStop ) {
|
||||
processManager.setSystemState(oam::MAN_OFFLINE);
|
||||
@ -641,7 +643,7 @@ static void startMgrProcessThread()
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
if ( k == 200 || status == API_FAILURE) {
|
||||
if ( k == waitTime || status == API_FAILURE) {
|
||||
// system didn't successfull restart
|
||||
processManager.setSystemState(oam::FAILED);
|
||||
// exit thread
|
||||
@ -653,7 +655,7 @@ static void startMgrProcessThread()
|
||||
|
||||
//wait until all modules are up after a system reboot
|
||||
int i = 0;
|
||||
for( ; i < 200 ; i++ )
|
||||
for( ; i < waitTime ; i++ )
|
||||
{
|
||||
if ( startsystemthreadStop ) {
|
||||
processManager.setSystemState(oam::MAN_OFFLINE);
|
||||
@ -719,7 +721,7 @@ static void startMgrProcessThread()
|
||||
break;
|
||||
}
|
||||
|
||||
if ( i == 200 ) {
|
||||
if ( i == waitTime ) {
|
||||
// system didn't successfull restart
|
||||
processManager.setSystemState(oam::FAILED);
|
||||
|
||||
@ -738,7 +740,7 @@ static void startMgrProcessThread()
|
||||
//now wait until all procmons are ACTIVE and validate rpms on each module
|
||||
int status = API_SUCCESS;
|
||||
int k = 0;
|
||||
for( ; k < 200 ; k++ )
|
||||
for( ; k < waitTime ; k++ )
|
||||
{
|
||||
if ( startsystemthreadStop ) {
|
||||
processManager.setSystemState(oam::MAN_OFFLINE);
|
||||
@ -859,7 +861,7 @@ static void startMgrProcessThread()
|
||||
}
|
||||
}
|
||||
|
||||
if ( k == 200 || status == API_FAILURE) {
|
||||
if ( k == waitTime || status == API_FAILURE) {
|
||||
// system didn't successfull restart
|
||||
processManager.setSystemState(oam::FAILED);
|
||||
// exit thread
|
||||
|
@ -1143,7 +1143,7 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
||||
//wait until all child modules are offline or A FAILURE HAS OCCURRED
|
||||
bool failure = false;
|
||||
bool stopped = true;
|
||||
for ( int retry = 0 ; retry < 120 ; retry++ )
|
||||
for ( int retry = 0 ; retry < 30 ; retry++ )
|
||||
{
|
||||
sleep(1);
|
||||
stopped = true;
|
||||
@ -3809,7 +3809,9 @@ void ProcessManager::setSystemState(uint16_t state)
|
||||
aManager.sendAlarmReport(system.c_str(), SYSTEM_DOWN_AUTO, SET);
|
||||
aManager.sendAlarmReport(system.c_str(), CONN_FAILURE, CLEAR);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&STATUS_LOCK);
|
||||
return;
|
||||
}
|
||||
|
||||
/******************************************************************************************
|
||||
@ -3839,6 +3841,7 @@ void ProcessManager::setModuleState(string moduleName, uint16_t state)
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&STATUS_LOCK);
|
||||
return;
|
||||
}
|
||||
|
||||
/******************************************************************************************
|
||||
@ -3867,6 +3870,7 @@ void ProcessManager::setExtdeviceState(string extDeviceName, uint16_t state)
|
||||
// log.writeLog(__LINE__, "EXCEPTION ERROR on setExtDeviceStatus: Caught unknown exception!", LOG_TYPE_ERROR);
|
||||
}
|
||||
pthread_mutex_unlock(&STATUS_LOCK);
|
||||
return;
|
||||
}
|
||||
|
||||
/******************************************************************************************
|
||||
@ -3895,6 +3899,7 @@ void ProcessManager::setNICState(string hostName, uint16_t state)
|
||||
// log.writeLog(__LINE__, "EXCEPTION ERROR on setNICStatus: Caught unknown exception!", LOG_TYPE_ERROR);
|
||||
}
|
||||
pthread_mutex_unlock(&STATUS_LOCK);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -6962,10 +6967,6 @@ void startSystemThread(oam::DeviceNetworkList Devicenetworklist)
|
||||
status = oam::API_FAILURE;
|
||||
}
|
||||
|
||||
log.writeLog(__LINE__, "Setup MySQL Replication for startsystemthread", LOG_TYPE_DEBUG);
|
||||
oam::DeviceNetworkList devicenetworklistRep;
|
||||
processManager.setMySQLReplication(devicenetworklistRep);
|
||||
|
||||
//set query system state not ready
|
||||
processManager.setQuerySystemState(true);
|
||||
|
||||
@ -10224,7 +10225,7 @@ int ProcessManager::setMySQLReplication(oam::DeviceNetworkList devicenetworklist
|
||||
|
||||
//also skip if single-server, multi-node seperate with 1 UM, multi-node combo with 1 PM
|
||||
|
||||
string SingleServerInstall = "n";
|
||||
/* string SingleServerInstall = "n";
|
||||
try {
|
||||
oam.getSystemConfig("SingleServerInstall", SingleServerInstall);
|
||||
}
|
||||
@ -10272,7 +10273,7 @@ int ProcessManager::setMySQLReplication(oam::DeviceNetworkList devicenetworklist
|
||||
return oam::API_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
log.writeLog(__LINE__, "Setup MySQL Replication", LOG_TYPE_DEBUG);
|
||||
|
||||
// mysql port number
|
||||
@ -10323,7 +10324,6 @@ int ProcessManager::setMySQLReplication(oam::DeviceNetworkList devicenetworklist
|
||||
|
||||
if ( returnStatus != API_SUCCESS) {
|
||||
log.writeLog(__LINE__, "setMySQLReplication: ERROR: Error getting MySQL Replication Master Information", LOG_TYPE_ERROR);
|
||||
pthread_mutex_unlock(&THREAD_LOCK);
|
||||
return API_FAILURE;
|
||||
}
|
||||
}
|
||||
@ -10350,7 +10350,6 @@ int ProcessManager::setMySQLReplication(oam::DeviceNetworkList devicenetworklist
|
||||
|
||||
if ( returnStatus != API_SUCCESS) {
|
||||
log.writeLog(__LINE__, "setMySQLReplication: ERROR: Error getting MySQL Replication Master Information", LOG_TYPE_ERROR);
|
||||
pthread_mutex_unlock(&THREAD_LOCK);
|
||||
return API_FAILURE;
|
||||
}
|
||||
}
|
||||
@ -10373,6 +10372,7 @@ int ProcessManager::setMySQLReplication(oam::DeviceNetworkList devicenetworklist
|
||||
|
||||
if ( returnStatus != API_SUCCESS) {
|
||||
log.writeLog(__LINE__, "setMySQLReplication: ERROR: Error getting MySQL Replication Master Information", LOG_TYPE_ERROR);
|
||||
return API_FAILURE;
|
||||
}
|
||||
|
||||
//
|
||||
@ -10440,6 +10440,7 @@ int ProcessManager::setMySQLReplication(oam::DeviceNetworkList devicenetworklist
|
||||
|
||||
if ( returnStatus != API_SUCCESS) {
|
||||
log.writeLog(__LINE__, "setMySQLReplication: ERROR: Error setting MySQL Replication Slave", LOG_TYPE_ERROR);
|
||||
return API_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -10488,6 +10489,7 @@ int ProcessManager::setMySQLReplication(oam::DeviceNetworkList devicenetworklist
|
||||
|
||||
if ( returnStatus != API_SUCCESS) {
|
||||
log.writeLog(__LINE__, "setMySQLReplication: ERROR: Error setting MySQL Replication Slave", LOG_TYPE_ERROR);
|
||||
return API_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -136,7 +136,9 @@ int main(int argc, char **argv)
|
||||
int ret = pthread_create (&MessageThread, NULL, (void*(*)(void*)) &messageThread, &config);
|
||||
if ( ret != 0 ) {
|
||||
log.writeLog(__LINE__, "pthread_create failed, exiting..., return code = " + oam.itoa(ret), LOG_TYPE_CRITICAL);
|
||||
exit (1);
|
||||
string cmd = startup::StartUp::installDir() + "/bin/columnstore stop > /dev/null 2>&1";
|
||||
system(cmd.c_str());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
//check if this is a fresh install, meaning the Columnstore.xml file is not setup
|
||||
@ -181,7 +183,14 @@ int main(int argc, char **argv)
|
||||
log.writeLog(__LINE__, "run module_installer.sh", LOG_TYPE_DEBUG);
|
||||
log.writeLog(__LINE__, cmd, LOG_TYPE_DEBUG);
|
||||
|
||||
int ret = system(cmd.c_str());
|
||||
|
||||
if ( ret != 0 ) {
|
||||
log.writeLog(__LINE__, "module_installer.sh error, exiting..., return code = " + oam.itoa(ret), LOG_TYPE_CRITICAL);
|
||||
string cmd = startup::StartUp::installDir() + "/bin/columnstore stop > /dev/null 2>&1";
|
||||
system(cmd.c_str());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
//exit to allow ProcMon to restart in a setup state
|
||||
log.writeLog(__LINE__, "restarting for a initial setup", LOG_TYPE_DEBUG);
|
||||
|
@ -5036,6 +5036,11 @@ int ProcessMonitor::runMasterRep(std::string& masterLogFile, std::string& master
|
||||
|
||||
bool passwordError = false;
|
||||
|
||||
string moduleType = systemModuleTypeConfig.moduletypeconfig[i].ModuleType;
|
||||
|
||||
if ( (PMwithUM == "n") && (moduleType == "pm") && ( config.ServerInstallType() != oam::INSTALL_COMBINE_DM_UM_PM) )
|
||||
continue;
|
||||
|
||||
HostConfigList::iterator pt1 = (*pt).hostConfigList.begin();
|
||||
while(true) // need in case there is a password retry
|
||||
{
|
||||
@ -5076,7 +5081,7 @@ int ProcessMonitor::runMasterRep(std::string& masterLogFile, std::string& master
|
||||
if ( passwordError )
|
||||
{
|
||||
try {
|
||||
mysqlpw = oam.getMySQLPassword(true);
|
||||
mysqlpw = oam.getMySQLPassword();
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
@ -5226,7 +5231,7 @@ int ProcessMonitor::runSlaveRep(std::string& masterLogFile, std::string& masterL
|
||||
if ( passwordError )
|
||||
{
|
||||
try {
|
||||
mysqlpw = oam.getMySQLPassword(true);
|
||||
mysqlpw = oam.getMySQLPassword();
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
|
Reference in New Issue
Block a user