Monday, September 12, 2016

Repairing Offline Volume

                                                   Repairing Offline Volume

If you see below alarm on the cluster while running "maprcli alarm list" command then its potentially a dangerous situation.

Below alarm means Hbase volume is unavailable due to at least one of the copy of Hbase volume doesn't have master.

1472843464042           1            Volume data unavailable                                                                                             VOLUME_ALARM_DATA_UNAVAILABLE         mapr.hbase            

On running "maprcli dump volumeinfo -volumename mapr.hbase -json" and if we see any container in below state where we see Container 2051 doesn't have a valid master. This is due to CLDB expecting latest copy of this container to be present on Node 10.10.70.116 i.e Epoch 42 , but due to some specific reason this copy is offline.
It would be ideal to login into node which has latest copy and get MFS and the SP on which container reside online for other replica's to resync from this container. This could involve running fsck command on the storage pools (or disks) if offlined due to error signal by MFS.

 {
                        "ContainerId":2051,
                        "Epoch":42,
                        "Master":"unknown ip (0)-0-VALID",
                        "ActiveServers":{

                        },
                        "InactiveServers":{
                                "IP:Port":[
                                        "10.10.70.109:5660--41",
                                        "10.10.70.117:5660--40"
                                ]
                        },
                        "UnusedServers":{
                                "IP:Port":"10.10.70.116:5660--42"
                        },
                        "OwnedSizeMB":"367 MB",
                        "SharedSizeMB":"11.88 GB",
                        "LogicalSizeMB":"28.17 GB",
                        "TotalSizeMB":"13.29 GB",
                        "NumInodesInUse":11503,
                        "Mtime":"Wed Jun 01 09:46:32 CDT 2016",
                        "NameContainer":"false",
                        "CreatorContainerId":0,
                        "CreatorVolumeUuid":"",
                        "UseActualCreatorId":false
                },

In event for XYZ reason you are not able to get container with latest Epoch online and are certain you can never get it online i.e due to disk failure, Sp formatted etc only then follow below steps to get the volume online.

Note :- Promoting replica container to master can cause data loss, this method is only supposed to be used in case of disaster and you wish to get back volume online accepting the data loss .

Promoting Container 

1) From the earlier output we can see container on 10.10.70.109 is closest to latest Epoch so we would chose to promote 2051 container on this node .
2) First we need to find SP on which container 2051 resides . From below output we can see this container is on SP1 ( /dev/sdb ) with SPID "077bf85e6e8423410057abfe210ced0f"

[root@node9 ~]# /opt/mapr/server/mrconfig info dumpcontainers | grep 2051
cid:2051 volid:41208203 sp:SP1:/dev/sdb spid:077bf85e6e8423410057abfe210ced0f prev:0 next:0 issnap:0 isclone:0 deleteinprog:0 fixedbyfsck:0 stale:1 querycldb:0 resyncinprog:0

3) Now promote this container via below command

[root@node9 ~]# /opt/mapr/server/mrconfig cntr forcemaster 2051 077bf85e6e8423410057abfe210ced0f
Container Force master for container 2051 on spid 077bf85e6e8423410057abfe210ced0f

4) Now this container which was missing master has master but to make the volume consistent and NC to be aware of this changes we need to run GFSCK on hbase volume with repair option.

/opt/mapr/bin/gfsck rwvolume=mapr.hbase -d -r -y &               ( -d for Debug   -r  for repair   -y  assume yes    &  for running in Background )                                                                                                      

Once above completes please check the report , if everything went well and fixes were done as needed you would see message as below "GlobalFsck completed successfully"

=== End of GlobalFsck Report ===

  remove volume mapr.hbase from global-fsck mode (ret = 0) ...

GlobalFsck completed successfully (7264 ms); Result: repair succeeded
=== === === === === === === === === === === === === === === === === 



Sunday, September 4, 2016

Mrconfig


                                        Mrconfig


The mrconfig commands let you create, remove, and manage containers, storage pools, disk groups, and disks; and provide various useful information.

Note :- The mrconfig commands provide direct control and access to MapR-FS at a low level. If you are not careful, or do not know what you are doing, you can irrevocably destroy valuable data.

1) /opt/mapr/server/mrconfig disk list list all disks assigned to MFS on the node

2) /opt/mapr/server/mrconfig sp list -v lists all SP’s and its details with disk names

3) Display information about containers on a local node

