1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

fixed amazon install issues

This commit is contained in:
david hill
2017-09-12 14:31:29 -05:00
parent e4aa86e528
commit f6f15028a8
6 changed files with 145 additions and 58 deletions

View File

@ -210,6 +210,51 @@ expect {
} }
send_user "\n" send_user "\n"
#
# copy over custom OS tmp files
#
send_user "Copy Custom OS files to Module "
send_user " \n"
send "scp -rv $INSTALLDIR/local/etc $USERNAME@$SERVER:$INSTALLDIR/local\n"
if { $PASSWORD != "ssh" } {
set timeout 30
expect {
"word: " { send "$PASSWORD\n" }
"passphrase" { send "$PASSWORD\n" }
}
}
set timeout 60
expect {
"Exit status 0" { send_user "DONE" }
"scp :" { send_user "ERROR\n" ;
send_user "\n*** Installation ERROR\n" ;
exit 1 }
"Read-only file system" { send_user "ERROR: local disk - Read-only file system\n" ; exit 1}
timeout { send_user "ERROR: Timeout\n" ; exit 1 }
}
send_user "\n"
#
# copy over MariaDB Columnstore Module file
#
send_user "Copy MariaDB Columnstore Module file to Module "
send "scp -v $INSTALLDIR/local/etc/$MODULE/* $USERNAME@$SERVER:$INSTALLDIR/local/.\n"
if { $PASSWORD != "ssh" } {
set timeout 30
expect {
"word: " { send "$PASSWORD\n" }
"passphrase" { send "$PASSWORD\n" }
}
}
set timeout 60
expect {
"Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 }
"Exit status 0" { send_user "DONE" }
"Exit status 1" { send_user "ERROR: scp failed" ; exit 1 }
timeout { send_user "ERROR: Timeout to host\n" ; exit 1 }
}
send_user "\n"
send_user "Run post-install script " send_user "Run post-install script "
send_user " \n" send_user " \n"
send "ssh -v $USERNAME@$SERVER '$INSTALLDIR/bin/post-install --installdir=$INSTALLDIR'\n" send "ssh -v $USERNAME@$SERVER '$INSTALLDIR/bin/post-install --installdir=$INSTALLDIR'\n"
@ -247,26 +292,6 @@ expect {
} }
send_user "\n" send_user "\n"
if { $AMAZONINSTALL == "1" } {
#
# copy over customer OS files
#
send_user "Copy MariaDB Columnstore OS files to Module "
send_user " \n"
send "scp -v -r $INSTALLDIR/local/etc $USERNAME@$SERVER:$INSTALLDIR/local\n"
if { $PASSWORD != "ssh" } {
set timeout 30
expect {
"word: " { send "$PASSWORD\n" }
"passphrase" { send "$PASSWORD\n" }
}
}
set timeout 60
expect {
"Exit status 0" { send_user "DONE" }
}
}
send_user "\nInstallation Successfully Completed on '$MODULE'\n" send_user "\nInstallation Successfully Completed on '$MODULE'\n"
exit 0 exit 0

View File

@ -57,9 +57,11 @@ ServerTypeInstall=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation ServerTyp
cloud=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation Cloud` cloud=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation Cloud`
if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
echo "Amazon setup on Module"
cp $COLUMNSTORE_INSTALL_DIR/local/etc/credentials $HOME/.aws/. > /dev/null 2>&1 cp $COLUMNSTORE_INSTALL_DIR/local/etc/credentials $HOME/.aws/. > /dev/null 2>&1
sudo sed -i -e 's/#sudo runuser/sudo runuser/g' /etc/rc.d/rc.local sudo sed -i -e 's/#sudo runuser/sudo runuser/g' /etc/rc.d/rc.local
sudo chmod 777 /etc/rc.d/rc.local
if [ $module = "pm" ]; then if [ $module = "pm" ]; then
if test -f $COLUMNSTORE_INSTALL_DIR/local/etc/pm1/fstab ; then if test -f $COLUMNSTORE_INSTALL_DIR/local/etc/pm1/fstab ; then
echo "Setup fstab on Module" echo "Setup fstab on Module"

