How To Run mapr-support-collect.sh As Non-Root User

Document created by mufeed on Feb 7, 2016
Version 1Show Document
  • View in full screen mode

Author: Mufeed Usman

 

Original Publication Date: July 1, 2015

 

Scenario:

Requirement to grant permission to non-root users to run mapr-support-collect.sh as part of internal security policies.

 

Goal:

To be able to collect cluster-wide dumps by non-root users.

 

Solution:

  • Have the non-root user setup to be able to do password-less SSH across the nodes in the cluster.
  • Have /etc/sudoers file have the required entry granting the non-root user the privileges to invoke 'root' authority. For example,         
hs2imp ALL=(root) NOPASSWD: /opt/mapr/support/tools/, /usr/bin/maprcli

          where hs2imp is the non-root user.

  • Have /etc/sudoers modified with
Defaults    !requiretty

         from

Defaults    requiretty

         to take away the need for tty to run sudo.

  • Finally, su - non-root user and invoke /opt/mapr/support/tools/mapr-support-collect.sh -u non-root user

 

Example run shown below.

[root@n65 tools]# su - hs2imp

[hs2imp@n65 ~]$ cd /opt/mapr/support/tools/

 

[hs2imp@n65 tools]$ ./mapr-support-collect.sh -u hs2imp

2015-07-02 09:01:06.8 INFO Creating nodes file

2015-07-02 09:01:06.11 INFO Querying CLDB for nodes in the cluster

2015-07-02 09:01:08.27 INFO Created nodes file

Diagnostics will be collected from 3 nodes. Press enter to continue:

2015-07-02 09:01:08.979 INFO Collecting cluster information

2015-07-02 09:01:51.517 INFO Collecting dump on 10.10.70.65

2015-07-02 09:01:51.528 INFO Collecting dump on 10.10.70.66

2015-07-02 09:01:51.539 INFO Collecting dump on 10.10.70.69

2015-07-02 09:02:29.75 INFO Copying dump from 10.10.70.65

2015-07-02 09:02:29.156 INFO Copying dump from 10.10.70.66

2015-07-02 09:02:30.613 INFO Copying dump from 10.10.70.69

2015-07-02 09:02:30.624 INFO Removing dump file from 10.10.70.65

2015-07-02 09:02:30.943 INFO Removing dump file from 10.10.70.66

2015-07-02 09:02:31.225 INFO Removing dump file from 10.10.70.69

2015-07-02 09:02:31.482 INFO Making a tarball of all the dumps

 

------------------------------------------------------------------------------------

------------------ Finished collecting diagnostics information ---------------------

------------------------------------------------------------------------------------

Successfully collected support information on cluster from CLDB.

 

Total no. of nodes from which dump collection was attempted: 3

Nodes from which support information gathering succeeded: 3

Number of nodes from which dump collection failed: 0

Number of nodes from which dump file could not be copied: 0

 

The tar ball of the dumps is available at: /opt/mapr/support/collect/2015-07-02_09-01-05-9640800a63429afe0cbefda71ee58321.tar

 

Attachments

    Outcomes