/opt/mapr/server/mrconfig info dumpcontainers

4) Display information about containers on a remote node with an IP address of xx.xx.xx.xx

/opt/mapr/server/mrconfig -h xx.xx.xx.xx info dumpcontainers

5) Details of number of inodes resynced/pending to be resynced for the container.

mrconfig cntr resyncprogress --cids <cid>

6) List all the running threads in MFS

/opt/mapr/server/mrconfig info threads

7) List detail memory usage by each work area .

/opt/mapr/server/mrconfig info slabs

8) List containers in volume

/opt/mapr/server/mrconfig info containerlist users
Volume containers

2074

9) Send FCR (Full container report) to inform cldb that fs changed

/opt/mapr/server/mrconfig set config send.fcr 1

10) To disable and enable/reset default throttling for particular CID .

/opt/mapr/server/mrconfig cntr disablethrottle <cid>

/opt/mapr/server/mrconfig cntr resetthrottle <cid>

11) To disable network throttling we need to set Network Throttle factor to high number say 200 etc.
/opt/mapr/server/mrconfig resync <command> <params>
Note: Default value of FS Resync Network Throttle Factor = 20

setresyncnetworkthrottlefactor <non zero integer>









Tuesday, August 9, 2016

Script that run's when you install RPM Files



                              Script that run's when you install RPM Files

        

Sometimes we need to find specific file or jars belong to which package while troubleshooting and would like to get same package installed on problematic node as well usually "rpm -qf  <File-name>" works fine. 

Like say i need to find which package in mapr packages mapr fsck utility via below command we get the package name or some jar we see the package where the jar came from.

[root@node1 mapr]# rpm -qf /opt/mapr/server/fsck
mapr-core-internal-4.0.2.29870.GA-1.x86_64

[root@node1 pig-0.14]# rpm -qf pig-0.14.0-mapr-SNAPSHOT.jar
mapr-pig-0.14.201608040131-1.noarch

But now lets take below case where we get pig-core-h2.jar is not owned by any package but we are certain this jar was part of a rpm install yet we don't get rite answer when we query using the file.

[root@node1 pig-0.14]# rpm -qf pig-core-h2.jar 
file /opt/mapr/pig/pig-0.14/pig-core-h2.jar is not owned by any package

This is because rpm packages can run scripts after a package is added or removed . How do we view pre/post install and uninstall rpm file scripts (RHEL)?

The option –scripts to rpm command displays the package specific script(s) that are used as part of the installation and uninstallation processes. Use the following command line option to view rpm file scripts for .rpm file.


rpm -qp --scripts <RPM-Name>.rpm
Example : To list all scripts which will be run as part of "mapr-pig-0.14.201608040131-1.noarch.rpm" install.

[root@node1 pig-0.14]# rpm -qp --scripts /tmp/mapr-pig-0.14.201608040131-1.noarch.rpm 
postinstall scriptlet (using /bin/sh):

# this is install
mkdir -p "/opt/mapr/pig/pig-0.14"/conf
diffR=$(diff -r "/opt/mapr/pig/pig-0.14"/conf "/opt/mapr/pig/pig-0.14"/conf.new | grep "^Only in " | grep "conf.new" | sed "s/^Only in //" | sed "s/: /\//")
for i in `echo $diffR`; do
    j=$(echo $i | sed 's/conf.new/conf/g')
    cp -Rp $i $j 
done

ln -sf /opt/mapr/pig/pig-0.14/bin/pig /opt/mapr/bin/
ln -sf /opt/mapr/pig/pig-0.14/bin/pig /usr/bin/pig


#
# single pig jar for post-yarn releases
#
if [ -f /opt/mapr/MapRBuildVersion ]; then
    MAPR_VERSION=`cat /opt/mapr/MapRBuildVersion | awk -F "." '{print $1"."$2}'`

    #if mapr-core release >=4.0 (yarn beta) returns boolean 1, else returns boolean 0
    POST_YARN=`echo | awk -v cur=$MAPR_VERSION -v min=4.0 '{if (cur >= min) printf("1"); else printf ("0");}'`
    if [[ $POST_YARN == 0 ]]; then
