You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-943 - change to use defauly mysql password logic, reading from the .my.cnf file. changesfrom defaults-file to defulats-extra-file
This commit is contained in:
@ -14,9 +14,6 @@ for arg in "$@"; do
|
||||
installdir=$prefix/mariadb/columnstore
|
||||
elif [ `expr -- "$arg" : '--rpmmode='` -eq 10 ]; then
|
||||
rpmmode="`echo $arg | awk -F= '{print $2}'`"
|
||||
elif [ `expr -- "$arg" : '--password='` -eq 11 ]; then
|
||||
password="`echo $arg | awk -F= '{print $2}'`"
|
||||
pwprompt="--password=$password"
|
||||
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
|
||||
installdir="`echo $arg | awk -F= '{print $2}'`"
|
||||
prefix=`dirname $installdir`
|
||||
@ -27,7 +24,7 @@ done
|
||||
|
||||
df=$installdir/mysql/my.cnf
|
||||
|
||||
$installdir/mysql/bin/mysql --defaults-file=$df --force --user=root $pwprompt mysql 2>/tmp/mysql_install.log <<EOD
|
||||
$installdir/mysql/bin/mysql --defaults-extra-file=$df --force --user=root mysql 2>/tmp/mysql_install.log <<EOD
|
||||
INSTALL PLUGIN columnstore SONAME 'libcalmysql.so';
|
||||
INSTALL PLUGIN infinidb SONAME 'libcalmysql.so';
|
||||
INSTALL PLUGIN columnstore_tables SONAME 'is_columnstore_tables.so';
|
||||
@ -130,11 +127,11 @@ CREATE TABLE IF NOT EXISTS infinidb_querystats.priority
|
||||
insert ignore into infinidb_querystats.priority values ('High', 100),('Medium', 66), ('Low', 33);
|
||||
EOD
|
||||
|
||||
$installdir/mysql/bin/mysql --defaults-file=$df --user=root $pwprompt mysql 2>/dev/null <$installdir/mysql/syscatalog_mysql.sql
|
||||
$installdir/mysql/bin/mysql --defaults-file=$df --user=root $pwprompt mysql 2>/dev/null <$installdir/mysql/calsetuserpriority.sql
|
||||
$installdir/mysql/bin/mysql --defaults-file=$df --user=root $pwprompt mysql 2>/dev/null <$installdir/mysql/calremoveuserpriority.sql
|
||||
$installdir/mysql/bin/mysql --defaults-file=$df --user=root $pwprompt mysql 2>/dev/null <$installdir/mysql/calshowprocesslist.sql
|
||||
$installdir/mysql/bin/mysql --defaults-file=$df --user=root $pwprompt mysql 2>/dev/null <$installdir/mysql/columnstore_info.sql
|
||||
$installdir/mysql/bin/mysql --defaults-extra-file=$df --user=root mysql 2>/dev/null <$installdir/mysql/syscatalog_mysql.sql
|
||||
$installdir/mysql/bin/mysql --defaults-extra-file=$df --user=root mysql 2>/dev/null <$installdir/mysql/calsetuserpriority.sql
|
||||
$installdir/mysql/bin/mysql --defaults-extra-file=$df --user=root mysql 2>/dev/null <$installdir/mysql/calremoveuserpriority.sql
|
||||
$installdir/mysql/bin/mysql --defaults-extra-file=$df --user=root mysql 2>/dev/null <$installdir/mysql/calshowprocesslist.sql
|
||||
$installdir/mysql/bin/mysql --defaults-extra-file=$df --user=root mysql 2>/dev/null <$installdir/mysql/columnstore_info.sql
|
||||
|
||||
sed -i 's/infinidb_compression_type=1/infinidb_compression_type=2/' $installdir/mysql/my.cnf >/dev/null 2>&1
|
||||
|
||||
|
@ -47,7 +47,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log 2>&1
|
||||
|
||||
@ -63,7 +63,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log 2>&1
|
||||
|
||||
|
@ -47,7 +47,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
||||
|
||||
@ -63,7 +63,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_disable-rep.sql >>/tmp/disable-rep-status.log
|
||||
|
||||
|
@ -53,7 +53,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log 2>&1
|
||||
|
||||
@ -71,7 +71,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log 2>&1
|
||||
|
||||
@ -87,7 +87,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log 2>&1
|
||||
|
||||
@ -100,7 +100,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >/tmp/show-master-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/show-master-status.log
|
||||
|
||||
|
@ -53,7 +53,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
|
||||
@ -71,7 +71,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
|
||||
@ -87,7 +87,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/master-rep-status-$hostipaddr.log
|
||||
|
||||
@ -100,7 +100,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_master-rep.sql >/tmp/show-master-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_master-rep.sql >>/tmp/show-master-status.log
|
||||
|
||||
|
@ -156,12 +156,7 @@ if [ $module = "um" ] || ( [ $module = "pm" ] && [ $PMwithUM = "y" ] ) || [ $Ser
|
||||
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
|
||||
$COLUMNSTORE_INSTALL_DIR/bin/post-mysql-install --installdir=$COLUMNSTORE_INSTALL_DIR > /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
|
||||
|
@ -9,26 +9,12 @@ checkForError() {
|
||||
# check for password error
|
||||
grep "ERROR 1045" /tmp/mysql_install.log > /tmp/error.check
|
||||
if [ `cat /tmp/error.check | wc -c` -ne 0 ]; then
|
||||
if test -f $HOME/.my.cnf ; then
|
||||
password=`cat $HOME/.my.cnf | grep password | awk '{gsub(/^[ \t]+|[ \t]+$/,"");print $3}'`
|
||||
if [ ! -z $password ]; then
|
||||
pwprompt="-p$password"
|
||||
return 1;
|
||||
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
|
||||
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
|
||||
fi
|
||||
|
||||
rm -f /tmp/error.check
|
||||
|
||||
@ -37,7 +23,7 @@ checkForError() {
|
||||
#---------------------------------------------------------------------------
|
||||
echo "checking for engine columnstore..."
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
--execute='show engines;' \
|
||||
calpontsys | grep -i columnstore
|
||||
@ -66,11 +52,6 @@ for arg in "$@"; do
|
||||
installdir=$prefix/mariadb/columnstore
|
||||
elif [ $(expr -- "$arg" : '--rpmmode=') -eq 10 ]; then
|
||||
rpmmode="$(echo $arg | awk -F= '{print $2}')"
|
||||
elif [ $(expr -- "$arg" : '--password=') -eq 11 ]; then
|
||||
password="$(echo $arg | awk -F= '{print $2}')"
|
||||
if [ ! -z $password ]; then
|
||||
pwprompt="-p$password"
|
||||
fi
|
||||
elif [ $(expr -- "$arg" : '--installdir=') -eq 13 ]; then
|
||||
installdir="$(echo $arg | awk -F= '{print $2}')"
|
||||
prefix=$(dirname $installdir)
|
||||
@ -119,11 +100,11 @@ if [ -x $installdir/mysql/mysql-Columnstore ]; then
|
||||
sleep 5
|
||||
|
||||
# Install various Calpont stuff...
|
||||
$installdir/mysql/install_calpont_mysql.sh --password=$password --installdir=$installdir
|
||||
$installdir/mysql/install_calpont_mysql.sh --installdir=$installdir
|
||||
checkForError
|
||||
if [ $? -ne 0 ]; then
|
||||
# retry
|
||||
$installdir/mysql/install_calpont_mysql.sh --password=$password --installdir=$installdir
|
||||
$installdir/mysql/install_calpont_mysql.sh --installdir=$installdir
|
||||
checkForError
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing"
|
||||
|
@ -69,7 +69,7 @@ fi
|
||||
test -x /usr/local/bin/idb-testing-mysql-pre-start && /usr/local/bin/idb-testing-mysql-pre-start $installdir/mysql
|
||||
|
||||
### Don't give the user the notes, we'll fix them ourselves...
|
||||
$installdir/mysql/scripts/mysql_install_db --rpm --user=$user --defaults-file=$installdir/mysql/my.cnf --basedir=$installdir/mysql >/dev/null
|
||||
$installdir/mysql/scripts/mysql_install_db --rpm --user=$user --defaults-extra-file=$installdir/mysql/my.cnf --basedir=$installdir/mysql >/dev/null
|
||||
# Change permissions again to fix any new files.
|
||||
chown -R $user:$user $mysql_datadir
|
||||
|
||||
|
@ -58,7 +58,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log 2>&1
|
||||
|
||||
@ -81,7 +81,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log 2>&1
|
||||
|
||||
@ -97,7 +97,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log 2>&1
|
||||
|
||||
@ -113,7 +113,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log 2>&1
|
||||
|
||||
|
@ -58,7 +58,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
|
||||
@ -80,7 +80,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
|
||||
@ -94,7 +94,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
|
||||
@ -108,7 +108,7 @@ EOD
|
||||
|
||||
cat /tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
$installdir/mysql/bin/mysql \
|
||||
--defaults-file=$installdir/mysql/my.cnf \
|
||||
--defaults-extra-file=$installdir/mysql/my.cnf \
|
||||
--user=root $pwprompt \
|
||||
calpontsys </tmp/idb_slave-rep.sql >>/tmp/slave-rep-status.log
|
||||
|
||||
|
@ -8770,6 +8770,9 @@ namespace oam
|
||||
******************************************************************************************/
|
||||
std::string Oam::getMySQLPassword()
|
||||
{
|
||||
|
||||
return oam::UnassignedName;
|
||||
|
||||
string mysqlUser = "root";
|
||||
|
||||
string USER = "root";
|
||||
|
@ -11,7 +11,7 @@
|
||||
if [ -z "$MYSQLCMD" ]; then
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
MYSQLCNF=$INSTALLDIR/mysql/my.cnf
|
||||
MYSQLCMD="$INSTALLDIR/mysql/bin/mysql --defaults-file=$MYSQLCNF -u root"
|
||||
MYSQLCMD="$INSTALLDIR/mysql/bin/mysql --defaults-extra-file=$MYSQLCNF -u root"
|
||||
fi
|
||||
|
||||
#
|
||||
|
@ -11,7 +11,7 @@
|
||||
if [ -z "$MYSQLCMD" ]; then
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
MYSQLCNF=$INSTALLDIR/mysql/my.cnf
|
||||
MYSQLCMD="$INSTALLDIR/mysql/bin/mysql --defaults-file=$MYSQLCNF -u root"
|
||||
MYSQLCMD="$INSTALLDIR/mysql/bin/mysql --defaults-extra-file=$MYSQLCNF -u root"
|
||||
fi
|
||||
|
||||
#
|
||||
|
@ -45,7 +45,7 @@
|
||||
#
|
||||
|
||||
if [ -z "$MYSQLCMD" ]; then
|
||||
MYSQLCMD="/usr/local/mariadb/columnstore/mysql/bin/mysql --defaults-file=/usr/local/mariadb/columnstore/mysql/my.cnf -u root"
|
||||
MYSQLCMD="/usr/local/mariadb/columnstore/mysql/bin/mysql --defaults-extra-file=/usr/local/mariadb/columnstore/mysql/my.cnf -u root"
|
||||
fi
|
||||
|
||||
if [ -z "$INSTALLDIR" ]; then
|
||||
|
@ -19,7 +19,7 @@ fi
|
||||
|
||||
|
||||
if [ -z "$MYSQLCMD" ]; then
|
||||
MYSQLCMD="$COLUMNSTORE_INSTALL_DIR/mysql/bin/mysql --defaults-file=$COLUMNSTORE_INSTALL_DIR/mysql/my.cnf -u root"
|
||||
MYSQLCMD="$COLUMNSTORE_INSTALL_DIR/mysql/bin/mysql --defaults-extra-file=$COLUMNSTORE_INSTALL_DIR/mysql/my.cnf -u root"
|
||||
export MYSQLCMD
|
||||
fi
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
if [ -z "$MYSQLCMD" ]; then
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
MYSQLCNF=$INSTALLDIR/mysql/my.cnf
|
||||
MYSQLCMD="$INSTALLDIR/mysql/bin/mysql --defaults-file=$MYSQLCNF -u root"
|
||||
MYSQLCMD="$INSTALLDIR/mysql/bin/mysql --defaults-extra-file=$MYSQLCNF -u root"
|
||||
fi
|
||||
|
||||
#
|
||||
|
@ -423,7 +423,7 @@ int main(int argc, char *argv[])
|
||||
cout << "It should be run on the server with the DBRM front-end." << endl;
|
||||
cout << "Check the Admin Guide for additional information." << endl;
|
||||
cout << endl;
|
||||
cout << "Usage: columnstoreSupport [-h][-a][-hw][-s][-c][-db][-r][-l][-bl][-lc][-p 'root-password'][-mp 'mariadb-columnstore-root-password'][-de]";
|
||||
cout << "Usage: columnstoreSupport [-h][-a][-hw][-s][-c][-db][-r][-l][-bl][-lc][-p 'root-password'][-de]";
|
||||
// if hdfs set up print the hadoop option
|
||||
if (!DataFilePlugin.empty())
|
||||
cout << "[-hd]";
|
||||
@ -439,7 +439,6 @@ int main(int argc, char *argv[])
|
||||
cout << " -bl Output Columnstore Bulk Log Reports only" << endl;
|
||||
cout << " -lc Output Reports for Local Server only" << endl;
|
||||
cout << " -p password (multi-server systems), root-password or 'ssh' to use 'ssh keys'" << endl;
|
||||
cout << " -mp MariaDB Columnstore root user password" << endl;
|
||||
cout << " -de Debug Flag" << endl;
|
||||
// if hdfs set up print the hadoop option
|
||||
if (!DataFilePlugin.empty())
|
||||
@ -783,7 +782,7 @@ int main(int argc, char *argv[])
|
||||
else
|
||||
{
|
||||
// check if mysql is supported and get info
|
||||
string columnstoreMysql = installDir + "/mysql/bin/mysql --defaults-file=" + installDir + "/mysql/my.cnf -u root ";
|
||||
string columnstoreMysql = installDir + "/mysql/bin/mysql --defaults-extra-file=" + installDir + "/mysql/my.cnf -u root ";
|
||||
string cmd = columnstoreMysql + " -e 'status' > /tmp/idbmysql.log 2>&1";
|
||||
system(cmd.c_str());
|
||||
|
||||
@ -846,7 +845,7 @@ int main(int argc, char *argv[])
|
||||
if (!FAILED)
|
||||
{
|
||||
// check if mysql is supported and get info
|
||||
string columnstoreMysql = installDir + "/mysql/bin/mysql --defaults-file=" + installDir + "/mysql/my.cnf -u root " + pwprompt;
|
||||
string columnstoreMysql = installDir + "/mysql/bin/mysql --defaults-extra-file=" + installDir + "/mysql/my.cnf -u root " + pwprompt;
|
||||
string cmd = columnstoreMysql + " -V > /dev/null 2>&1";
|
||||
int ret = system(cmd.c_str());
|
||||
if ( WEXITSTATUS(ret) == 0) {
|
||||
|
@ -11,7 +11,7 @@
|
||||
if [ -z "$MYSQLCMD" ]; then
|
||||
INSTALLDIR="/usr/local/mariadb/columnstore"
|
||||
MYSQLCNF=$INSTALLDIR/mysql/my.cnf
|
||||
MYSQLCMD="$INSTALLDIR/mysql/bin/mysql --defaults-file=$MYSQLCNF -u root"
|
||||
MYSQLCMD="$INSTALLDIR/mysql/bin/mysql --defaults-extra-file=$MYSQLCNF -u root"
|
||||
fi
|
||||
|
||||
#
|
||||
|
@ -45,7 +45,7 @@
|
||||
#
|
||||
|
||||
if [ -z "$MYSQLCMD" ]; then
|
||||
MYSQLCMD="/usr/local/mariadb/columnstore/mysql/bin/mysql --defaults-file=/usr/local/mariadb/columnstore/mysql/my.cnf -u root"
|
||||
MYSQLCMD="/usr/local/mariadb/columnstore/mysql/bin/mysql --defaults-extra-file=/usr/local/mariadb/columnstore/mysql/my.cnf -u root"
|
||||
fi
|
||||
|
||||
if [ -z "$INSTALLDIR" ]; then
|
||||
|
@ -19,7 +19,7 @@ fi
|
||||
|
||||
|
||||
if [ -z "$MYSQLCMD" ]; then
|
||||
MYSQLCMD="$COLUMNSTORE_INSTALL_DIR/mysql/bin/mysql --defaults-file=$COLUMNSTORE_INSTALL_DIR/mysql/my.cnf -u root"
|
||||
MYSQLCMD="$COLUMNSTORE_INSTALL_DIR/mysql/bin/mysql --defaults-extra-file=$COLUMNSTORE_INSTALL_DIR/mysql/my.cnf -u root"
|
||||
export MYSQLCMD
|
||||
fi
|
||||
|
||||
|
@ -6123,6 +6123,8 @@ int processCommand(string* arguments)
|
||||
cout << endl << "**** disableRep Failed : " << e.what() << endl;
|
||||
}
|
||||
|
||||
cout << endl;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Copyright (C) 2014 InfiniDB, Inc.
|
||||
|
||||
Copyright (C) 2017 MariaDB
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; version 2 of
|
||||
@ -57,6 +57,10 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
Oam oam;
|
||||
|
||||
cout << oam::UnassignedName << endl;
|
||||
|
||||
exit (0);
|
||||
|
||||
string USER = "root";
|
||||
char* p= getenv("USER");
|
||||
if (p && *p)
|
||||
|
@ -2971,7 +2971,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
//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";
|
||||
cmd = installDir + "/bin/remote_command.sh " + remoteModuleIP + " " + password + " '" + installDir + "/mysql/bin/mysql --defaults-extra-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;
|
||||
@ -3003,7 +3003,7 @@ int main(int argc, char *argv[])
|
||||
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";
|
||||
cmd = installDir + "/bin/remote_command.sh " + remoteModuleIP + " " + password + " '" + installDir + "/mysql/bin/mysql --defaults-extra-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;
|
||||
|
@ -2567,7 +2567,7 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
||||
|
||||
// target = root password
|
||||
oam::DeviceNetworkList devicenetworklist;
|
||||
status = processManager.setMySQLReplication(devicenetworklist, oam::UnassignedName, false, true, target, false);
|
||||
status = processManager.setMySQLReplication(devicenetworklist, oam::UnassignedName, false, false, target, false);
|
||||
|
||||
log.writeLog(__LINE__, "Disable MySQL Replication status: " + oam.itoa(status) );
|
||||
|
||||
@ -3439,6 +3439,9 @@ void ProcessManager::recycleProcess(string module)
|
||||
|
||||
//restart ExeMgrs/mysql if module is a pm
|
||||
if ( moduleType == "pm" ) {
|
||||
// restartProcessType("DBRMWorkerNode");
|
||||
// restartProcessType("PrimProc");
|
||||
// restartProcessType("WriteEngineServer");
|
||||
restartProcessType("ExeMgr");
|
||||
restartProcessType("mysql");
|
||||
}
|
||||
@ -3448,20 +3451,60 @@ void ProcessManager::recycleProcess(string module)
|
||||
if ( PrimaryUMModuleName == module )
|
||||
{
|
||||
restartProcessType("DDLProc", module);
|
||||
// restartProcessType("DDLProc", module, false);
|
||||
sleep(1);
|
||||
restartProcessType("DMLProc", module);
|
||||
// restartProcessType("DMLProc", module, false);
|
||||
}
|
||||
|
||||
if( moduleType == "pm" && PrimaryUMModuleName != module)
|
||||
{
|
||||
// restartProcessType("DBRMControllerNode", module);
|
||||
// sleep(1);
|
||||
reinitProcessType("DDLProc");
|
||||
sleep(1);
|
||||
restartProcessType("DMLProc", module);
|
||||
// restartProcessType("DMLProc", module, false);
|
||||
}
|
||||
|
||||
//wait for DMLProc to go ACTIVE
|
||||
/* uint16_t rtn = 0;
|
||||
bool bfirst = true;
|
||||
while (rtn == 0)
|
||||
{
|
||||
ProcessStatus DMLprocessstatus;
|
||||
try {
|
||||
oam.getProcessStatus("DMLProc", PrimaryUMModuleName, DMLprocessstatus);
|
||||
}
|
||||
catch (exception& ex)
|
||||
{
|
||||
// string error = ex.what();
|
||||
// log.writeLog(__LINE__, "EXCEPTION ERROR on getProcessStatus: " + error, LOG_TYPE_ERROR);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
// log.writeLog(__LINE__, "EXCEPTION ERROR on getProcessStatus: Caught unknown exception!", LOG_TYPE_ERROR);
|
||||
}
|
||||
|
||||
if (DMLprocessstatus.ProcessOpState == oam::BUSY_INIT) {
|
||||
if (bfirst)
|
||||
{
|
||||
log.writeLog(__LINE__, "Waiting for DMLProc to finish rollback" , LOG_TYPE_INFO);
|
||||
bfirst = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (DMLprocessstatus.ProcessOpState == oam::ACTIVE) {
|
||||
rtn = oam::ACTIVE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (DMLprocessstatus.ProcessOpState == oam::FAILED) {
|
||||
rtn = oam::FAILED;
|
||||
break;
|
||||
}
|
||||
|
||||
// wait some more
|
||||
sleep(2);
|
||||
}
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4970,17 +4970,6 @@ int ProcessMonitor::runMasterRep(std::string& masterLogFile, std::string& master
|
||||
|
||||
log.writeLog(__LINE__, "runMasterRep function called", LOG_TYPE_DEBUG);
|
||||
|
||||
//get mysql user password
|
||||
string mysqlpw = oam::UnassignedName;
|
||||
try {
|
||||
mysqlpw = oam.getMySQLPassword();
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
|
||||
if ( mysqlpw == oam::UnassignedName )
|
||||
mysqlpw = "";
|
||||
|
||||
SystemModuleTypeConfig systemModuleTypeConfig;
|
||||
try {
|
||||
oam.getSystemConfig(systemModuleTypeConfig);
|
||||
@ -5023,8 +5012,7 @@ int ProcessMonitor::runMasterRep(std::string& masterLogFile, std::string& master
|
||||
string ipAddr = (*pt1).IPAddr;
|
||||
|
||||
string logFile = "/tmp/master-rep-columnstore-" + moduleName + ".log";
|
||||
string cmd = startup::StartUp::installDir() + "/bin/master-rep-columnstore.sh --password=" +
|
||||
mysqlpw + " --installdir=" + startup::StartUp::installDir() + " --hostIP=" + ipAddr + " > " + logFile + " 2>&1";
|
||||
string cmd = startup::StartUp::installDir() + "/bin/master-rep-columnstore.sh --installdir=" + startup::StartUp::installDir() + " --hostIP=" + ipAddr + " > " + logFile + " 2>&1";
|
||||
log.writeLog(__LINE__, "cmd = " + cmd, LOG_TYPE_DEBUG);
|
||||
|
||||
system(cmd.c_str());
|
||||
@ -5051,22 +5039,6 @@ int ProcessMonitor::runMasterRep(std::string& masterLogFile, std::string& master
|
||||
}
|
||||
}
|
||||
|
||||
//got check for password and bypass config check
|
||||
if ( passwordError )
|
||||
{
|
||||
try {
|
||||
mysqlpw = oam.getMySQLPassword();
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
|
||||
if ( mysqlpw == oam::UnassignedName )
|
||||
{
|
||||
log.writeLog(__LINE__, "master-rep-columnstore.sh: MySQL Password Error", LOG_TYPE_ERROR);
|
||||
return oam::API_FAILURE;
|
||||
}
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -5140,17 +5112,6 @@ int ProcessMonitor::runSlaveRep(std::string& masterLogFile, std::string& masterL
|
||||
|
||||
log.writeLog(__LINE__, "runSlaveRep function called", LOG_TYPE_DEBUG);
|
||||
|
||||
//get mysql user password
|
||||
string mysqlpw = oam::UnassignedName;
|
||||
try {
|
||||
mysqlpw = oam.getMySQLPassword();
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
|
||||
if ( mysqlpw == oam::UnassignedName )
|
||||
mysqlpw = "";
|
||||
|
||||
// get master replicaion module IP Address
|
||||
string PrimaryUMModuleName;
|
||||
oam.getSystemConfig("PrimaryUMModuleName", PrimaryUMModuleName);
|
||||
@ -5169,8 +5130,7 @@ int ProcessMonitor::runSlaveRep(std::string& masterLogFile, std::string& masterL
|
||||
bool passwordError = false;
|
||||
while(true)
|
||||
{
|
||||
string cmd = startup::StartUp::installDir() + "/bin/slave-rep-columnstore.sh --password=" +
|
||||
mysqlpw + " --installdir=" + startup::StartUp::installDir() + " --masteripaddr=" + masterIPAddress + " --masterlogfile=" + masterLogFile + " --masterlogpos=" + masterLogPos + + " --port=" + port + " > /tmp/slave-rep-columnstore.log 2>&1";
|
||||
string cmd = startup::StartUp::installDir() + "/bin/slave-rep-columnstore.sh --installdir=" + startup::StartUp::installDir() + " --masteripaddr=" + masterIPAddress + " --masterlogfile=" + masterLogFile + " --masterlogpos=" + masterLogPos + + " --port=" + port + " > /tmp/slave-rep-columnstore.log 2>&1";
|
||||
|
||||
log.writeLog(__LINE__, "cmd = " + cmd, LOG_TYPE_DEBUG);
|
||||
|
||||
@ -5200,24 +5160,6 @@ int ProcessMonitor::runSlaveRep(std::string& masterLogFile, std::string& masterL
|
||||
return oam::API_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
//got check for password and bypass config check
|
||||
if ( passwordError )
|
||||
{
|
||||
try {
|
||||
mysqlpw = oam.getMySQLPassword();
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
|
||||
if ( mysqlpw == oam::UnassignedName )
|
||||
{
|
||||
log.writeLog(__LINE__, "slave-rep-columnstore.sh: MySQL Password Error", LOG_TYPE_ERROR);
|
||||
return oam::API_FAILURE;
|
||||
}
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
return oam::API_FAILURE;
|
||||
@ -5235,19 +5177,7 @@ int ProcessMonitor::runDisableRep()
|
||||
|
||||
log.writeLog(__LINE__, "runDisableRep function called", LOG_TYPE_DEBUG);
|
||||
|
||||
//get mysql user password
|
||||
string mysqlpw = oam::UnassignedName;
|
||||
try {
|
||||
mysqlpw = oam.getMySQLPassword();
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
|
||||
if ( mysqlpw == oam::UnassignedName )
|
||||
mysqlpw = "";
|
||||
|
||||
string cmd = startup::StartUp::installDir() + "/bin/disable-rep-columnstore.sh --password=" +
|
||||
mysqlpw + " --installdir=" + startup::StartUp::installDir() + " > /tmp/disable-rep-columnstore.log 2>&1";
|
||||
string cmd = startup::StartUp::installDir() + "/bin/disable-rep-columnstore.sh --installdir=" + startup::StartUp::installDir() + " > /tmp/disable-rep-columnstore.log 2>&1";
|
||||
|
||||
log.writeLog(__LINE__, "cmd = " + cmd, LOG_TYPE_DEBUG);
|
||||
|
||||
|
@ -22,5 +22,5 @@
|
||||
#
|
||||
# Execute script on test database
|
||||
#
|
||||
/usr/local/mariadb/columnstore/mysql/bin/mysql --defaults-file=/usr/local/mariadb/columnstore/mysql/my.cnf -f -u root $1 <$6 > $logFileName.test.log 2>&1
|
||||
/usr/local/mariadb/columnstore/mysql/bin/mysql --defaults-extra-file=/usr/local/mariadb/columnstore/mysql/my.cnf -f -u root $1 <$6 > $logFileName.test.log 2>&1
|
||||
diff $logFileName.ref.log $logFileName.test.log > $logFileName.diff.log
|
||||
|
@ -186,7 +186,7 @@ function execOneTestRun {
|
||||
fi
|
||||
if [ $dbmsType = "M" ]; then
|
||||
pathSfn=$1\/$sess
|
||||
/usr/local/mariadb/columnstore/mysql/bin/mysql --defaults-file=/usr/local/mariadb/columnstore/mysql/my.cnf -u root $testDB <$sfn 2> $pathSfn\/$sfn.err.log |grep "^Calpont" > $pathSfn\/$sfn.log &
|
||||
/usr/local/mariadb/columnstore/mysql/bin/mysql --defaults-extra-file=/usr/local/mariadb/columnstore/mysql/my.cnf -u root $testDB <$sfn 2> $pathSfn\/$sfn.err.log |grep "^Calpont" > $pathSfn\/$sfn.log &
|
||||
else
|
||||
su - oracle -c "sqlplus /nolog @/home/qa/srv/common/script/callogin.sql $testDB $testDB xe srvqaperf2 <$sfn" |grep "^Calpont" > $1\/$sess\/$sfn.log &
|
||||
fi
|
||||
|
@ -19,5 +19,5 @@
|
||||
#
|
||||
# Execute script on test database
|
||||
#
|
||||
/usr/local/mariadb/columnstore/mysql/bin/mysql --defaults-file=/usr/local/mariadb/columnstore/mysql/my.cnf -u root $1 <$2 > $logFileName.test.log
|
||||
/usr/local/mariadb/columnstore/mysql/bin/mysql --defaults-extra-file=/usr/local/mariadb/columnstore/mysql/my.cnf -u root $1 <$2 > $logFileName.test.log
|
||||
exit 0
|
||||
|
Reference in New Issue
Block a user