You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-05 16:15:50 +03:00
update
This commit is contained in:
@@ -11,14 +11,21 @@ checkForError() {
|
|||||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
||||||
if test -f $HOME/.my.cnf ; then
|
if test -f $HOME/.my.cnf ; then
|
||||||
password=`cat $HOME/.my.cnf | grep password | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $3}'`
|
password=`cat $HOME/.my.cnf | grep password | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $3}'`
|
||||||
pwprompt="-p$password"
|
if [ ! -z $password ]; then
|
||||||
return 1;
|
pwprompt="-p$password"
|
||||||
|
else
|
||||||
|
echo "MySQL Password file missing or incorrect, check .my.cnf file"
|
||||||
|
rm -f /tmp/error.check
|
||||||
|
$installdir/mysql/mysql-Columnstore stop
|
||||||
|
sleep 2
|
||||||
|
exit 2;
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "MySQL Password file missing or incorrect, check .my.cnf file"
|
echo "MySQL Password file missing or incorrect, check .my.cnf file"
|
||||||
rm -f /tmp/error.check
|
rm -f /tmp/error.check
|
||||||
$installdir/mysql/mysql-Columnstore stop
|
$installdir/mysql/mysql-Columnstore stop
|
||||||
sleep 2
|
sleep 2
|
||||||
exit 1;
|
exit 2;
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -60,7 +67,9 @@ for arg in "$@"; do
|
|||||||
rpmmode="$(echo $arg | awk -F= '{print $2}')"
|
rpmmode="$(echo $arg | awk -F= '{print $2}')"
|
||||||
elif [ $(expr -- "$arg" : '--password=') -eq 11 ]; then
|
elif [ $(expr -- "$arg" : '--password=') -eq 11 ]; then
|
||||||
password="$(echo $arg | awk -F= '{print $2}')"
|
password="$(echo $arg | awk -F= '{print $2}')"
|
||||||
pwprompt="-p$password"
|
if [ ! -z $password ]; then
|
||||||
|
pwprompt="-p$password"
|
||||||
|
fi
|
||||||
elif [ $(expr -- "$arg" : '--installdir=') -eq 13 ]; then
|
elif [ $(expr -- "$arg" : '--installdir=') -eq 13 ]; then
|
||||||
installdir="$(echo $arg | awk -F= '{print $2}')"
|
installdir="$(echo $arg | awk -F= '{print $2}')"
|
||||||
prefix=$(dirname $installdir)
|
prefix=$(dirname $installdir)
|
||||||
@@ -118,7 +127,7 @@ if [ -x $installdir/mysql/mysql-Columnstore ]; then
|
|||||||
echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing"
|
echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing"
|
||||||
$installdir/mysql/mysql-Columnstore stop
|
$installdir/mysql/mysql-Columnstore stop
|
||||||
sleep 2
|
sleep 2
|
||||||
exit 1;
|
exit 2;
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -259,70 +259,6 @@ void mysqlSetup()
|
|||||||
HOME = p;
|
HOME = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
//check for password set
|
|
||||||
//start in the same way that mysqld will be started normally.
|
|
||||||
try {
|
|
||||||
oam.actionMysqlCalpont(MYSQL_START);
|
|
||||||
}
|
|
||||||
catch(const std::exception &exc)
|
|
||||||
{
|
|
||||||
std::cerr << exc.what() << std::endl;
|
|
||||||
}
|
|
||||||
sleep(2);
|
|
||||||
|
|
||||||
for (;;)
|
|
||||||
{
|
|
||||||
// check if mysql is supported and get info
|
|
||||||
string calpontMysql = installDir + "/mysql/bin/mysql --defaults-file=" + installDir + "/mysql/my.cnf -u root ";
|
|
||||||
string cmd = calpontMysql + pwprompt + " -e 'status' > /tmp/idbmysql.log 2>&1";
|
|
||||||
system(cmd.c_str());
|
|
||||||
|
|
||||||
if (oam.checkLogStatus("/tmp/idbmysql.log", "ERROR 1045") ) {
|
|
||||||
//check and get password
|
|
||||||
string mysqlpw = oam::UnassignedName;
|
|
||||||
try {
|
|
||||||
mysqlpw = oam.getMySQLPassword(false);
|
|
||||||
cout << "NOTE: Using MariaDB Columnstore password from " + HOME + "/.my.cnf" << endl;
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
cout << endl << "MariDB Columnstore login failure, password is assigned. Need MariaDB Columnstore password configuration file " + HOME + "/.my.cnf on local module" << endl;
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
mysqlpw = "'" + mysqlpw + "'";
|
|
||||||
pwprompt = "--password=" + mysqlpw;
|
|
||||||
|
|
||||||
try {
|
|
||||||
oam.setSystemConfig("MySQLPasswordConfig", "y");
|
|
||||||
}
|
|
||||||
catch(const std::exception &exc)
|
|
||||||
{
|
|
||||||
std::cerr << exc.what() << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
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
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
oam.actionMysqlCalpont(MYSQL_STOP);
|
|
||||||
}
|
|
||||||
catch(const std::exception &exc)
|
|
||||||
{
|
|
||||||
std::cerr << exc.what() << std::endl;
|
|
||||||
}
|
|
||||||
unlink("/tmp/idbmysql.log");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd = installDir + "/bin/post-mysql-install " + pwprompt + " --installdir=" + installDir + " > /tmp/post-mysql-install.log";;
|
cmd = installDir + "/bin/post-mysql-install " + pwprompt + " --installdir=" + installDir + " > /tmp/post-mysql-install.log";;
|
||||||
rtnCode = system(cmd.c_str());
|
rtnCode = system(cmd.c_str());
|
||||||
if (WEXITSTATUS(rtnCode) == 2) {
|
if (WEXITSTATUS(rtnCode) == 2) {
|
||||||
|
@@ -3018,7 +3018,8 @@ int main(int argc, char *argv[])
|
|||||||
cmd = installDir + "/bin/remote_command.sh " + remoteModuleIP + " " + password + " '" + installDir + "bin/getMySQLpw > /tmp/mysqlpw.log 2>&1";
|
cmd = installDir + "/bin/remote_command.sh " + remoteModuleIP + " " + password + " '" + installDir + "bin/getMySQLpw > /tmp/mysqlpw.log 2>&1";
|
||||||
rtnCode = system(cmd.c_str());
|
rtnCode = system(cmd.c_str());
|
||||||
if (WEXITSTATUS(rtnCode) != 0) {
|
if (WEXITSTATUS(rtnCode) != 0) {
|
||||||
cout << endl << "MariaDB Columnstore login failure, password is assigned. Need MariaDB Columnstore password configuration file " + HOME + "/.my.cnf on " << remoteModuleName << endl;
|
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);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user