echo POST_YARN=$POST_YARN, removing yarn jars    
        rm -f  /opt/mapr/pig/pig-0.14/pig-core-h1.jar
        mv /opt/mapr/pig/pig-0.14/pig-*-h1.jar /opt/mapr/pig/pig-0.14/pig-core-h1.jar
        mv /opt/mapr/pig/pig-0.14/contrib/piggybank/java/piggybank-h1.jar /opt/mapr/pig/pig-0.14/contrib/piggybank/java/piggybank.jar
        rm /opt/mapr/pig/pig-0.14/contrib/piggybank/java/piggybank-h2.jar
        rm /opt/mapr/pig/pig-0.14/pig-*-h2.jar
        mv /opt/mapr/pig/pig-0.14/conf/pig.properties.3.x /opt/mapr/pig/pig-0.14/conf/pig.properties
    else
# mv *-h2.jar to *.jar
echo POST_YARN=$POST_YARN, replacing MR1 jars
 rm -f  /opt/mapr/pig/pig-0.14/pig-core-h2.jar
        mv /opt/mapr/pig/pig-0.14/pig-*-h2.jar /opt/mapr/pig/pig-0.14/pig-core-h2.jar
        mv /opt/mapr/pig/pig-0.14/contrib/piggybank/java/piggybank-h2.jar /opt/mapr/pig/pig-0.14/contrib/piggybank/java/piggybank.jar
        rm /opt/mapr/pig/pig-0.14/contrib/piggybank/java/piggybank-h1.jar
        rm /opt/mapr/pig/pig-0.14/pig-*-h1.jar
        rm /opt/mapr/pig/pig-0.14/conf/pig.properties.3.x
    fi    
fi

#
# change ownership
#
DAEMON_CONF="/opt/mapr/conf/daemon.conf"

if [ -f "$DAEMON_CONF" ]; then
    MAPR_USER=$( awk -F = '$1 == "mapr.daemon.user" { print $2 }' $DAEMON_CONF)

    if [ ! -z "$MAPR_USER" ]; then
        chown -R $MAPR_USER /opt/mapr/pig/pig-0.14
    fi
fi

##
## end of post install section
##
preuninstall program: /bin/sh
postuninstall scriptlet (using /bin/sh):

#
# last version is removed
# if package is getting purged remove entire directory
# we may need to remove pig/pig-X/logs
#
if [ "$1" = "0" ]; then
    rm -Rf /opt/mapr/pig/pig-0.14/logs
    rm -Rf /opt/mapr/pig/pig-0.14/conf

    rm -f /opt/mapr/bin/pig
    rm -f /usr/bin/pig
fi

##
## end of post uninstall section
##
[root@node1 pig-0.14]# 

To view scripts for installed packages, enter:

rpm -q --scripts <Package name>

Example :

[root@node1 pig-0.14]# rpm -qa | grep pig
mapr-pig-0.14.201608040131-1.noarch
[root@node1 pig-0.14]# rpm -q --scripts mapr-pig-0.14.201608040131-1.noarch
postinstall scriptlet (using /bin/sh):

# this is install
mkdir -p "/opt/mapr/pig/pig-0.14"/conf
diffR=$(diff -r "/opt/mapr/pig/pig-0.14"/conf "/opt/mapr/pig/pig-0.14"/conf.new | grep "^Only in " | grep "conf.new" | sed "s/^Only in //" | sed "s/: /\//")
for i in `echo $diffR`; do
    j=$(echo $i | sed 's/conf.new/conf/g')
    cp -Rp $i $j 
done

ln -sf /opt/mapr/pig/pig-0.14/bin/pig /opt/mapr/bin/
ln -sf /opt/mapr/pig/pig-0.14/bin/pig /usr/bin/pig


#
# single pig jar for post-yarn releases
#
if [ -f /opt/mapr/MapRBuildVersion ]; then
    MAPR_VERSION=`cat /opt/mapr/MapRBuildVersion | awk -F "." '{print $1"."$2}'`

    #if mapr-core release >=4.0 (yarn beta) returns boolean 1, else returns boolean 0
    POST_YARN=`echo | awk -v cur=$MAPR_VERSION -v min=4.0 '{if (cur >= min) printf("1"); else printf ("0");}'`
    if [[ $POST_YARN == 0 ]]; then
