You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
mcol-943
This commit is contained in:
@ -463,7 +463,6 @@
|
|||||||
<GlusterStorageType>unassigned</GlusterStorageType>
|
<GlusterStorageType>unassigned</GlusterStorageType>
|
||||||
<CoreFileFlag>n</CoreFileFlag>
|
<CoreFileFlag>n</CoreFileFlag>
|
||||||
<MySQLPort>3306</MySQLPort>
|
<MySQLPort>3306</MySQLPort>
|
||||||
<MySQLPasswordConfig>unassigned</MySQLPasswordConfig>
|
|
||||||
<AmazonDeviceName>/dev/xvd</AmazonDeviceName>
|
<AmazonDeviceName>/dev/xvd</AmazonDeviceName>
|
||||||
</Installation>
|
</Installation>
|
||||||
<ExtentMap>
|
<ExtentMap>
|
||||||
|
@ -458,7 +458,6 @@
|
|||||||
<JavaHome>unassigned</JavaHome>
|
<JavaHome>unassigned</JavaHome>
|
||||||
<JavaPath>unassigned</JavaPath>
|
<JavaPath>unassigned</JavaPath>
|
||||||
<MySQLPort>3306</MySQLPort>
|
<MySQLPort>3306</MySQLPort>
|
||||||
<MySQLPasswordConfig>unassigned</MySQLPasswordConfig>
|
|
||||||
</Installation>
|
</Installation>
|
||||||
<ExtentMap>
|
<ExtentMap>
|
||||||
<!--
|
<!--
|
||||||
|
@ -49,7 +49,7 @@ cat /tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
|||||||
$installdir/mysql/bin/mysql \
|
$installdir/mysql/bin/mysql \
|
||||||
--defaults-file=$installdir/mysql/my.cnf \
|
--defaults-file=$installdir/mysql/my.cnf \
|
||||||
--user=root $pwprompt \
|
--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
|
checkForError
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ cat /tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
|||||||
$installdir/mysql/bin/mysql \
|
$installdir/mysql/bin/mysql \
|
||||||
--defaults-file=$installdir/mysql/my.cnf \
|
--defaults-file=$installdir/mysql/my.cnf \
|
||||||
--user=root $pwprompt \
|
--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
|
checkForError
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ password="Calpont1"
|
|||||||
#
|
#
|
||||||
echo "Create Replication User $repUser for node $hostipaddr" >>/tmp/master-rep-status-$hostipaddr.log
|
echo "Create Replication User $repUser for node $hostipaddr" >>/tmp/master-rep-status-$hostipaddr.log
|
||||||
cat >/tmp/idb_master-rep.sql <<EOD
|
cat >/tmp/idb_master-rep.sql <<EOD
|
||||||
CREATE USER '$repUser'@'$hostipaddr' IDENTIFIED BY '$password';
|
CREATE USER IF NOT EXIST '$repUser'@'$hostipaddr' IDENTIFIED BY '$password';
|
||||||
GRANT REPLICATION SLAVE ON *.* TO '$repUser'@'$hostipaddr';
|
GRANT REPLICATION SLAVE ON *.* TO '$repUser'@'$hostipaddr';
|
||||||
EOD
|
EOD
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
|||||||
$installdir/mysql/bin/mysql \
|
$installdir/mysql/bin/mysql \
|
||||||
--defaults-file=$installdir/mysql/my.cnf \
|
--defaults-file=$installdir/mysql/my.cnf \
|
||||||
--user=root $pwprompt \
|
--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
|
checkForError
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
|||||||
$installdir/mysql/bin/mysql \
|
$installdir/mysql/bin/mysql \
|
||||||
--defaults-file=$installdir/mysql/my.cnf \
|
--defaults-file=$installdir/mysql/my.cnf \
|
||||||
--user=root $pwprompt \
|
--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
|
checkForError
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
|||||||
$installdir/mysql/bin/mysql \
|
$installdir/mysql/bin/mysql \
|
||||||
--defaults-file=$installdir/mysql/my.cnf \
|
--defaults-file=$installdir/mysql/my.cnf \
|
||||||
--user=root $pwprompt \
|
--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
|
checkForError
|
||||||
|
|
||||||
@ -102,9 +102,11 @@ cat /tmp/idb_master-rep.sql >/tmp/show-master-status.log
|
|||||||
$installdir/mysql/bin/mysql \
|
$installdir/mysql/bin/mysql \
|
||||||
--defaults-file=$installdir/mysql/my.cnf \
|
--defaults-file=$installdir/mysql/my.cnf \
|
||||||
--user=root $pwprompt \
|
--user=root $pwprompt \
|
||||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/show-master-status.log
|
calpontsys </tmp/idb_master-rep.sql >>/tmp/show-master-status.log 2>&1
|
||||||
|
|
||||||
|
|
||||||
|
checkForError
|
||||||
|
|
||||||
#alls good, 'OK' for success
|
#alls good, 'OK' for success
|
||||||
echo "OK"
|
echo "OK"
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -142,19 +142,26 @@ if [ -n "$plugin" ]; then
|
|||||||
echo ". $COLUMNSTORE_INSTALL_DIR/bin/$setenv" >> ${bashFile}
|
echo ". $COLUMNSTORE_INSTALL_DIR/bin/$setenv" >> ${bashFile}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if mysqlrep is on and module has a my.cnf file, upgrade it
|
# if um, run mysql install scripts
|
||||||
|
if [ $module = "um" ] || ( [ $module = "pm" ] && [ $PMwithUM = "y" ] ) || [ $ServerTypeInstall = "2" ]; then
|
||||||
MySQLRep=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation MySQLRep`
|
echo "Run post-mysqld-install"
|
||||||
if [ $MySQLRep = "y" ]; then
|
$COLUMNSTORE_INSTALL_DIR/bin/post-mysqld-install --installdir=$COLUMNSTORE_INSTALL_DIR > /tmp/post-mysqld-install.log 2>&1
|
||||||
if test -f $COLUMNSTORE_INSTALL_DIR/mysql/my.cnf ; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Run Upgrade on my.cnf on Module"
|
echo "ERROR: post-mysqld-install failed: check /tmp/post-mysqld-install.log"
|
||||||
$COLUMNSTORE_INSTALL_DIR/bin/mycnfUpgrade > /tmp/mycnfUpgrade.log 2>&1
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Run post-mysql-install"
|
||||||
|
|
||||||
|
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
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
if test -f $COLUMNSTORE_INSTALL_DIR/mysql/my.cnf ; then
|
|
||||||
echo "Run Mysql Port update on my.cnf on Module"
|
|
||||||
$COLUMNSTORE_INSTALL_DIR/bin/mycnfUpgrade $mysqlPort > /tmp/mycnfUpgrade_port.log 2>&1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if um, run mysql install scripts
|
# if um, run mysql install scripts
|
||||||
|
@ -60,7 +60,9 @@ cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
|||||||
$installdir/mysql/bin/mysql \
|
$installdir/mysql/bin/mysql \
|
||||||
--defaults-file=$installdir/mysql/my.cnf \
|
--defaults-file=$installdir/mysql/my.cnf \
|
||||||
--user=root $pwprompt \
|
--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
|
# Run Change Master Command
|
||||||
@ -81,7 +83,9 @@ cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
|||||||
$installdir/mysql/bin/mysql \
|
$installdir/mysql/bin/mysql \
|
||||||
--defaults-file=$installdir/mysql/my.cnf \
|
--defaults-file=$installdir/mysql/my.cnf \
|
||||||
--user=root $pwprompt \
|
--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
|
# Run start slave command
|
||||||
@ -95,7 +99,9 @@ cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
|||||||
$installdir/mysql/bin/mysql \
|
$installdir/mysql/bin/mysql \
|
||||||
--defaults-file=$installdir/mysql/my.cnf \
|
--defaults-file=$installdir/mysql/my.cnf \
|
||||||
--user=root $pwprompt \
|
--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
|
# Run SHOW SLAVE STATUS
|
||||||
@ -109,7 +115,7 @@ cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
|||||||
$installdir/mysql/bin/mysql \
|
$installdir/mysql/bin/mysql \
|
||||||
--defaults-file=$installdir/mysql/my.cnf \
|
--defaults-file=$installdir/mysql/my.cnf \
|
||||||
--user=root $pwprompt \
|
--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
|
checkForError
|
||||||
|
|
||||||
|
@ -1260,10 +1260,10 @@ namespace oam
|
|||||||
*
|
*
|
||||||
********************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
void Oam::addModule(DeviceNetworkList devicenetworklist, const std::string password, const std::string mysqlpw)
|
void Oam::addModule(DeviceNetworkList devicenetworklist, const std::string password)
|
||||||
{
|
{
|
||||||
// build and send msg
|
// build and send msg
|
||||||
int returnStatus = sendMsgToProcMgr2(ADDMODULE, devicenetworklist, FORCEFUL, ACK_YES, password, mysqlpw);
|
int returnStatus = sendMsgToProcMgr2(ADDMODULE, devicenetworklist, FORCEFUL, ACK_YES, password);
|
||||||
|
|
||||||
if (returnStatus != API_SUCCESS)
|
if (returnStatus != API_SUCCESS)
|
||||||
exceptionControl("addModule", returnStatus);
|
exceptionControl("addModule", returnStatus);
|
||||||
@ -8550,22 +8550,10 @@ namespace oam
|
|||||||
* purpose: check and get mysql user password
|
* purpose: check and get mysql user password
|
||||||
*
|
*
|
||||||
******************************************************************************************/
|
******************************************************************************************/
|
||||||
std::string Oam::getMySQLPassword(bool bypassConfig)
|
std::string Oam::getMySQLPassword()
|
||||||
{
|
{
|
||||||
if ( !bypassConfig )
|
string mysqlUser = "root";
|
||||||
{
|
|
||||||
string MySQLPasswordConfig;
|
|
||||||
try {
|
|
||||||
getSystemConfig("MySQLPasswordConfig", MySQLPasswordConfig);
|
|
||||||
}
|
|
||||||
catch(...) {
|
|
||||||
MySQLPasswordConfig = "n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( MySQLPasswordConfig == "n" )
|
|
||||||
return oam::UnassignedName;
|
|
||||||
}
|
|
||||||
|
|
||||||
string USER = "root";
|
string USER = "root";
|
||||||
char* p= getenv("USER");
|
char* p= getenv("USER");
|
||||||
if (p && *p)
|
if (p && *p)
|
||||||
@ -8578,10 +8566,15 @@ namespace oam
|
|||||||
|
|
||||||
string fileName = HOME + "/.my.cnf";
|
string fileName = HOME + "/.my.cnf";
|
||||||
|
|
||||||
|
writeLog("getMySQLPassword: checking: " + fileName, LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
ifstream file (fileName.c_str());
|
ifstream file (fileName.c_str());
|
||||||
|
|
||||||
if (!file)
|
if (!file)
|
||||||
|
{
|
||||||
|
writeLog("getMySQLPassword: doesn't exist: " + fileName, LOG_TYPE_DEBUG);
|
||||||
exceptionControl("getMySQLPassword", API_FILE_OPEN_ERROR);
|
exceptionControl("getMySQLPassword", API_FILE_OPEN_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
char line[400];
|
char line[400];
|
||||||
string buf;
|
string buf;
|
||||||
@ -8589,8 +8582,8 @@ namespace oam
|
|||||||
while (file.getline(line, 400))
|
while (file.getline(line, 400))
|
||||||
{
|
{
|
||||||
buf = line;
|
buf = line;
|
||||||
|
string::size_type pos = buf.find(mysqlUser,0);
|
||||||
string::size_type pos = buf.find(USER,0);
|
|
||||||
if (pos != string::npos)
|
if (pos != string::npos)
|
||||||
{
|
{
|
||||||
file.getline(line, 400);
|
file.getline(line, 400);
|
||||||
@ -8602,24 +8595,23 @@ namespace oam
|
|||||||
string::size_type pos1 = buf.find("=",pos);
|
string::size_type pos1 = buf.find("=",pos);
|
||||||
if (pos1 != string::npos) {
|
if (pos1 != string::npos) {
|
||||||
//password found
|
//password found
|
||||||
if ( bypassConfig )
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
setSystemConfig("MySQLPasswordConfig", "y");
|
|
||||||
}
|
|
||||||
catch(...) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
string password = buf.substr(pos1+2, 80);
|
string password = buf.substr(pos1+1, 80);
|
||||||
|
password.erase(remove_if(password.begin(), password.end(), ::isspace), password.end());
|
||||||
|
|
||||||
|
writeLog("getMySQLPassword: password found", LOG_TYPE_DEBUG);
|
||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
writeLog("getMySQLPassword: no password found", LOG_TYPE_DEBUG);
|
||||||
exceptionControl("getMySQLPassword", API_FAILURE);
|
exceptionControl("getMySQLPassword", API_FAILURE);
|
||||||
|
|
||||||
return oam::UnassignedName;
|
return oam::UnassignedName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1468,7 +1468,7 @@ namespace oam
|
|||||||
* @param DeviceNetworkConfig the Modules added
|
* @param DeviceNetworkConfig the Modules added
|
||||||
* @param password Host Root Password
|
* @param password Host Root Password
|
||||||
*/
|
*/
|
||||||
EXPORT void addModule(DeviceNetworkList devicenetworklist, const std::string password, const std::string mysqlpw);
|
EXPORT void addModule(DeviceNetworkList devicenetworklist, const std::string password);
|
||||||
|
|
||||||
/** @brief remove Module
|
/** @brief remove Module
|
||||||
*
|
*
|
||||||
@ -2449,7 +2449,7 @@ namespace oam
|
|||||||
|
|
||||||
/** @brief check and get mysql user password
|
/** @brief check and get mysql user password
|
||||||
*/
|
*/
|
||||||
EXPORT std::string getMySQLPassword(bool bypassConfig = false);
|
EXPORT std::string getMySQLPassword();
|
||||||
|
|
||||||
/** @brief update fstab with dbroot mounts
|
/** @brief update fstab with dbroot mounts
|
||||||
*/
|
*/
|
||||||
|
@ -3402,7 +3402,6 @@ int processCommand(string* arguments)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (bNeedsConfirm)
|
if (bNeedsConfirm)
|
||||||
{
|
{
|
||||||
// confirm request
|
// confirm request
|
||||||
@ -3411,24 +3410,8 @@ int processCommand(string* arguments)
|
|||||||
}
|
}
|
||||||
|
|
||||||
string MySQLRep;
|
string MySQLRep;
|
||||||
string MySQLPasswordConfig;
|
|
||||||
try {
|
try {
|
||||||
oam.getSystemConfig("MySQLRep", MySQLRep);
|
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(...) {}
|
catch(...) {}
|
||||||
|
|
||||||
@ -4960,26 +4943,6 @@ int processCommand(string* arguments)
|
|||||||
if ( password == "")
|
if ( password == "")
|
||||||
password = oam::UnassignedName;
|
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
|
//set flag
|
||||||
try {
|
try {
|
||||||
oam.setSystemConfig("MySQLRep", "y");
|
oam.setSystemConfig("MySQLRep", "y");
|
||||||
@ -5451,8 +5414,6 @@ int processCommand(string* arguments)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string mysqlpassword = oam::UnassignedName;
|
|
||||||
|
|
||||||
try{
|
try{
|
||||||
cout << endl << "Adding Modules ";
|
cout << endl << "Adding Modules ";
|
||||||
DeviceNetworkList::iterator pt = devicenetworklist.begin();
|
DeviceNetworkList::iterator pt = devicenetworklist.begin();
|
||||||
@ -5464,7 +5425,7 @@ int processCommand(string* arguments)
|
|||||||
|
|
||||||
cout << "please wait..." << endl;
|
cout << "please wait..." << endl;
|
||||||
|
|
||||||
oam.addModule(devicenetworklist, password, mysqlpassword);
|
oam.addModule(devicenetworklist, password);
|
||||||
|
|
||||||
cout << "Add Module(s) successfully completed" << endl;
|
cout << "Add Module(s) successfully completed" << endl;
|
||||||
|
|
||||||
@ -5940,26 +5901,6 @@ int processCommand(string* arguments)
|
|||||||
break;
|
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
|
//set flag
|
||||||
try {
|
try {
|
||||||
oam.setSystemConfig("MySQLRep", "n");
|
oam.setSystemConfig("MySQLRep", "n");
|
||||||
|
@ -57,30 +57,59 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
Oam oam;
|
Oam oam;
|
||||||
|
|
||||||
//get mysql user password
|
string USER = "root";
|
||||||
string mysqlpw = oam::UnassignedName;
|
char* p= getenv("USER");
|
||||||
try {
|
if (p && *p)
|
||||||
mysqlpw = oam.getMySQLPassword();
|
USER = p;
|
||||||
}
|
|
||||||
catch (...)
|
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;
|
cout << oam::UnassignedName << endl;
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( mysqlpw == oam::UnassignedName ) {
|
char line[400];
|
||||||
cout << oam::UnassignedName << endl;
|
string buf;
|
||||||
exit (1);
|
|
||||||
|
while (file.getline(line, 400))
|
||||||
|
{
|
||||||
|
buf = line;
|
||||||
|
|
||||||
|
string::size_type pos = buf.find("root",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;
|
||||||
|
|
||||||
cout << mysqlpw << endl;
|
exit (1);
|
||||||
|
|
||||||
try {
|
|
||||||
oam.setSystemConfig("MySQLPasswordConfig", "y");
|
|
||||||
}
|
|
||||||
catch(...) {}
|
|
||||||
|
|
||||||
exit (0);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// vim:ts=4 sw=4:
|
// vim:ts=4 sw=4:
|
||||||
|
@ -874,29 +874,6 @@ bool writeConfig( Config* sysConfig )
|
|||||||
return false;
|
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 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 const char* callReadline(string prompt);
|
||||||
extern void callFree(const char* );
|
extern void callFree(const char* );
|
||||||
extern std::string getmysqlpw(std::string logFile);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ string installDir;
|
|||||||
string HOME = "/root";
|
string HOME = "/root";
|
||||||
|
|
||||||
extern string pwprompt;
|
extern string pwprompt;
|
||||||
string mysqlpw = " ";
|
string mysqlpw = oam::UnassignedName;
|
||||||
|
|
||||||
extern const char* pcommand;
|
extern const char* pcommand;
|
||||||
extern string prompt;
|
extern string prompt;
|
||||||
@ -439,14 +439,6 @@ int main(int argc, char *argv[])
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//if binary install, then run post-install just in case the user didnt run it
|
|
||||||
if ( EEPackageType == "binary" )
|
|
||||||
{
|
|
||||||
//run post install
|
|
||||||
cmd = installDir + "/bin/post-install --installdir=" + installDir + " > /dev/null 2>&1";
|
|
||||||
system(cmd.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
//check Config saved files
|
//check Config saved files
|
||||||
if ( !checkSaveConfigFile())
|
if ( !checkSaveConfigFile())
|
||||||
{
|
{
|
||||||
@ -554,11 +546,6 @@ int main(int argc, char *argv[])
|
|||||||
{}
|
{}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
oam.setSystemConfig("MySQLPasswordConfig", oam::UnassignedName);
|
|
||||||
}
|
|
||||||
catch(...) {}
|
|
||||||
|
|
||||||
cout << endl;
|
cout << endl;
|
||||||
|
|
||||||
cout << "===== Setup System Server Type Configuration =====" << endl << endl;
|
cout << "===== Setup System Server Type Configuration =====" << endl << endl;
|
||||||
@ -2896,83 +2883,6 @@ int main(int argc, char *argv[])
|
|||||||
cout << endl << "Error returned from user_installer.sh" << endl;
|
cout << endl << "Error returned from user_installer.sh" << endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//check for mysql password on remote UM
|
|
||||||
if ( pwprompt == " " ) {
|
|
||||||
//start mysqld
|
|
||||||
cmd = installDir + "/bin/remote_command.sh " + remoteModuleIP + " " + password + " '" + installDir + "/mysql/mysql-Columnstore start'";
|
|
||||||
int rtnCode = system(cmd.c_str());
|
|
||||||
if (WEXITSTATUS(rtnCode) != 0) {
|
|
||||||
cout << endl << "Error returned from mysql-Columnstore start" << endl;
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
//try to login
|
|
||||||
cmd = installDir + "/bin/remote_command.sh " + remoteModuleIP + " " + password + " '" + installDir + "/mysql/bin/mysql --defaults-file=" + installDir + "/mysql/my.cnf -u root " + pwprompt + " -e status' 1 > /tmp/idbmysql.log 2>&1";
|
|
||||||
rtnCode = system(cmd.c_str());
|
|
||||||
if (WEXITSTATUS(rtnCode) != 0) {
|
|
||||||
cout << endl << "Error returned from remote_command.sh" << endl;
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (oam.checkLogStatus("/tmp/idbmysql.log", "ERROR .my.cnf") ) {
|
|
||||||
// password needed check and get password from remote UM
|
|
||||||
cmd = installDir + "/bin/remote_command.sh " + remoteModuleIP + " " + password + " '" + installDir + "bin/getMySQLpw > /tmp/mysqlpw.log 2>&1";
|
|
||||||
rtnCode = system(cmd.c_str());
|
|
||||||
if (WEXITSTATUS(rtnCode) != 0) {
|
|
||||||
cout << endl << "MariaDB ColumnStore login failure, MySQL Root password is set." << endl;
|
|
||||||
cout << "Need MariaDB ColumnStore password configuration file " + HOME + "/.my.cnf on " << remoteModuleName << endl;
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
//get password from local tmp file
|
|
||||||
mysqlpw = getmysqlpw("/tmp/mysqlpw.log");
|
|
||||||
|
|
||||||
if ( mysqlpw != oam::UnassignedName )
|
|
||||||
{
|
|
||||||
mysqlpw = "'" + mysqlpw + "'";
|
|
||||||
pwprompt = "--password=" + mysqlpw;
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd = installDir + "/bin/remote_command.sh " + remoteModuleIP + " " + password + " '" + installDir + "/mysql/bin/mysql --defaults-file=" + installDir + "/mysql/my.cnf -u root " + pwprompt + " -e status' 1 > /tmp/idbmysql.log 2>&1";
|
|
||||||
rtnCode = system(cmd.c_str());
|
|
||||||
if (WEXITSTATUS(rtnCode) != 0) {
|
|
||||||
cout << endl << "MariaDB ColumnStore login failure, password mismatch in " + HOME + ".my.cnf on " << remoteModuleName << endl;
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!oam.checkLogStatus("/tmp/idbmysql.log", "Columnstore") ) {
|
|
||||||
cout << endl << "ERROR: MariaDB ColumnStore runtime error, exit..." << endl << endl;
|
|
||||||
system("cat /tmp/idbmysql.log");
|
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cout << endl << "Additional MariaDB ColumnStore Installation steps Successfully Completed on '" + remoteModuleName + "'" << endl << endl;
|
|
||||||
|
|
||||||
cmd = installDir + "/bin/remote_command.sh " + remoteModuleIP + " " + password + " '" + installDir + "/mysql/mysql-Columnstore stop'";
|
|
||||||
int rtnCode = system(cmd.c_str());
|
|
||||||
if (WEXITSTATUS(rtnCode) != 0) {
|
|
||||||
cout << endl << "Error returned from mysql-Columnstore stop" << endl;
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
unlink("/tmp/idbmysql.log");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//re-run post-mysql-install with password
|
|
||||||
cmd = installDir + "/bin/remote_command.sh " + remoteModuleIP + " " + password + " '" + installDir + "/bin/post-mysql-install " + pwprompt + "' < /tmp/post-mysql-install.log";
|
|
||||||
rtnCode = system(cmd.c_str());
|
|
||||||
if (WEXITSTATUS(rtnCode) != 0) {
|
|
||||||
cout << endl << "Error returned from post-mysql-install, check /tmp/post-mysql-install.log" << endl;
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
cout << endl << "post-mysql-install Successfully Completed" << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -3354,22 +3264,7 @@ int main(int argc, char *argv[])
|
|||||||
cout << endl << "System Catalog Successfully Created" << endl;
|
cout << endl << "System Catalog Successfully Created" << endl;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( oam.checkLogStatus("/tmp/dbbuilder.log", "System catalog appears to exist") ) {
|
if ( ! oam.checkLogStatus("/tmp/dbbuilder.log", "System catalog appears to exist") )
|
||||||
|
|
||||||
// cout << endl << "Run MySQL Upgrade.. ";
|
|
||||||
cout.flush();
|
|
||||||
|
|
||||||
//send message to procmon's to run upgrade script
|
|
||||||
// int status = sendUpgradeRequest(IserverTypeInstall, pmwithum);
|
|
||||||
|
|
||||||
// if ( status != 0 ) {
|
|
||||||
// cout << endl << "MariaDB ColumnStore Install Failed" << endl << endl;
|
|
||||||
// exit(1);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// cout << " DONE" << endl;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
cout << endl << "System Catalog Create Failure" << endl;
|
cout << endl << "System Catalog Create Failure" << endl;
|
||||||
cout << "Check latest log file in /tmp/dbbuilder.log.*" << endl;
|
cout << "Check latest log file in /tmp/dbbuilder.log.*" << endl;
|
||||||
@ -3378,9 +3273,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
//set mysql replication, if wasn't setup before on system
|
//set mysql replication, if wasn't setup before on system
|
||||||
if ( ( mysqlRep && pmwithum ) ||
|
if ( mysqlRep )
|
||||||
( mysqlRep && (umNumber > 1) ) ||
|
|
||||||
( mysqlRep && (pmNumber > 1) && (IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM) ) )
|
|
||||||
{
|
{
|
||||||
cout << endl << "Run MariaDB ColumnStore Replication Setup.. ";
|
cout << endl << "Run MariaDB ColumnStore Replication Setup.. ";
|
||||||
cout.flush();
|
cout.flush();
|
||||||
|
@ -521,6 +521,8 @@ static void startMgrProcessThread()
|
|||||||
SystemModuleTypeConfig systemmoduletypeconfig;
|
SystemModuleTypeConfig systemmoduletypeconfig;
|
||||||
ModuleTypeConfig PMSmoduletypeconfig;
|
ModuleTypeConfig PMSmoduletypeconfig;
|
||||||
ALARMManager aManager;
|
ALARMManager aManager;
|
||||||
|
|
||||||
|
int waitTime = 90;
|
||||||
|
|
||||||
log.writeLog(__LINE__, "startMgrProcessThread launched", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "startMgrProcessThread launched", LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
@ -576,7 +578,7 @@ static void startMgrProcessThread()
|
|||||||
|
|
||||||
//wait until all modules are up after a system reboot
|
//wait until all modules are up after a system reboot
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for( ; i < 100 ; i++ )
|
for( ; i < waitTime ; i++ )
|
||||||
{
|
{
|
||||||
if ( startsystemthreadStop ) {
|
if ( startsystemthreadStop ) {
|
||||||
processManager.setSystemState(oam::MAN_OFFLINE);
|
processManager.setSystemState(oam::MAN_OFFLINE);
|
||||||
@ -642,7 +644,7 @@ static void startMgrProcessThread()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( i == 100 ) {
|
if ( i == waitTime ) {
|
||||||
// system didn't successfull restart
|
// system didn't successfull restart
|
||||||
processManager.setSystemState(oam::FAILED);
|
processManager.setSystemState(oam::FAILED);
|
||||||
|
|
||||||
@ -661,7 +663,7 @@ static void startMgrProcessThread()
|
|||||||
//now wait until all procmons are up and validate rpms on each module
|
//now wait until all procmons are up and validate rpms on each module
|
||||||
int status = API_SUCCESS;
|
int status = API_SUCCESS;
|
||||||
int k = 0;
|
int k = 0;
|
||||||
for( ; k < 1200 ; k++ )
|
for( ; k < waitTime ; k++ )
|
||||||
{
|
{
|
||||||
if ( startsystemthreadStop ) {
|
if ( startsystemthreadStop ) {
|
||||||
processManager.setSystemState(oam::MAN_OFFLINE);
|
processManager.setSystemState(oam::MAN_OFFLINE);
|
||||||
@ -778,7 +780,7 @@ static void startMgrProcessThread()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( k == 1200 || status == API_FAILURE) {
|
if ( k == waitTime || status == API_FAILURE) {
|
||||||
// system didn't successfull restart
|
// system didn't successfull restart
|
||||||
processManager.setSystemState(oam::FAILED);
|
processManager.setSystemState(oam::FAILED);
|
||||||
// exit thread
|
// exit thread
|
||||||
|
@ -1145,7 +1145,7 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
//wait until all child modules are offline or A FAILURE HAS OCCURRED
|
//wait until all child modules are offline or A FAILURE HAS OCCURRED
|
||||||
bool failure = false;
|
bool failure = false;
|
||||||
bool stopped = true;
|
bool stopped = true;
|
||||||
for ( int retry = 0 ; retry < 120 ; retry++ )
|
for ( int retry = 0 ; retry < 30 ; retry++ )
|
||||||
{
|
{
|
||||||
sleep(1);
|
sleep(1);
|
||||||
stopped = true;
|
stopped = true;
|
||||||
@ -3856,6 +3856,8 @@ void ProcessManager::setModuleState(string moduleName, uint16_t state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pthread_mutex_unlock(&STATUS_LOCK);
|
pthread_mutex_unlock(&STATUS_LOCK);
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************************
|
/******************************************************************************************
|
||||||
@ -3884,6 +3886,9 @@ void ProcessManager::setExtdeviceState(string extDeviceName, uint16_t state)
|
|||||||
// log.writeLog(__LINE__, "EXCEPTION ERROR on setExtDeviceStatus: Caught unknown exception!", LOG_TYPE_ERROR);
|
// log.writeLog(__LINE__, "EXCEPTION ERROR on setExtDeviceStatus: Caught unknown exception!", LOG_TYPE_ERROR);
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&STATUS_LOCK);
|
pthread_mutex_unlock(&STATUS_LOCK);
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************************
|
/******************************************************************************************
|
||||||
@ -3912,6 +3917,8 @@ void ProcessManager::setNICState(string hostName, uint16_t state)
|
|||||||
// log.writeLog(__LINE__, "EXCEPTION ERROR on setNICStatus: Caught unknown exception!", LOG_TYPE_ERROR);
|
// log.writeLog(__LINE__, "EXCEPTION ERROR on setNICStatus: Caught unknown exception!", LOG_TYPE_ERROR);
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&STATUS_LOCK);
|
pthread_mutex_unlock(&STATUS_LOCK);
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -4045,6 +4052,8 @@ void ProcessManager::setProcessStates(std::string moduleName, uint16_t state, st
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************************
|
/******************************************************************************************
|
||||||
@ -6869,10 +6878,6 @@ void startSystemThread(oam::DeviceNetworkList Devicenetworklist)
|
|||||||
sleep(2);
|
sleep(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
log.writeLog(__LINE__, "Setup MySQL Replication for startsystemthread", LOG_TYPE_DEBUG);
|
|
||||||
oam::DeviceNetworkList devicenetworklistRep;
|
|
||||||
processManager.setMySQLReplication(devicenetworklistRep);
|
|
||||||
|
|
||||||
//set query system state ready
|
//set query system state ready
|
||||||
processManager.setQuerySystemState(true);
|
processManager.setQuerySystemState(true);
|
||||||
|
|
||||||
@ -10046,49 +10051,6 @@ int ProcessManager::setMySQLReplication(oam::DeviceNetworkList devicenetworklist
|
|||||||
if ( MySQLRep == "n" && enable )
|
if ( MySQLRep == "n" && enable )
|
||||||
return oam::API_SUCCESS;
|
return oam::API_SUCCESS;
|
||||||
|
|
||||||
//also skip if single-server, multi-node seperate with 1 UM, multi-node combo with 1 PM
|
|
||||||
|
|
||||||
string SingleServerInstall = "n";
|
|
||||||
try {
|
|
||||||
oam.getSystemConfig("SingleServerInstall", SingleServerInstall);
|
|
||||||
}
|
|
||||||
catch(...) {
|
|
||||||
SingleServerInstall = "n";
|
|
||||||
}
|
|
||||||
|
|
||||||
//single server check
|
|
||||||
if ( SingleServerInstall == "y" )
|
|
||||||
return oam::API_SUCCESS;
|
|
||||||
|
|
||||||
//combined system check
|
|
||||||
if ( config.ServerInstallType() == oam::INSTALL_COMBINE_DM_UM_PM && !failover ) {
|
|
||||||
try {
|
|
||||||
Config* sysConfig = Config::makeConfig();
|
|
||||||
if ( sysConfig->getConfig("DBRM_Controller", "NumWorkers") == "1" ) {
|
|
||||||
return oam::API_SUCCESS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(...)
|
|
||||||
{
|
|
||||||
return oam::API_SUCCESS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//seperate system check
|
|
||||||
if ( config.ServerInstallType() != oam::INSTALL_COMBINE_DM_UM_PM ) {
|
|
||||||
ModuleTypeConfig moduletypeconfig;
|
|
||||||
try{
|
|
||||||
oam.getSystemConfig("um", moduletypeconfig);
|
|
||||||
}
|
|
||||||
catch(...)
|
|
||||||
{}
|
|
||||||
|
|
||||||
if ( moduletypeconfig.ModuleCount < 2 )
|
|
||||||
{
|
|
||||||
return oam::API_SUCCESS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
log.writeLog(__LINE__, "Setup MySQL Replication", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "Setup MySQL Replication", LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
// mysql port number
|
// mysql port number
|
||||||
@ -10139,7 +10101,6 @@ int ProcessManager::setMySQLReplication(oam::DeviceNetworkList devicenetworklist
|
|||||||
|
|
||||||
if ( returnStatus != API_SUCCESS) {
|
if ( returnStatus != API_SUCCESS) {
|
||||||
log.writeLog(__LINE__, "setMySQLReplication: ERROR: Error getting MySQL Replication Master Information", LOG_TYPE_ERROR);
|
log.writeLog(__LINE__, "setMySQLReplication: ERROR: Error getting MySQL Replication Master Information", LOG_TYPE_ERROR);
|
||||||
pthread_mutex_unlock(&THREAD_LOCK);
|
|
||||||
return API_FAILURE;
|
return API_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -10166,7 +10127,6 @@ int ProcessManager::setMySQLReplication(oam::DeviceNetworkList devicenetworklist
|
|||||||
|
|
||||||
if ( returnStatus != API_SUCCESS) {
|
if ( returnStatus != API_SUCCESS) {
|
||||||
log.writeLog(__LINE__, "setMySQLReplication: ERROR: Error getting MySQL Replication Master Information", LOG_TYPE_ERROR);
|
log.writeLog(__LINE__, "setMySQLReplication: ERROR: Error getting MySQL Replication Master Information", LOG_TYPE_ERROR);
|
||||||
pthread_mutex_unlock(&THREAD_LOCK);
|
|
||||||
return API_FAILURE;
|
return API_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -10189,6 +10149,7 @@ int ProcessManager::setMySQLReplication(oam::DeviceNetworkList devicenetworklist
|
|||||||
|
|
||||||
if ( returnStatus != API_SUCCESS) {
|
if ( returnStatus != API_SUCCESS) {
|
||||||
log.writeLog(__LINE__, "setMySQLReplication: ERROR: Error getting MySQL Replication Master Information", LOG_TYPE_ERROR);
|
log.writeLog(__LINE__, "setMySQLReplication: ERROR: Error getting MySQL Replication Master Information", LOG_TYPE_ERROR);
|
||||||
|
return API_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -10256,6 +10217,7 @@ int ProcessManager::setMySQLReplication(oam::DeviceNetworkList devicenetworklist
|
|||||||
|
|
||||||
if ( returnStatus != API_SUCCESS) {
|
if ( returnStatus != API_SUCCESS) {
|
||||||
log.writeLog(__LINE__, "setMySQLReplication: ERROR: Error setting MySQL Replication Slave", LOG_TYPE_ERROR);
|
log.writeLog(__LINE__, "setMySQLReplication: ERROR: Error setting MySQL Replication Slave", LOG_TYPE_ERROR);
|
||||||
|
return API_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -10304,6 +10266,7 @@ int ProcessManager::setMySQLReplication(oam::DeviceNetworkList devicenetworklist
|
|||||||
|
|
||||||
if ( returnStatus != API_SUCCESS) {
|
if ( returnStatus != API_SUCCESS) {
|
||||||
log.writeLog(__LINE__, "setMySQLReplication: ERROR: Error setting MySQL Replication Slave", LOG_TYPE_ERROR);
|
log.writeLog(__LINE__, "setMySQLReplication: ERROR: Error setting MySQL Replication Slave", LOG_TYPE_ERROR);
|
||||||
|
return API_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -203,8 +203,13 @@ int main(int argc, char **argv)
|
|||||||
pthread_t MessageThread;
|
pthread_t MessageThread;
|
||||||
int ret = pthread_create (&MessageThread, NULL, (void*(*)(void*)) &messageThread, &config);
|
int ret = pthread_create (&MessageThread, NULL, (void*(*)(void*)) &messageThread, &config);
|
||||||
if ( ret != 0 )
|
if ( ret != 0 )
|
||||||
|
{
|
||||||
log.writeLog(__LINE__, "pthread_create failed, return code = " + oam.itoa(ret), LOG_TYPE_ERROR);
|
log.writeLog(__LINE__, "pthread_create failed, return code = " + oam.itoa(ret), LOG_TYPE_ERROR);
|
||||||
|
sleep (1);
|
||||||
|
string cmd = startup::StartUp::installDir() + "/bin/infinidb stop > /dev/null 2>&1";
|
||||||
|
system(cmd.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
//create and mount data directories
|
//create and mount data directories
|
||||||
aMonitor.createDataDirs(cloud);
|
aMonitor.createDataDirs(cloud);
|
||||||
|
|
||||||
@ -2145,7 +2150,7 @@ void processStatusMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
catch (exception& ex)
|
catch (exception& ex)
|
||||||
{
|
{
|
||||||
string error = ex.what();
|
string error = ex.what();
|
||||||
log.writeLog(__LINE__, "***read error, close create thread: " + error, LOG_TYPE_DEBUG);
|
// log.writeLog(__LINE__, "***read error, close create thread: " + error, LOG_TYPE_DEBUG);
|
||||||
fIos->close();
|
fIos->close();
|
||||||
delete fIos;
|
delete fIos;
|
||||||
delete msg;
|
delete msg;
|
||||||
@ -2154,7 +2159,7 @@ void processStatusMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
log.writeLog(__LINE__, "***read error, close create thread", LOG_TYPE_DEBUG);
|
// log.writeLog(__LINE__, "***read error, close create thread", LOG_TYPE_DEBUG);
|
||||||
fIos->close();
|
fIos->close();
|
||||||
delete fIos;
|
delete fIos;
|
||||||
delete msg;
|
delete msg;
|
||||||
@ -2163,7 +2168,7 @@ void processStatusMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (msg->length() <= 0) {
|
if (msg->length() <= 0) {
|
||||||
log.writeLog(__LINE__, "***0 bytes, close create thread", LOG_TYPE_DEBUG);
|
// log.writeLog(__LINE__, "***0 bytes, close create thread", LOG_TYPE_DEBUG);
|
||||||
fIos->close();
|
fIos->close();
|
||||||
delete fIos;
|
delete fIos;
|
||||||
delete msg;
|
delete msg;
|
||||||
|
@ -4673,10 +4673,10 @@ int ProcessMonitor::changeMyCnf(std::string type)
|
|||||||
buf = "server-id = 1";
|
buf = "server-id = 1";
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = buf.find("# binlog_format=ROW",0);
|
// pos = buf.find("# binlog_format=ROW",0);
|
||||||
if ( pos != string::npos ) {
|
// if ( pos != string::npos ) {
|
||||||
buf = "binlog_format=ROW";
|
// buf = "binlog_format=ROW";
|
||||||
}
|
// }
|
||||||
|
|
||||||
pos = buf.find("infinidb_local_query=1",0);
|
pos = buf.find("infinidb_local_query=1",0);
|
||||||
if ( pos != string::npos && pos == 0) {
|
if ( pos != string::npos && pos == 0) {
|
||||||
@ -4755,22 +4755,7 @@ int ProcessMonitor::changeMyCnf(std::string type)
|
|||||||
return oam::API_FAILURE;
|
return oam::API_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get local host name
|
|
||||||
/* string HOSTNAME = "localhost";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
ModuleConfig moduleconfig;
|
|
||||||
oam.getSystemConfig(config.moduleName(), moduleconfig);
|
|
||||||
HostConfigList::iterator pt1 = moduleconfig.hostConfigList.begin();
|
|
||||||
HOSTNAME = (*pt1).HostName;
|
|
||||||
}
|
|
||||||
catch(...)
|
|
||||||
{}
|
|
||||||
|
|
||||||
char* p= getenv("HOSTNAME");
|
|
||||||
if (p && *p)
|
|
||||||
HOSTNAME = p;
|
|
||||||
*/
|
|
||||||
// set slave replication entries
|
// set slave replication entries
|
||||||
vector <string> lines;
|
vector <string> lines;
|
||||||
char line[200];
|
char line[200];
|
||||||
@ -4799,10 +4784,10 @@ int ProcessMonitor::changeMyCnf(std::string type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = buf.find("binlog_format=ROW",0);
|
// pos = buf.find("binlog_format=ROW",0);
|
||||||
if ( pos != string::npos && pos == 0 ) {
|
// if ( pos != string::npos && pos == 0 ) {
|
||||||
buf = "# binlog_format=ROW";
|
// buf = "# binlog_format=ROW";
|
||||||
}
|
// }
|
||||||
|
|
||||||
//output to temp file
|
//output to temp file
|
||||||
lines.push_back(buf);
|
lines.push_back(buf);
|
||||||
@ -4821,7 +4806,7 @@ int ProcessMonitor::changeMyCnf(std::string type)
|
|||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( type == "disable" )
|
/* if ( type == "disable" )
|
||||||
{
|
{
|
||||||
// set master replication entries
|
// set master replication entries
|
||||||
vector <string> lines;
|
vector <string> lines;
|
||||||
@ -4886,7 +4871,7 @@ int ProcessMonitor::changeMyCnf(std::string type)
|
|||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
// 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)
|
if ( !rootUser)
|
||||||
@ -4964,6 +4949,11 @@ int ProcessMonitor::runMasterRep(std::string& masterLogFile, std::string& master
|
|||||||
|
|
||||||
bool passwordError = false;
|
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();
|
HostConfigList::iterator pt1 = (*pt).hostConfigList.begin();
|
||||||
while(true) // need in case there is a password retry
|
while(true) // need in case there is a password retry
|
||||||
{
|
{
|
||||||
@ -5004,7 +4994,7 @@ int ProcessMonitor::runMasterRep(std::string& masterLogFile, std::string& master
|
|||||||
if ( passwordError )
|
if ( passwordError )
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
mysqlpw = oam.getMySQLPassword(true);
|
mysqlpw = oam.getMySQLPassword();
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{}
|
{}
|
||||||
@ -5154,7 +5144,7 @@ int ProcessMonitor::runSlaveRep(std::string& masterLogFile, std::string& masterL
|
|||||||
if ( passwordError )
|
if ( passwordError )
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
mysqlpw = oam.getMySQLPassword(true);
|
mysqlpw = oam.getMySQLPassword();
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{}
|
{}
|
||||||
|
Reference in New Issue
Block a user