View File

@ -252,7 +252,76 @@ expect {
"Exit status 0" { send_user "DONE" } "Exit status 0" { send_user "DONE" }
timeout { send_user "ERROR: Timeout to host\n" ; exit 1 } timeout { send_user "ERROR: Timeout to host\n" ; exit 1 }
} }
send_user "\n"
#
# copy over calpont config file
#
send_user "Copy MariaDB Columnstore Config file to Module "
send_user " \n"
send date\n
send "scp -v $INSTALLDIR/etc/* $USERNAME@$SERVER:$INSTALLDIR/etc\n"
if { $PASSWORD != "ssh" } {
set timeout 30
expect {
"word: " { send "$PASSWORD\n" }
"passphrase" { send "$PASSWORD\n" }
}
}
set timeout 60
expect {
"Exit status 0" { send_user "DONE" }
"Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 }
"Read-only file system" { send_user "ERROR: local disk - Read-only file system\n" ; exit 1}
"Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 }
"Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 }
"No route to host" { send_user "ERROR: No route to host\n" ; exit 1 }
}
send_user "\n"
#
# copy over custom OS tmp files
#
send_user "Copy Custom OS files to Module "
send_user " \n"
send "scp -rv $INSTALLDIR/local/etc $USERNAME@$SERVER:$INSTALLDIR/local\n"
if { $PASSWORD != "ssh" } {
set timeout 30
expect {
"word: " { send "$PASSWORD\n" }
"passphrase" { send "$PASSWORD\n" }
}
}
set timeout 60
expect {
"Exit status 0" { send_user "DONE" }
"scp :" { send_user "ERROR\n" ;
send_user "\n*** Installation ERROR\n" ;
exit 1 }
"Read-only file system" { send_user "ERROR: local disk - Read-only file system\n" ; exit 1}
timeout { send_user "ERROR: Timeout\n" ; exit 1 }
}
send_user "\n"
#
# copy over MariaDB Columnstore Module file
#
send_user "Copy MariaDB Columnstore Module file to Module "
send "scp -v $INSTALLDIR/local/etc/$MODULE/* $USERNAME@$SERVER:$INSTALLDIR/local/.\n"
if { $PASSWORD != "ssh" } {
set timeout 30
expect {
"word: " { send "$PASSWORD\n" }
"passphrase" { send "$PASSWORD\n" }
}
}
set timeout 60
expect {
"Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 }
"Exit status 0" { send_user "DONE" }
"Exit status 1" { send_user "ERROR: scp failed" ; exit 1 }
timeout { send_user "ERROR: Timeout to host\n" ; exit 1 }
}
send_user "\n" send_user "\n"
send_user "Start ColumnStore service " send_user "Start ColumnStore service "
@ -274,27 +343,6 @@ expect {
send_user "\n" send_user "\n"
if { $AMAZONINSTALL == "1" } {
#
# copy over customer OS files
#
send_user "Copy MariaDB Columnstore OS files to Module "
send_user " \n"
send "scp -v -r $INSTALLDIR/local/etc $USERNAME@$SERVER:$INSTALLDIR/local\n"
if { $PASSWORD != "ssh" } {
set timeout 30
expect {
"word: " { send "$PASSWORD\n" }
"passphrase" { send "$PASSWORD\n" }
}
}
set timeout 60
expect {
"Exit status 0" { send_user "DONE" }
}
}
send_user "\nInstallation Successfully Completed on '$MODULE'\n" send_user "\nInstallation Successfully Completed on '$MODULE'\n"
exit 0 exit 0

View File

@ -2428,8 +2428,8 @@ int processCommand(string* arguments)
} }
} }
} }
//this is here because a customer likes doing a shutdownsystem then startsystem in a script
sleep(10); sleep(5);
} }
break; break;

View File

