Example configuration to add to the sudoers file
The following can be used to provide root privileges to a non-root user to install Cloudera Manager server.
In the below case, user1 is a non-root user and is used to install and run Cloudera Manager server and agent on the Cloudera Manager server host.
sudoers format for RHEL7 host where Cloudera Manager server is
installed:
user1 ALL=(ALL) NOPASSWD:SETENV: /usr/bin/hostnamectl set-hostname *, /sbin/iptables-save, /usr/bin/rpm --import *,
/usr/bin/yum install *cloudera*, /usr/bin/yum install ntp, /bin/wget, /bin/systemctl status cloudera*,
/bin/systemctl disable firewalld, systemctl stop firewalld, /bin/systemctl status ntp, /bin/systemctl enable ntp,
/usr/bin/vim /etc/ntp.conf, /usr/sbin/hwclock --systohc, /bin/tail, /usr/bin/yum install java-1.8.0-openjdk-devel,
/usr/bin/yum install postgresql-server, /usr/bin/yum install python-pip, /usr/bin/pip install psycopg2==2.7.5 --ignore-installed,
/bin/systemctl enable postgresql, /bin/systemctl restart postgresql, /bin/systemctl enable cloudera-scm-server,
/bin/yum -y install openjdk8.x86_64, /bin/yum install krb5-workstation krb5-libs, /usr/bin/yum clean all,
/usr/bin/install rng-tools, /usr/bin/yum upgrade *cloudera*, /bin/systemctl restart cloudera*,
/bin/systemctl daemon-reload, /bin/systemctl start rngd, /bin/systemctl stop rngd, /bin/systemctl status rngd,
/bin/systemctl/ enable rngd, /usr/bin/ktadmin init
sudoers format for RHEL7 Cloudera Manager agent installs through the Add Host
Wizard of Cloudera Manager:user1 ALL=(ALL) NOPASSWD:SETENV: /usr/bin/hostnamectl set-hostname *, /sbin/iptables-save,
/usr/bin/rpm --import *, /usr/bin/yum --disablerepo=* --enablerepo=cloudera* *, /usr/bin/yum install ntp, /bin/wget,
/bin/systemctl status cloudera-scm-agent, /bin/systemctl status ntp, /bin/systemctl enable ntp, /usr/bin/vim /etc/ntp.conf,
/usr/sbin/hwclock --systohc, /bin/id, /usr/bin/install -m 644 --backup=numbered *, /usr/bin/rm -Rf /var/cache/yum/*,
/bin/cp /etc/cloudera-scm-agent/*, /usr/bin/sed -e * -i /etc/cloudera-scm-agent/*,
/usr/bin/tail -n * /var/log/cloudera-scm-agent/*, /usr/bin/mkdir -m 0755 -p /var/lib/cloudera-scm-agent/agent-cert,
/usr/bin/tar xf * -C /var/lib/cloudera-scm-agent/agent-cert, /bin/tail, /usr/bin/yum install java-1.8.0-openjdk-devel,
/usr/bin/yum install python-pip, /usr/bin/pip install psycopg2==2.7.5 --ignore-installed,
/bin/yum -y install openjdk8.x86_64, /bin/yum -y install *cloudera*, /bin/yum install krb5-workstation krb5-libs,
/usr/bin/yum clean all, /usr/bin/yum upgrade *cloudera*, /bin/systemctl restart cloudera*, /usr/bin/ktadmin init