echo POST_YARN=$POST_YARN, removing yarn jars    
        rm -f  /opt/mapr/pig/pig-0.14/pig-core-h1.jar
        mv /opt/mapr/pig/pig-0.14/pig-*-h1.jar /opt/mapr/pig/pig-0.14/pig-core-h1.jar
        mv /opt/mapr/pig/pig-0.14/contrib/piggybank/java/piggybank-h1.jar /opt/mapr/pig/pig-0.14/contrib/piggybank/java/piggybank.jar
        rm /opt/mapr/pig/pig-0.14/contrib/piggybank/java/piggybank-h2.jar
        rm /opt/mapr/pig/pig-0.14/pig-*-h2.jar
        mv /opt/mapr/pig/pig-0.14/conf/pig.properties.3.x /opt/mapr/pig/pig-0.14/conf/pig.properties
    else
# mv *-h2.jar to *.jar
echo POST_YARN=$POST_YARN, replacing MR1 jars
 rm -f  /opt/mapr/pig/pig-0.14/pig-core-h2.jar
        mv /opt/mapr/pig/pig-0.14/pig-*-h2.jar /opt/mapr/pig/pig-0.14/pig-core-h2.jar
        mv /opt/mapr/pig/pig-0.14/contrib/piggybank/java/piggybank-h2.jar /opt/mapr/pig/pig-0.14/contrib/piggybank/java/piggybank.jar
        rm /opt/mapr/pig/pig-0.14/contrib/piggybank/java/piggybank-h1.jar
        rm /opt/mapr/pig/pig-0.14/pig-*-h1.jar
        rm /opt/mapr/pig/pig-0.14/conf/pig.properties.3.x
    fi    
fi

#
# change ownership
#
DAEMON_CONF="/opt/mapr/conf/daemon.conf"

if [ -f "$DAEMON_CONF" ]; then
    MAPR_USER=$( awk -F = '$1 == "mapr.daemon.user" { print $2 }' $DAEMON_CONF)

    if [ ! -z "$MAPR_USER" ]; then
        chown -R $MAPR_USER /opt/mapr/pig/pig-0.14
    fi
fi

##
## end of post install section
##
preuninstall program: /bin/sh
postuninstall scriptlet (using /bin/sh):

#
# last version is removed
# if package is getting purged remove entire directory
# we may need to remove pig/pig-X/logs
#
if [ "$1" = "0" ]; then
    rm -Rf /opt/mapr/pig/pig-0.14/logs
    rm -Rf /opt/mapr/pig/pig-0.14/conf

    rm -f /opt/mapr/bin/pig
    rm -f /usr/bin/pig
fi

##
## end of post uninstall section
##
[root@node1 pig-0.14]# 


Friday, August 5, 2016

Run Pig Jobs with Oozie

           

                           Run Pig Jobs with Oozie          


This Blog assumes below Oozie and Pig package are already installed on running MapR cluster and Steps from blog 1 is already followed.

mapr-oozie-4.1.0.201606271017-1.noarch
mapr-oozie-internal-4.1.0.201606271017-1.noarch
mapr-pig-0.14.201608040131-1.noarch

http://abizeradenwala.blogspot.com/2015/07/installing-oozie-and-running-sample-job.html


Since Oozie is current bundled with Pig v0.12 we will need below steps for oozie pig action to work.

/opt/mapr/oozie/oozie-4.1.0/share1/lib/pig/pig-withouthadoop-0.12.1-mapr-1408-h2.jar
/opt/mapr/oozie/oozie-4.1.0/share1/lib/pig-2/pig-withouthadoop-0.12.1-mapr-1408-h2.jar

1) The Oozie share/lib directory has two sets of JAR files for Pig.  We will use the Pig JAR files from the share/lib/pig-2 directory with MapR distribution versions 4.0.0 and later.
To specify the JAR files for a given Pig job, add the following section to the workflow.xml file:


<name>oozie.action.sharelib.for.pig</name>
<value>pig-2</value>

2) Stop Oozie:
maprcli node services -name oozie -action stop -nodes <nodes>

3)  Remove all files located within the /opt/mapr/oozie/oozie<version>/share2/lib/pig*/ directory EXCEPT the oozie-sharelib-pig-<version>-mapr.jar file.

