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>
|
<DataRedundancyStorageType>unassigned</DataRedundancyStorageType>
|
||||||
<CoreFileFlag>n</CoreFileFlag>
|
<CoreFileFlag>n</CoreFileFlag>
|
||||||
<MySQLPort>3306</MySQLPort>
|
<MySQLPort>3306</MySQLPort>
|
||||||
<MySQLPasswordConfig>unassigned</MySQLPasswordConfig>
|
|
||||||
<AmazonDeviceName>/dev/xvd</AmazonDeviceName>
|
<AmazonDeviceName>/dev/xvd</AmazonDeviceName>
|
||||||
<DistributedInstall>y</DistributedInstall>
|
<DistributedInstall>y</DistributedInstall>
|
||||||
</Installation>
|
</Installation>
|
||||||
|
@ -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 EXISTS '$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
|
||||||
|
|
||||||
|
@ -155,7 +155,13 @@ if [ $module = "um" ] || ( [ $module = "pm" ] && [ $PMwithUM = "y" ] ) || [ $Ser
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "Run post-mysql-install"
|
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
|
if [ $? -ne 0 ]; then
|
||||||
echo "ERROR: post-mysql-install failed: check /tmp/post-mysql-install.log"
|
echo "ERROR: post-mysql-install failed: check /tmp/post-mysql-install.log"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -8727,22 +8727,8 @@ 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 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)
|
||||||
@ -8755,10 +8741,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;
|
||||||
@ -8779,16 +8770,10 @@ 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+2, 80);
|
||||||
|
|
||||||
|
writeLog("getMySQLPassword: password found", LOG_TYPE_DEBUG);
|
||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8796,7 +8781,9 @@ namespace oam
|
|||||||
}
|
}
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3416,29 +3416,13 @@ 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(...) {}
|
catch(...) {}
|
||||||
|
|
||||||
if ( MySQLRep == "y" && MySQLPasswordConfig == oam::UnassignedName ) {
|
try
|
||||||
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(...) {}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
cout << endl << " Check for active transactions" << endl;
|
cout << endl << " Check for active transactions" << endl;
|
||||||
|
|
||||||
if (!bDBRMReady ||
|
if (!bDBRMReady ||
|
||||||
@ -5015,26 +4999,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");
|
||||||
@ -6130,26 +6094,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(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;
|
||||||
|
|
||||||
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);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,7 +191,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;
|
||||||
@ -592,11 +592,6 @@ int main(int argc, char *argv[])
|
|||||||
{}
|
{}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
oam.setSystemConfig("MySQLPasswordConfig", oam::UnassignedName);
|
|
||||||
}
|
|
||||||
catch(...) {}
|
|
||||||
|
|
||||||
//check for non-Distributed Install
|
//check for non-Distributed Install
|
||||||
if ( nonDistribute )
|
if ( nonDistribute )
|
||||||
{
|
{
|
||||||
@ -2971,7 +2966,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
//check for mysql password on remote UM
|
//check for mysql password on remote UM
|
||||||
if ( pwprompt == " " ) {
|
/* if ( pwprompt == " " ) {
|
||||||
//start mysqld
|
//start mysqld
|
||||||
cmd = installDir + "/bin/remote_command.sh " + remoteModuleIP + " " + password + " '" + installDir + "/mysql/mysql-Columnstore start'";
|
cmd = installDir + "/bin/remote_command.sh " + remoteModuleIP + " " + password + " '" + installDir + "/mysql/mysql-Columnstore start'";
|
||||||
int rtnCode = system(cmd.c_str());
|
int rtnCode = system(cmd.c_str());
|
||||||
@ -2999,8 +2994,14 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
//get password from local tmp file
|
//get password from local tmp file
|
||||||
mysqlpw = getmysqlpw("/tmp/mysqlpw.log");
|
try {
|
||||||
|
mysqlpw = oam.getMySQLPassword();
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
|
{
|
||||||
|
mysqlpw = oam::UnassignedName;
|
||||||
|
}
|
||||||
|
|
||||||
if ( mysqlpw != oam::UnassignedName )
|
if ( mysqlpw != oam::UnassignedName )
|
||||||
{
|
{
|
||||||
mysqlpw = "'" + mysqlpw + "'";
|
mysqlpw = "'" + mysqlpw + "'";
|
||||||
@ -3046,7 +3047,7 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
cout << endl << "post-mysql-install Successfully Completed" << endl;
|
cout << endl << "post-mysql-install Successfully Completed" << endl;
|
||||||
}
|
}
|
||||||
}
|
*/ }
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // do a binary package install
|
{ // 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
|
//set mysql replication, if wasn't setup before on system
|
||||||
/* if ( ( mysqlRep && pmwithum ) ||
|
// if ( ( mysqlRep && pmwithum ) ||
|
||||||
( mysqlRep && (umNumber > 1) ) ||
|
// ( mysqlRep && (umNumber > 1) ) ||
|
||||||
( mysqlRep && (pmNumber > 1) && (IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM) ) )
|
// ( mysqlRep && (pmNumber > 1) && (IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM) ) )
|
||||||
|
if ( mysqlRep )
|
||||||
{
|
{
|
||||||
cout << endl << "Run MariaDB ColumnStore Replication Setup.. ";
|
cout << endl << "Run MariaDB ColumnStore Replication Setup.. ";
|
||||||
cout.flush();
|
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);
|
int status = sendReplicationRequest(IserverTypeInstall, password, mysqlPort, pmwithum);
|
||||||
|
|
||||||
if ( status != 0 ) {
|
if ( status != 0 ) {
|
||||||
@ -3515,7 +3517,7 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
cout << " DONE" << endl;
|
cout << " DONE" << endl;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
cout << endl << "MariaDB ColumnStore Install Successfully Completed, System is Active" << endl << 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;
|
cout << "Enter the following command to define MariaDB ColumnStore Alias Commands" << endl << endl;
|
||||||
|
@ -502,6 +502,8 @@ static void startMgrProcessThread()
|
|||||||
ModuleTypeConfig PMSmoduletypeconfig;
|
ModuleTypeConfig PMSmoduletypeconfig;
|
||||||
ALARMManager aManager;
|
ALARMManager aManager;
|
||||||
|
|
||||||
|
int waitTime = 60;
|
||||||
|
|
||||||
log.writeLog(__LINE__, "startMgrProcessThread launched", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "startMgrProcessThread launched", LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
//get calpont software version and release
|
//get calpont software version and release
|
||||||
@ -597,7 +599,7 @@ static void startMgrProcessThread()
|
|||||||
{
|
{
|
||||||
int status = API_SUCCESS;
|
int status = API_SUCCESS;
|
||||||
int k = 0;
|
int k = 0;
|
||||||
for( ; k < 200 ; k++ )
|
for( ; k < waitTime ; k++ )
|
||||||
{
|
{
|
||||||
if ( startsystemthreadStop ) {
|
if ( startsystemthreadStop ) {
|
||||||
processManager.setSystemState(oam::MAN_OFFLINE);
|
processManager.setSystemState(oam::MAN_OFFLINE);
|
||||||
@ -641,7 +643,7 @@ static void startMgrProcessThread()
|
|||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( k == 200 || 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
|
||||||
@ -653,7 +655,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 < 200 ; i++ )
|
for( ; i < waitTime ; i++ )
|
||||||
{
|
{
|
||||||
if ( startsystemthreadStop ) {
|
if ( startsystemthreadStop ) {
|
||||||
processManager.setSystemState(oam::MAN_OFFLINE);
|
processManager.setSystemState(oam::MAN_OFFLINE);
|
||||||
@ -719,7 +721,7 @@ static void startMgrProcessThread()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( i == 200 ) {
|
if ( i == waitTime ) {
|
||||||
// system didn't successfull restart
|
// system didn't successfull restart
|
||||||
processManager.setSystemState(oam::FAILED);
|
processManager.setSystemState(oam::FAILED);
|
||||||
|
|
||||||
@ -738,7 +740,7 @@ static void startMgrProcessThread()
|
|||||||
//now wait until all procmons are ACTIVE and validate rpms on each module
|
//now wait until all procmons are ACTIVE and validate rpms on each module
|
||||||
int status = API_SUCCESS;
|
int status = API_SUCCESS;
|
||||||
int k = 0;
|
int k = 0;
|
||||||
for( ; k < 200 ; k++ )
|
for( ; k < waitTime ; k++ )
|
||||||
{
|
{
|
||||||
if ( startsystemthreadStop ) {
|
if ( startsystemthreadStop ) {
|
||||||
processManager.setSystemState(oam::MAN_OFFLINE);
|
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
|
// system didn't successfull restart
|
||||||
processManager.setSystemState(oam::FAILED);
|
processManager.setSystemState(oam::FAILED);
|
||||||
// exit thread
|
// exit thread
|
||||||
|
@ -1143,7 +1143,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;
|
||||||
@ -3809,7 +3809,9 @@ void ProcessManager::setSystemState(uint16_t state)
|
|||||||
aManager.sendAlarmReport(system.c_str(), SYSTEM_DOWN_AUTO, SET);
|
aManager.sendAlarmReport(system.c_str(), SYSTEM_DOWN_AUTO, SET);
|
||||||
aManager.sendAlarmReport(system.c_str(), CONN_FAILURE, CLEAR);
|
aManager.sendAlarmReport(system.c_str(), CONN_FAILURE, CLEAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
pthread_mutex_unlock(&STATUS_LOCK);
|
pthread_mutex_unlock(&STATUS_LOCK);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************************
|
/******************************************************************************************
|
||||||
@ -3839,6 +3841,7 @@ void ProcessManager::setModuleState(string moduleName, uint16_t state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pthread_mutex_unlock(&STATUS_LOCK);
|
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);
|
// log.writeLog(__LINE__, "EXCEPTION ERROR on setExtDeviceStatus: Caught unknown exception!", LOG_TYPE_ERROR);
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&STATUS_LOCK);
|
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);
|
// log.writeLog(__LINE__, "EXCEPTION ERROR on setNICStatus: Caught unknown exception!", LOG_TYPE_ERROR);
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&STATUS_LOCK);
|
pthread_mutex_unlock(&STATUS_LOCK);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -6962,10 +6967,6 @@ void startSystemThread(oam::DeviceNetworkList Devicenetworklist)
|
|||||||
status = oam::API_FAILURE;
|
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
|
//set query system state not ready
|
||||||
processManager.setQuerySystemState(true);
|
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
|
//also skip if single-server, multi-node seperate with 1 UM, multi-node combo with 1 PM
|
||||||
|
|
||||||
string SingleServerInstall = "n";
|
/* string SingleServerInstall = "n";
|
||||||
try {
|
try {
|
||||||
oam.getSystemConfig("SingleServerInstall", SingleServerInstall);
|
oam.getSystemConfig("SingleServerInstall", SingleServerInstall);
|
||||||
}
|
}
|
||||||
@ -10272,7 +10273,7 @@ int ProcessManager::setMySQLReplication(oam::DeviceNetworkList devicenetworklist
|
|||||||
return oam::API_SUCCESS;
|
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
|
||||||
@ -10323,7 +10324,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -10350,7 +10350,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -10373,6 +10372,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -10440,7 +10440,8 @@ 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -10488,6 +10489,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,9 @@ int main(int argc, char **argv)
|
|||||||
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, exiting..., return code = " + oam.itoa(ret), LOG_TYPE_CRITICAL);
|
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
|
//check if this is a fresh install, meaning the Columnstore.xml file is not setup
|
||||||
@ -181,8 +183,15 @@ int main(int argc, char **argv)
|
|||||||
log.writeLog(__LINE__, "run module_installer.sh", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "run module_installer.sh", LOG_TYPE_DEBUG);
|
||||||
log.writeLog(__LINE__, cmd, LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, cmd, LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
system(cmd.c_str());
|
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
|
//exit to allow ProcMon to restart in a setup state
|
||||||
log.writeLog(__LINE__, "restarting for a initial setup", LOG_TYPE_DEBUG);
|
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;
|
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
|
||||||
{
|
{
|
||||||
@ -5076,7 +5081,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 (...)
|
||||||
{}
|
{}
|
||||||
@ -5226,7 +5231,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