@ -1072,6 +1072,7 @@ int main(int argc, char *argv[])
// setup to start on reboot // setup to start on reboot
system("sudo sed -i -e 's/#sudo runuser/sudo runuser/g' /etc/rc.d/rc.local >/dev/null 2>&1"); system("sudo sed -i -e 's/#sudo runuser/sudo runuser/g' /etc/rc.d/rc.local >/dev/null 2>&1");
system("sudo chmod 777 /etc/rc.d/rc.local >/dev/null 2>&1");
} }
if ( pmwithum ) if ( pmwithum )
@ -5022,7 +5023,7 @@ bool makeModuleFile(string moduleName, string parentOAMModuleName)
if ( moduleName == parentOAMModuleName) if ( moduleName == parentOAMModuleName)
fileName = installDir + "/local/module"; fileName = installDir + "/local/module";
else else
return true; fileName = installDir + "/local/etc/" + moduleName + "/module";
unlink (fileName.c_str()); unlink (fileName.c_str());
ofstream newFile (fileName.c_str()); ofstream newFile (fileName.c_str());

View File

@ -162,8 +162,9 @@ int main(int argc, char **argv)
} }
//re-read local system info with updated Columnstore.xml //re-read local system info with updated Columnstore.xml
// sleep(1); sleep(1);
// MonitorConfig config; Config* sysConfig = Config::makeConfig();
MonitorConfig config;
//PMwithUM config //PMwithUM config
try { try {
@ -977,23 +978,33 @@ static void messageThread(MonitorConfig config)
Oam oam; Oam oam;
string msgPort = config.moduleName() + "_ProcessMonitor"; string msgPort = config.moduleName() + "_ProcessMonitor";
string port = "";
//ProcMon will wait for request
//ProcMon will wait for request
IOSocket fIos; IOSocket fIos;
Config* sysConfig = Config::makeConfig();
//read and cleanup port before trying to use //read and cleanup port before trying to use
try { try {
Config* sysConfig = Config::makeConfig(); port = sysConfig->getConfig(msgPort, "Port");
string port = sysConfig->getConfig(msgPort, "Port");
string cmd = "fuser -k " + port + "/tcp >/dev/null 2>&1";
if ( !rootUser)
cmd = "sudo fuser -k " + port + "/tcp >/dev/null 2>&1";
system(cmd.c_str());
} }
catch(...) catch(...)
{}
//check if enter doesnt exist, if not use pm1's
if (port.empty() or port == "" )
{ {
msgPort = "pm1_ProcessMonitor";
port = sysConfig->getConfig(msgPort, "Port");
} }
log.writeLog(__LINE__, "PORTS: " + msgPort + "/" + port, LOG_TYPE_DEBUG);
string cmd = "fuser -k " + port + "/tcp >/dev/null 2>&1";
if ( !rootUser)
cmd = "sudo fuser -k " + port + "/tcp >/dev/null 2>&1";
system(cmd.c_str());
for (;;) for (;;)
{ {
@ -1043,14 +1054,14 @@ static void messageThread(MonitorConfig config)
catch (exception& ex) catch (exception& ex)
{ {
string error = ex.what(); string error = ex.what();
// log.writeLog(__LINE__, "EXCEPTION ERROR on MessageQueueServer for " + msgPort + ": " + error, LOG_TYPE_ERROR); log.writeLog(__LINE__, "EXCEPTION ERROR on MessageQueueServer for " + msgPort + ": " + error, LOG_TYPE_ERROR);
// takes 2 - 4 minites to free sockets, sleep and retry // takes 2 - 4 minites to free sockets, sleep and retry
sleep(1); sleep(1);
} }
catch(...) catch(...)
{ {
// log.writeLog(__LINE__, "EXCEPTION ERROR on MessageQueueServer for " + msgPort + ": Caught unknown exception!", LOG_TYPE_ERROR); log.writeLog(__LINE__, "EXCEPTION ERROR on MessageQueueServer for " + msgPort + ": Caught unknown exception!", LOG_TYPE_ERROR);
// takes 2 - 4 minites to free sockets, sleep and retry // takes 2 - 4 minites to free sockets, sleep and retry
sleep(1); sleep(1);