Now copy new Pig jars to share lib location,
cp <PIG_HOME>/pig-core-h2.jar <OOZIE_HOME>/share2/lib/pig-2/
cp <PIG_HOME>/lib/* <OOZIE_HOME>/share2/lib/pig-2/ 

4) Remove the zookeeper jars .


rm -rf <OOZIE_HOME>/share2/lib/pig-2/zookeeper*.jar

5) Now move all the old jars in latest share lib in MaprFS to temp location.

hadoop fs -mv /oozie/share/lib/lib_20160804181903/pig-2/* /abizer

And now copy latest jars into share lib in MaprFS

hadoop fs -put /opt/mapr/oozie/oozie-4.1.0//share2/lib/pig-2/*   /oozie/share/lib/lib_20160804181903/pig-2

6) Copy work-flow.xml to maprfs which is specified in job.properties file

hadoop fs -put workflow.xml /user/mapr/examples/apps/pig/workflow.xml

Example of my workflow.xml
[mapr@node3 pig-2]$ cat /opt/mapr/oozie/oozie-4.1.0/examples/apps/pig/workflow.xml
<workflow-app xmlns="uri:oozie:workflow:0.2" name="pig-wf">
    <start to="pig-node"/>
    <action name="pig-node">
        <pig>
            <job-tracker>${jobTracker}</job-tracker>
            <name-node>${nameNode}</name-node>
            <prepare>
                <delete path="${nameNode}/user/${wf:user()}/output-data/pig"/>
            </prepare>
            <configuration>
                <property>
                    <name>mapred.job.queue.name</name>
                    <value>${queueName}</value>
                </property>
                <property>
                    <name>mapred.compress.map.output</name>
                    <value>true</value>
                </property>
                <property>
                        <name>oozie.action.sharelib.for.pig</name>
                        <value>pig-2</value>
                 </property>
            </configuration>
            <script>id.pig</script>
            <param>INPUT=/user/${wf:user()}/input-data/text</param>
            <param>OUTPUT=/user/${wf:user()}/output-data/pig</param>
        </pig>
        <ok to="end"/>
        <error to="fail"/>
    </action>
    <kill name="fail">
        <message>Pig failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <end name="end"/>
</workflow-app>

7 ) Start Oozie:
maprcli node services -name oozie -action start -nodes <nodes>

8) As user MapR i am running sample workflow.

[mapr@node3 root]$ /opt/mapr/oozie/oozie-4.1.0/bin/oozie job -oozie="http://localhost:11000/oozie" -config /opt/mapr/oozie/oozie-4.1.0/examples/apps/pig/job.properties -run
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/mapr/oozie/oozie-4.1.0/lib/slf4j-simple-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/mapr/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
job: 0000000-160805145748028-oozie-mapr-W

9) On checking the status pig wf was successfully executed by Oozie.

[mapr@node3 root]$ /opt/mapr/oozie/oozie-4.1.0/bin/oozie job -info 0000000-160805145748028-oozie-mapr-W -oozie="http://localhost:11000/oozie"
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/mapr/oozie/oozie-4.1.0/lib/slf4j-simple-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/mapr/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
Job ID : 0000000-160805145748028-oozie-mapr-W
------------------------------------------------------------------------------------------------------------------------------------
Workflow Name : pig-wf
App Path      : maprfs:/user/mapr/examples/apps/pig
Status        : SUCCEEDED
Run           : 0
User          : mapr
Group         : -
Created       : 2016-08-05 18:58 GMT
Started       : 2016-08-05 18:58 GMT
Last Modified : 2016-08-05 18:59 GMT
Ended         : 2016-08-05 18:59 GMT
CoordAction ID: -

Actions
------------------------------------------------------------------------------------------------------------------------------------
ID                                                                            Status    Ext ID                 Ext Status Err Code
------------------------------------------------------------------------------------------------------------------------------------
0000000-160805145748028-oozie-mapr-W@:start:                                  OK        -                      OK         -        
------------------------------------------------------------------------------------------------------------------------------------
0000000-160805145748028-oozie-mapr-W@pig-node                                 OK        job_1470423487588_0001 SUCCEEDED  -        
------------------------------------------------------------------------------------------------------------------------------------
0000000-160805145748028-oozie-mapr-W@end                                      OK        -                      OK         -        
------------------------------------------------------------------------------------------------------------------------------------

[mapr@node3 root]$






Wednesday, August 3, 2016

Rename SP in MapR


                                                 Rename SP in MapR

Sometimes for consistency Admin would want SP name to be same as the old SP name even after SP is recreated. Usually after SP is recreated it doesn't have the same original SP name .


Below are the steps to rename an SP. 

[root@node-1 ~]# /opt/mapr/server/mrconfig sp list 
ListSPs resp: status 0:2 
No. of SPs (2), totalsize 584687 MB, totalfree 583859 MB 

SP 0: name SP1, Online, size 290295 MB, free 289881 MB, path /dev/sdb 
SP 1: name SP2, Online, size 294391 MB, free 293978 MB, path /dev/sde 

[root@node-1 ~]# /opt/mapr/server/mrconfig sp offline /dev/sde 

[root@node-1 ~]# /opt/mapr/server/mrconfig sp list 
ListSPs resp: status 0:2 
No. of SPs (2), totalsize 290295 MB, totalfree 289881 MB 

SP 0: name SP1, Online, size 290295 MB, free 289881 MB, path /dev/sdb 
SP 1: name SP2, Offline, size 307197 MB, free 0 MB, path /dev/sde 

[root@qa-node-111 ~]# /opt/mapr/server/mrconfig sp rename -n SP4 /dev/sde 
SP renamed to SP4 

[root@node-1 ~]# /opt/mapr/server/mrconfig sp online /dev/sde 

[root@node-1 ~]# /opt/mapr/server/mrconfig sp list 
ListSPs resp: status 0:2 
No. of SPs (2), totalsize 584687 MB, totalfree 583859 MB 

SP 0: name SP1, Online, size 290295 MB, free 289881 MB, path /dev/sdb 
SP 1: name SP4, Online, size 294391 MB, free 293977 MB, path /dev/sde 

Now SP2 is rename to SP4 as needed. 

Thursday, April 14, 2016

Configuring the Fair Scheduler with ACL on MapR Cluster

                   Configuring the Fair Scheduler with ACL on MapR Cluster

This blog assumes you have MapR 4.0.2 un-secure cluster installed.

1) Add below lines  to yarn-site.xml on all Resource Managers nodes followed by restart the RM.

vi /opt/mapr/hadoop/hadoop-2.5.1/etc/hadoop/yarn-site.xml

<property><name>yarn.admin.acl</name><value>mapr</value></property>
<property><name>yarn.acl.enable</name><value>true</value></property>

With this setting MapR is administrator for yarn cluster and can kill any job and submit jobs no matter what. By default, yarn.admin.acl is set to *, which means anyone can be the Admin.

Note: An empty value for the yarn.admin.acl is not considered a valid value by YARN and it will fall back on the value configured in the yarn-default.xml which will allow access to allow everyone


2) Now add below settings to fair-scheduler.xml

vi /opt/mapr/hadoop/hadoop-2.5.1/etc/hadoop/fair-scheduler.xml

<allocations>
<queue name="root">
<aclSubmitApps>mapr</aclSubmitApps>                                       <aclAdministerApps>mapr</aclAdministerApps>

<queue name="mapr">
<minResources>20000 mb,40 vcores,5 disks</minResources>
<maxResources>30000 mb,50 vcores,50 disks</maxResources>
<maxRunningApps>10</maxRunningApps>
<weight>1.0</weight>
<schedulingPolicy>fair</schedulingPolicy>
<aclSubmitApps>mapr</aclSubmitApps>
</queue>

<queue name="abizer">
<minResources>20000 mb,40 vcores,5 disks</minResources>
<maxResources>30000 mb,50 vcores,50 disks</maxResources>
<maxRunningApps>10</maxRunningApps>
<weight>1.0</weight>
<schedulingPolicy>fair</schedulingPolicy>
<aclSubmitApps>abizer</aclSubmitApps>
</queue>
</queue>
</allocations>

3)  Below output shows Queue ACL for each user where :
i) root user has no permission to submit or Administer any queue

[root@master hadoop]# hadoop queue -showacls
Queue acls for user :  root
Queue  Operations
=====================
root 
root.abizer 
root.default 
root.mapr 

Eg 1 [root@master ~]# yarn jar /opt/mapr/hadoop/hadoop-2.5.1/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.5.1-mapr-1501.jar pi 1 2
Number of Maps  = 1
Samples per Map = 2
Wrote input for Map #0
Starting Job
16/04/14 21:42:28 INFO input.FileInputFormat: Total input paths to process : 1
16/04/14 21:42:28 INFO mapreduce.JobSubmitter: number of splits:1
16/04/14 21:42:28 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1460696891161_0009
16/04/14 21:42:28 INFO security.ExternalTokenManagerFactory: Initialized external token manager class - com.mapr.hadoop.yarn.security.MapRTicketManager
16/04/14 21:42:28 INFO impl.YarnClientImpl: Submitted application application_1460696891161_0009
16/04/14 21:42:28 INFO mapreduce.JobSubmitter: Cleaning up the staging area maprfs:/var/mapr/cluster/yarn/rm/staging/root/.staging/job_1460696891161_0009
java.io.IOException: Failed to run job : User root cannot submit applications to queue root.root
            at org.apache.hadoop.mapred.YARNRunner.submitJob(YARNRunner.java:321)

Eg 2 [root@master ~]# yarn jar /opt/mapr/hadoop/hadoop-2.5.1/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.5.1-mapr-1501.jar pi -Dmapreduce.job.queuename=root.abizer 1 2
Number of Maps  = 1
Samples per Map = 2
Wrote input for Map #0
Starting Job
16/04/14 21:42:13 INFO input.FileInputFormat: Total input paths to process : 1
16/04/14 21:42:13 INFO mapreduce.JobSubmitter: number of splits:1
16/04/14 21:42:14 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1460696891161_0008
16/04/14 21:42:14 INFO security.ExternalTokenManagerFactory: Initialized external token manager class - com.mapr.hadoop.yarn.security.MapRTicketManager
16/04/14 21:42:14 INFO impl.YarnClientImpl: Submitted application application_1460696891161_0008
16/04/14 21:42:14 INFO mapreduce.JobSubmitter: Cleaning up the staging area maprfs:/var/mapr/cluster/yarn/rm/staging/root/.staging/job_1460696891161_0008
java.io.IOException: Failed to run job : User root cannot submit applications to queue root.abizer


ii) Mapr user had permission to Administer any queue and can submit app to any queue

[mapr@master hadoop]$ hadoop queue -showacls
Queue acls for user :  mapr
Queue  Operations
=====================
root  ADMINISTER_QUEUE,SUBMIT_APPLICATIONS
root.abizer  ADMINISTER_QUEUE,SUBMIT_APPLICATIONS
root.mapr  ADMINISTER_QUEUE,SUBMIT_APPLICATIONS
root.root  ADMINISTER_QUEUE,SUBMIT_APPLICATIONS

[mapr@master root]$ yarn jar /opt/mapr/hadoop/hadoop-2.5.1/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.5.1-mapr-1501.jar pi -Dmapreduce.job.queuename=root.abizer 1 2
Number of Maps  = 1
Samples per Map = 2
Wrote input for Map #0
Starting Job
16/04/14 21:40:34 INFO input.FileInputFormat: Total input paths to process : 1
16/04/14 21:40:34 INFO mapreduce.JobSubmitter: number of splits:1
16/04/14 21:40:34 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1460696891161_0007
16/04/14 21:40:35 INFO security.ExternalTokenManagerFactory: Initialized external token manager class - com.mapr.hadoop.yarn.security.MapRTicketManager
16/04/14 21:40:35 INFO impl.YarnClientImpl: Submitted application application_1460696891161_0007
16/04/14 21:40:35 INFO mapreduce.Job: The url to track the job: http://master:8088/proxy/application_1460696891161_0007/
16/04/14 21:40:35 INFO mapreduce.Job: Running job: job_1460696891161_0007
16/04/14 21:40:43 INFO mapreduce.Job: Job job_1460696891161_0007 running in uber mode : false
16/04/14 21:40:43 INFO mapreduce.Job:  map 0% reduce 0%
16/04/14 21:40:49 INFO mapreduce.Job:  map 100% reduce 0%
16/04/14 21:40:55 INFO mapreduce.Job:  map 100% reduce 100%
16/04/14 21:40:55 INFO mapreduce.Job: Job job_1460696891161_0007 completed successfully
16/04/14 21:40:55 INFO mapreduce.Job: Counters: 46
            File System Counters
                        FILE: Number of bytes read=0
                        FILE: Number of bytes written=162489
                        FILE: Number of read operations=0
                        FILE: Number of large read operations=0
                        FILE: Number of write operations=0
                        MAPRFS: Number of bytes read=336
                        MAPRFS: Number of bytes written=303
                        MAPRFS: Number of read operations=43
                        MAPRFS: Number of large read operations=0
                        MAPRFS: Number of write operations=59
            Job Counters
                        Launched map tasks=1
                        Launched reduce tasks=1
                        Data-local map tasks=1
                        Total time spent by all maps in occupied slots (ms)=4040
                        Total time spent by all reduces in occupied slots (ms)=10986
                        Total time spent by all map tasks (ms)=4040
                        Total time spent by all reduce tasks (ms)=3662
                        Total vcore-seconds taken by all map tasks=4040
                        Total vcore-seconds taken by all reduce tasks=3662
                        Total megabyte-seconds taken by all map tasks=4136960
                        Total megabyte-seconds taken by all reduce tasks=11249664
                        DISK_MILLIS_MAPS=2020
                        DISK_MILLIS_REDUCES=4870
            Map-Reduce Framework
                        Map input records=1
                        Map output records=2
                        Map output bytes=18
                        Map output materialized bytes=0
                        Input split bytes=134
                        Combine input records=0
                        Combine output records=0
                        Reduce input groups=2
                        Reduce shuffle bytes=24
                        Reduce input records=2
                        Reduce output records=0
                        Spilled Records=4
                        Shuffled Maps =1
                        Failed Shuffles=0
                        Merged Map outputs=2
                        GC time elapsed (ms)=40
                        CPU time spent (ms)=1000
                        Physical memory (bytes) snapshot=780922880
                        Virtual memory (bytes) snapshot=5446422528
                        Total committed heap usage (bytes)=722468864
            Shuffle Errors
                        IO_ERROR=0
            File Input Format Counters
                        Bytes Read=118
            File Output Format Counters
                        Bytes Written=97
Job Finished in 21.633 seconds
Estimated value of Pi is 4.00000000000000000000

iii) Abizer user had permission to submit app to “root.abizer“ queue and cannot administer any queue except itself (default behavior)

[abizer@master hadoop]$ hadoop queue -showacls
Queue acls for user :  abizer

Queue  Operations
=====================
root 
root.abizer  SUBMIT_APPLICATIONS
root.default 
root.mapr 


[abizer@master root]$ yarn jar /opt/mapr/hadoop/hadoop-2.5.1/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.5.1-mapr-1501.jar pi -Dmapreduce.job.queuename=root.mapr 1 2
Number of Maps  = 1
Samples per Map = 2
Wrote input for Map #0
Starting Job
16/04/14 21:38:29 INFO input.FileInputFormat: Total input paths to process : 1
16/04/14 21:38:29 INFO mapreduce.JobSubmitter: number of splits:1
16/04/14 21:38:30 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1460696891161_0006
16/04/14 21:38:30 INFO security.ExternalTokenManagerFactory: Initialized external token manager class - com.mapr.hadoop.yarn.security.MapRTicketManager
16/04/14 21:38:30 INFO impl.YarnClientImpl: Submitted application application_1460696891161_0006
16/04/14 21:38:30 INFO mapreduce.JobSubmitter: Cleaning up the staging area maprfs:/var/mapr/cluster/yarn/rm/staging/abizer/.staging/job_1460696891161_0006
java.io.IOException: Failed to run job : User abizer cannot submit applications to queue root.mapr

4) Audit logging :

The Resource Manager will log attempts to kill or move applications. These messages are logged by the RMAuditLogger as part of standard operational logging. 

For Eg : Mapr started application application_1460696891161_0018 and when user Abizer tries to kill the application you will see log message as below "User doesn't have permissions to MODIFY_APP"

2016-04-14 22:16:55,433 INFO org.apache.hadoop.yarn.server.resourcemanager.RMAuditLogger: USER=mapr     IP=10.10.70.112 OPERATION=Submit Application Request    TARGET=ClientRMService  RESULT=SUCCESS  APPID=application_1460696891161_0018

2016-04-14 22:17:24,489 WARN org.apache.hadoop.yarn.server.resourcemanager.RMAuditLogger: USER=abizer1  IP=10.10.70.112 OPERATION=Kill Application Request      TARGET=ClientRMService  RESULT=FAILURE  DESCRIPTION=Unauthorized user   PERMISSIONS=User doesn't have permissions to MODIFY_APP APPID=application_1460696891161_0018



To conclude Queue level setting (aclSubmitApps, aclAdministerApps) and YANR admin ACL setting (yarn.acl.enable ,yarn.admin.acl) both the setting have to be in place, even if you disable access through one way, if the user has permission through the queue setting or admin then the user will be able to kill other users job or submit job in another users queue.

Note :- Application Master Link might not be accessible in RM UI due to above change to make the link working please change hadoop.http.staticuser.user to mapr user and restart HS . 

To do so add below property to core-site.xml 

<property><name>hadoop.http.staticuser.user</name><value>mapr</value></property>