[MCOL-404] non-root install fails on centos7 Created: 2016-11-11  Updated: 2023-10-26  Resolved: 2016-11-29

Status: Closed
Project: MariaDB ColumnStore
Component/s: ?
Affects Version/s: 1.0.4
Fix Version/s: 1.0.5

Type: Bug Priority: Critical
Reporter: David Hill (Inactive) Assignee: David Thompson (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:

amazon ec2 centos 7
virtualbox cento7


Sprint: 2016-22, 2016-23

 Description   

Was planning on setting up out Amazon AMI to be a non-root install and continued to get errors when I tried to launch. Then tried to run on regular centos7 VM, and get the same error. The same binary package works as root user install

Will test to see of problem happens on other OSs

The issue is postConfigure fails at starting up the system, single serve install

Log files point to an messaging error were a procmon thread isnt servicing the API request to get/set status. And this procmon and provmgr reports failures cauings the system not to start

Starting MariaDB Columnstore Database Platform

MariaDB Columnstore Database Platform Starting, please wait ... FAILED

ERROR: MariaDB Columnstore Process failed to start, check log files in /var/log/mariadb/columnstore

Nov 11 14:16:46 centos7 oamcpp[729]: 46.839496 |0|0|0| E 08 CAL0000: getSystemStatus: final exception: API Failure return in getSystemStatus write API
Nov 11 14:16:46 centos7 oamcpp[729]: 46.839584 |0|0|0| E 08 CAL0000: getSystemStatus: write exception: InetStreamSocket::connect: connect() error: Connection refused to: InetStre

Nov 8 03:31:27 centos7 messagequeue[4076]: 27.538974 |0|0|0| W 31 CAL0071: InetStreamSocket::read: timeout during readToMagic: socket read error: Success; InetStreamSocket: sd:



 Comments   
Comment by David Hill (Inactive) [ 2016-11-16 ]

fixed, the main issue was /var/log wasnt setup to allow the alarmmanager to write active-alarm log file and it was causing procmon to exit when it couldn't lock the file

1. change post-install to run chmod on the /var/log to fix initial issue
2. changed alarmmanager to just issue error logs and not exit on errors
3. fixed a few other issues found during non-root testing.

how to test: perform a non-root install

Comment by David Hill (Inactive) [ 2016-11-16 ]

please review, especial the post-install changes.. that is where the change was made to setup /var/log and other directories where our apps can write to that as a non-root user.

commit a74b03fdad9443f8e95c1f44d166a10d23d90e21
Author: David Hill <david.hill@mariadb.com>
Date: Wed Nov 16 23:22:25 2016 +0000

mcol-404, non-root install fixes

oam/install_scripts/columnstore | 20 +++++++++++---------
oam/install_scripts/post-install | 13 +++++++++++--
oam/install_scripts/pre-uninstall | 44 +++++++++++++++++++++++++++-----------------
oam/oamcpp/liboamcpp.cpp | 2 +-
oamapps/alarmmanager/alarmmanager.cpp | 20 ++++----------------
oamapps/postConfigure/postConfigure.cpp | 11 ++++-------

Comment by Andrew Hutchings (Inactive) [ 2016-11-17 ]

Doing this poses a potential security risk for the system. You may well find some of the Linux subsystems will revert this very quickly:

if [ $user != "root" ]; then
sudo chmod 777 /var
sudo chmod 777 /var/log
fi

The second part would be simpler if you did the following and will also cover the intention of the first part:

test -d /var/log/mariadb || sudo mkdir /var/log/mariadb >/dev/null 2>&1
test -d /var/log/mariadb/columnstore || sudo mkdir /var/log/mariadb/columnstore >/dev/null 2>&1
sudo chmod -R 777 /var/log/mariadb

Or switch that last line to the following, this would be more in-line with what other daemons do upon installation:

sudo chown -R $USER /var/log/mariadb

Comment by Andrew Hutchings (Inactive) [ 2016-11-17 ]

Assigned back for either further work or discussion. Good work though. Glad we got to the bottom of the problem.

Comment by David Hill (Inactive) [ 2016-11-17 ]

I made the suggested changes and retest. It works, non-root can write to /var/log/mariadb/columnstore and the system does start up successfully.

commit 75fc2d9ae020353d84555ec4af6592d27854a6d2
Author: David Hill <david.hill@mariadb.com>
Date: Thu Nov 17 14:42:53 2016 +0000

mcol-404 - change the way that the log dir is setup

test -d /var/log/mariadb || sudo mkdir /var/log/mariadb >/dev/null 2>&1
test -d /var/log/mariadb/columnstore || sudo mkdir /var/log/mariadb/columnstore >/dev/null 2>&1
sudo chmod -R 777 /var/log/mariadb

Comment by David Hill (Inactive) [ 2016-11-17 ]

made your suggested changes and all went well... thank you sir....

Please re-review..

Comment by Andrew Hutchings (Inactive) [ 2016-11-17 ]

Excellent!

Assigned to David T for testing as he is probably most familiar with the problem.

Comment by David Thompson (Inactive) [ 2016-11-17 ]

I was able to perform a single server install following the instructions and the install /system works ok. Will now do a multi server and also leave it up over night to check that log rotation works and doesn't mess anything up.

Comment by David Thompson (Inactive) [ 2016-11-17 ]

Tried a 2 node combined install, local disk on centos 7. Everything goes well until starting up the cluster. The script fails because the rsync command is using the root user rather than my test user mcs:

3:33]
----- Starting MariaDB Columnstore on local server -----

