[MCOL-520] true non root install phase 1 Created: 2017-01-18 Updated: 2020-08-25 Resolved: 2018-11-14 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | installation |
| Affects Version/s: | 1.1.3 |
| Fix Version/s: | 1.2.1 |
| Type: | New Feature | Priority: | Critical |
| Reporter: | David Thompson (Inactive) | Assignee: | Elena Kotsinova (Inactive) |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Epic Link: | ColumnStore Installation Improvements | ||||||||
| Sprint: | 2017-12, 2017-13, 2017-14, 2017-15, 2017-16, 2017-17, 2017-18, 2017-20, 2018-17, 2018-18, 2018-19, 2018-20 | ||||||||
| Description |
|
The non root install currently requires that you enable passwordless sudo access for the account which is not as desirable. For an initial phase of improvement here, we should allow all normal ongoing operational use cases (query, dml, cpimport, shutdown, startup, etc) to work with no sudo access. Installation and system mainteance tasks such as addModule could still depend on sudo access but the more we can simplify the better. After initial review, the decision was made to move towards a model where we more mirror the core mariadb server which will be needed for convergence anyways:
|
| Comments |
| Comment by David Hill (Inactive) [ 2017-06-08 ] |
|
Initial investigation... 1. to perform the install including postConfigure, I left things set to full sudo access. Cmnd_Alias DB = /usr/sbin/fuser , /bin/chmod , /usr/sbin/lsof , /bin/chown , /bin/mount , /bin/systemctl , /bin/grep , /bin/echo , /usr/sbin/service , /bin/touch , /bin/pkill , /bin/rm , /bin/mkdir , /usr/sbin/sysctl So this means at a minimum with NO code changes, we need sudo access to allow oam processes, scripts, and APIs to call these commands. To allow things to work without any sudo access, code changes would need to be made and the Unix command list above would need to be replaced with some other C++ API command. Which I dont know if any or all are doable by the API. |
| Comment by David Thompson (Inactive) [ 2017-06-08 ] |
|
Yes, what i was thinking is can we can look at the specific cases for shutdown / startup and see if there are alternatives including not doing these calls. |
| Comment by David Hill (Inactive) [ 2017-06-13 ] |
|
plan is to document where sudo is used and review to see where we can either remove the use by not doing the call at all or replacing when something else, like a unix api call. |
| Comment by David Hill (Inactive) [ 2018-05-24 ] |
|
Have non-root install on single-node and multi-node working WITHOUT having to setup 'sudo'. At this time, this is what the user will need to do as root user before and during the install process. The main one is having to setup the system logging as root user. the chmod on some of the directories might work using 666 instead of 777, will be looking into that more.
chmod 777 /etc/profile.d mkdir -p /var/log/mariadb/columnstore // set user file limits file /etc/security/limits.conf mariadb-user hard nofile 65536 // systems that support systemctl systemctl start rc-local // add to /etc/rc.d/rc.local or /etc/rc.local /home/mariadb-user/mariadb/columnstore/bin/columnstore start
/home/mariadb-user/mariadb/columnstore/bin/syslogSetup.sh --installdir=/home/mariadb-user/mariadb/columnstore install
/home/mariadb-user/mariadb/columnstore/bin/syslogSetup.sh --installdir=/home/mariadb-user/mariadb/columnstore uninstall |
| Comment by David Hill (Inactive) [ 2018-05-24 ] |
|
A script could be written that a user would run to do the root commands, to make the install easier.. |
| Comment by David Hill (Inactive) [ 2018-05-29 ] |
|
final procedure and code before pull request...
chmod 777 /tmp // temp area for Columnstore to write temp files chmod 666 /etc/fstab // only for amazon ec2 with ebs external storage // directory for Columnstore logs mkdir -p /var/log/mariadb/columnstore // set user file limits file /etc/security/limits.conf mariadb-user hard nofile 65536 // systems that support systemctl systemctl start rc-local // add to /etc/rc.d/rc.local or /etc/rc.local runuser -l mariadb-user -c "/home/mariadb-user/mariadb/columnstore/bin/columnstore restart"
/home/mariadb-user/mariadb/columnstore/bin/syslogSetup.sh --installdir=/home/mariadb-user/mariadb/columnstore --user=mariadb-user install
/home/mariadb-user/mariadb/columnstore/bin/syslogSetup.sh --installdir=/home/mariadb-user/mariadb/columnstore --user=mariadb-user uninstall -------------------------------------------------------------------------------------------- changes added to post-install and pre-uninstall to reminder users to run syslogSetup.sh ./mariadb/columnstore/bin/post-install --installdir=/home/mariadb-user/mariadb/columnstore NOTE: For non-root install, you will need to run the following command as root user to /home/mariadb-user/mariadb/columnstore/bin/syslogSetup.sh --installdir=/home/mariadb-user/mariadb/columnstore --user=mariadb-user install |
| Comment by David Hill (Inactive) [ 2018-05-29 ] |
|
https://github.com/mariadb-corporation/mariadb-columnstore-engine/pull/484 |
| Comment by David Hill (Inactive) [ 2018-06-05 ] |
|
Successfully perform a 3 pm gluster install with current 2.1 non-root non-sudo code. So that install works... Looking into remove some of the need for using the root level directories like I dont know how to get rid of /dev/shm since its used by the C++ sharedmemory apis that ProcMon calls. Will need to see if this can be redirected to use a local non-root user directory. I did replace the need to not use these 2 directories and used local non-root files. /etc/profile.d to /home/guest/.bash_profile |
| Comment by Patrick LeBlanc (Inactive) [ 2018-09-25 ] |
|
I can help with this if necessary. |
| Comment by David Hill (Inactive) [ 2018-09-25 ] |
|
Finished the code change to make the use of /tmp dynamic based on install type. root install will continue to use /tmp |
| Comment by Patrick LeBlanc (Inactive) [ 2018-09-25 ] |
|
I started looking into procmon's /dev/shm usage, and I think the only thing we need root for is the chmod calls on /dev/shm itself. It looks like we're setting the mode to 666, which shouldn't be necessary. I think we can safely get rid of the chmods, replacing them with a test and an error msg at startup. I'm working on confirming that users do in fact have write access to /dev/shm by default for our target distros. |
| Comment by David Hill (Inactive) [ 2018-09-25 ] |
|
I don't like this option from previous comment "I think we can safely get rid of the chmods, replacing them with a test and an error msg at startup." IMHO we cant have installs failing. Better to find a solution that will always work and not depend on /dev/shm having the correct permissions for a non-root install. The main point with the non-root install is to not use any system level directories like /dev/shm so we wont run into install failures. still best to look for a solution for the non-root install to use a non-root directory like /home/mysql/.shm/dev instead of /dev/shm, if possible.. |
| Comment by Patrick LeBlanc (Inactive) [ 2018-09-26 ] |
|
/dev/shm isn't a system dir, it's just a handle for the shared mem system. But I see that we're also trying not to use /tmp, which is odd. I'll take another look at the doc to figure out what we're trying to do here. |
| Comment by David Hill (Inactive) [ 2018-09-27 ] |
|
/tmp updates.. This is how the directories will look with latest updates with a new console command: root install mcsadmin> getSystemDirectories System Installation and Temporary Logging Directories System Installation Directory = /usr/local/mariadb/columnstore mcsadmin> non-root mcsadmin> getsystemd System Installation and Temporary Logging Directories System Installation Directory = /home/mysql/mariadb/columnstore |
| Comment by David Hill (Inactive) [ 2018-10-01 ] |
|
finished the changes for /tmp and $HOME/.tmp for non-root user. and completed testing. 2 changes to go, if these are doable 1. non-root use something different than /dev/shm for shared memory But at this time, im going to run a system regression test to compare the run times from the 'develop' branch and my ' will be doing both root and non-root comparions |
| Comment by David Hill (Inactive) [ 2018-10-08 ] |
|
https://github.com/mariadb-corporation/mariadb-columnstore-engine/pull/587/ |
| Comment by David Hill (Inactive) [ 2018-10-24 ] |
|
Woo Hoo... Got non-root gluster install to work.... It will require sudo setup for 1 command and the changing permission on the gluster log file. Installing for non-root user gluster will require this extra: 1. install gluster packages on each pm 2. chmod 777 -R /var/log/glusterfs 3. edit /etc/sudoers (with correct gluster path) mysql ALL=NOPASSWD: /sbin/gluster |
| Comment by David Hill (Inactive) [ 2018-10-26 ] |
|
Got Amazon AMI non-root install working. chmod to this file /etc/rc.d/rc.local
If using EBS storage: Add to /etc/sudoers mysql ALL=NOPASSWD: /usr/sbin/mkfs.ext2 |
| Comment by David Hill (Inactive) [ 2018-11-03 ] |
|
added back in code to run the mysql_upgrade script on upgrade installs.. This is done at the end of postConfigure after the system is up and running. It only runs the script when it detects that a DB already exist |
| Comment by David Hill (Inactive) [ 2018-11-04 ] |
|
new pull request. I have finished tested all install setups excluding External storage non amazon, so system available to test that. But I beleive the sudo requestments will be the same as EBS excluding mariadb-user ALL=NOPASSWD: /usr/sbin/mkfs.ext2 https://github.com/mariadb-corporation/mariadb-columnstore-engine/pull/607/ |
| Comment by David Hill (Inactive) [ 2018-11-06 ] |
|
change to do the mysql_update script during the mariadb/msqyl post-install setup. There was an issue when it was done at the end of postConfigure. |
| Comment by David Hill (Inactive) [ 2018-11-08 ] |
|
checked into develop for 1.2.1... Patrick and I will continue retesting it from the develop branch. |
| Comment by David Hill (Inactive) [ 2018-11-12 ] |
|
I have successful done non-root installs for centos 7 and ubuntu 18. On centos 7, I did the standard way and the DBS way (no sudo access during uninstall) Will test other OS's |
| Comment by David Hill (Inactive) [ 2018-11-13 ] |
|
Tested debian8/9 ubuntu 16/18 |
| Comment by David Hill (Inactive) [ 2018-11-19 ] |
|
These are the items that this issue was going to try to achieve. Some of them were and others we place into other JIRAs for future releases. Here is more information on each item Move away from the dedicated split of root and non root installs. This is all covered by new JIRA https://jira.mariadb.org/browse/MCOL-1501 What was done for this jira for 1.2.1 1. Still have separate root and non-root installs |