MariaDB Columnstore successfully started

MariaDB Columnstore Database Platform Starting, please wait ....... DONE

Run MariaDB Columnstore Replication Setup.. ERROR: Error return in running the MariaDB Columnstore Master DB Distribute, check /tmp/master-dist.logs on pm1

MariaDB Columnstore Install Failed

[3:33]
log file is:

[3:33]
rsync -vopgr -e ssh --exclude=mysql/ --exclude=test/ --exclude=infinidb_vtable/ --exclude=infinidb_querystats/ --exclude=calpontsys/ --include=/ --include=/* --exclude=* /home/mcs/mariadb/columnstore/mysql/db/ root@172.21.21.3:/home/mcs/mariadb/columnstore/mysql/db/
ESC]0;mcs@centos7:~^GESC[?1034h[mcs@centos7 ~]$ rsync -vopgr -e ssh --exclude=mysql/ --exclude=test/ --exclude=infinidb_vtable/ --exclude=infinidb_querystats/ --exclude=calpontsys/ --include=/ - ^M-include=/* --exclude=* /home/mcs/mariadb/columnstore/mysql/db/ root@172.21.21.3:/home/mcs/mariadb/columnstore/mysql/db/
root@172.21.21.3's password:
Permission denied, please try again.^M
root@172.21.21.3's password: FAILED: Invalid password

[3:33]
i.e. it is incorrectly trying to use root rather than my mcs user

Comment by David Thompson (Inactive) [ 2016-11-17 ]

also pre-uninstall fails with errors because it assumes /usr/local install. Changing the prefix variable fixes that.

Comment by David Hill (Inactive) [ 2016-11-18 ]

The pre-uninstall works just like the post-install, you have to pass it the install dir path

./mariadb/columnstore/bin/pre-uninstall --installdir=$HOME/mariadb/columnstore

Comment by David Hill (Inactive) [ 2016-11-18 ]

fixed the mysql-rep setup issue.... Fix is in the mcol-61 repo, which is for the amazona AMI feature... So the there MCOL-404 non-root install fixes will be checked into develop when the MCOL-61 is checked into root...

But did competed a non-root multi-node combo install, but still more testing will be done before passing on to review and test

MariaDB Columnstore Database Platform Starting, please wait ....... DONE

Run MariaDB Columnstore Replication Setup.. DONE

MariaDB Columnstore Install Successfully Completed, System is Active

Enter the following command to define MariaDB Columnstore Alias Commands

. /home/centos/mariadb/columnstore/bin/columnstoreAlias

Enter 'mcsmysql' to access the MariaDB Columnstore SQL console
Enter 'mcsadmin' to access the MariaDB Columnstore Admin console

Comment by David Hill (Inactive) [ 2016-11-20 ]

development branch has been updated with fixes for the non-root multi-node install.
Some came in during the merge of mcol-61 branch and others were made after the fact..

commit 9ce117f521cf8335ebcbc17ddd1b2445b42f8c2a
Author: David Hill <david.hill@mariadb.com>
Date: Sun Nov 20 22:47:54 2016 +0000

MCOL-61, ami install

oam/oamcpp/liboamcpp.cpp | 24 ++++-
oamapps/postConfigure/postConfigure.cpp | 165 ++++++++++++++++++---------------
2 files changed, 109 insertions, 80 deletions

commit 591ff9326fecada2f9e299ef5fa013a875749592
Author: David Hill <david.hill@mariadb.com>
Date: Sun Nov 20 17:52:57 2016 +0000

mcol-404

oamapps/postConfigure/postConfigure.cpp | 37 +++++++++++++++-------------------
1 file changed, 16 insertions, 21 deletions

commit 02a5624cb34674d1fc1f526f574c191187438c36
Author: David Hill <david.hill@mariadb.com>
Date: Sun Nov 20 16:29:42 2016 +0000

MCOL-404 AND MCOL-61

oam/install_scripts/master-rep-columnstore.sh | 7 ++-
oam/install_scripts/slave-rep-columnstore.sh | 7 ++-
oamapps/postConfigure/postConfigure.cpp | 72 +++++++++-------------------
3 files changed, 32 insertions, 54 deletions

commit 90706f1c93cb86604ecd6c1d5a3e8ef917d99ed5
Merge: 90ea3e2 3affcd4
Author: David Hill <david.hill@mariadb.com>
Date: Sun Nov 20 01:42:29 2016 +0000

Merge branch 'mcol-61' into develop

Generated at Thu Feb 08 02:20:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.