[ 
https://issues.apache.org/jira/browse/YARN-8062?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16409368#comment-16409368
 ] 

Sunil G commented on YARN-8062:
-------------------------------

Test steps:
{noformat}
[root@ctr-e138-1518143905142-105679-01-000002 hadoop-yarn]# sudo su - -c 
"groupadd testUser5" root
[root@ctr-e138-1518143905142-105679-01-000002 hadoop-yarn]# sudo su - -c 
"useradd testUser5 -g testUser5" root
[root@ctr-e138-1518143905142-105679-01-000002 hadoop-yarn]# sudo su - -c 
"groupadd Group5" root
[root@ctr-e138-1518143905142-105679-01-000002 hadoop-yarn]# sudo su - -c 
"usermod -a -G Group5 testUser5" root
[root@ctr-e138-1518143905142-105679-01-000002 hadoop-yarn]# groups testUser5
testUser5 : testUser5 Group5
[root@ctr-e138-1518143905142-105679-01-000002 hadoop-yarn]# sudo su - -c 
"/usr/hdp/current/hadoop-yarn-client/bin/yarn rmadmin 
-refreshUserToGroupsMappings" yarn
WARNING: YARN_LOG_DIR has been replaced by HADOOP_LOG_DIR. Using value of 
YARN_LOG_DIR.
WARNING: YARN_LOGFILE has been replaced by HADOOP_LOGFILE. Using value of 
YARN_LOGFILE.
WARNING: YARN_PID_DIR has been replaced by HADOOP_PID_DIR. Using value of 
YARN_PID_DIR.
WARNING: YARN_OPTS has been replaced by HADOOP_OPTS. Using value of YARN_OPTS.
18/03/22 10:36:37 WARN util.NativeCodeLoader: Unable to load native-hadoop 
library for your platform... using builtin-java classes where applicable
18/03/22 10:36:37 INFO client.RMProxy: Connecting to ResourceManager at 
ctr-e138-1518143905142-105679-01-000002.hwx.site/172.27.14.27:8141
[root@ctr-e138-1518143905142-105679-01-000002 hadoop-yarn]# sudo su - -c 
"/usr/hdp/current/hadoop-yarn-client/bin/yarn rmadmin -getGroups testUser5" yarn
WARNING: YARN_LOG_DIR has been replaced by HADOOP_LOG_DIR. Using value of 
YARN_LOG_DIR.
WARNING: YARN_LOGFILE has been replaced by HADOOP_LOGFILE. Using value of 
YARN_LOGFILE.
WARNING: YARN_PID_DIR has been replaced by HADOOP_PID_DIR. Using value of 
YARN_PID_DIR.
WARNING: YARN_OPTS has been replaced by HADOOP_OPTS. Using value of YARN_OPTS.
18/03/22 10:36:48 WARN util.NativeCodeLoader: Unable to load native-hadoop 
library for your platform... using builtin-java classes where applicable
18/03/22 10:36:48 INFO client.RMProxy: Connecting to ResourceManager at 
ctr-e138-1518143905142-105679-01-000002.hwx.site/172.27.14.27:8141
testUser5 : testUser5 Group5
[root@ctr-e138-1518143905142-105679-01-000002 hadoop-yarn]# sudo su - -c 
"gpasswd -d testUser5 Group5" root
Removing user testUser5 from group Group5
[root@ctr-e138-1518143905142-105679-01-000002 hadoop-yarn]# groups testUser5
testUser5 : testUser5
[root@ctr-e138-1518143905142-105679-01-000002 hadoop-yarn]# sudo su - -c 
"/usr/hdp/current/hadoop-yarn-client/bin/yarn rmadmin 
-refreshUserToGroupsMappings" yarn
WARNING: YARN_LOG_DIR has been replaced by HADOOP_LOG_DIR. Using value of 
YARN_LOG_DIR.
WARNING: YARN_LOGFILE has been replaced by HADOOP_LOGFILE. Using value of 
YARN_LOGFILE.
WARNING: YARN_PID_DIR has been replaced by HADOOP_PID_DIR. Using value of 
YARN_PID_DIR.
WARNING: YARN_OPTS has been replaced by HADOOP_OPTS. Using value of YARN_OPTS.
18/03/22 10:37:09 WARN util.NativeCodeLoader: Unable to load native-hadoop 
library for your platform... using builtin-java classes where applicable
18/03/22 10:37:09 INFO client.RMProxy: Connecting to ResourceManager at 
ctr-e138-1518143905142-105679-01-000002.hwx.site/172.27.14.27:8141
[root@ctr-e138-1518143905142-105679-01-000002 hadoop-yarn]# sudo su - -c 
"/usr/hdp/current/hadoop-yarn-client/bin/yarn rmadmin -getGroups testUser5" yarn
WARNING: YARN_LOG_DIR has been replaced by HADOOP_LOG_DIR. Using value of 
YARN_LOG_DIR.
WARNING: YARN_LOGFILE has been replaced by HADOOP_LOGFILE. Using value of 
YARN_LOGFILE.
WARNING: YARN_PID_DIR has been replaced by HADOOP_PID_DIR. Using value of 
YARN_PID_DIR.
WARNING: YARN_OPTS has been replaced by HADOOP_OPTS. Using value of YARN_OPTS.
18/03/22 10:37:13 WARN util.NativeCodeLoader: Unable to load native-hadoop 
library for your platform... using builtin-java classes where applicable
18/03/22 10:37:13 INFO client.RMProxy: Connecting to ResourceManager at 
ctr-e138-1518143905142-105679-01-000002.hwx.site/172.27.14.27:8141
testUser5 : testUser5
[root@ctr-e138-1518143905142-105679-01-000002 hadoop-yarn]# sudo su - -c 
"/usr/hdp/current/hadoop-yarn-client/bin/yarn rmadmin -getGroups testUser5" yarn
WARNING: YARN_LOG_DIR has been replaced by HADOOP_LOG_DIR. Using value of 
YARN_LOG_DIR.
WARNING: YARN_LOGFILE has been replaced by HADOOP_LOGFILE. Using value of 
YARN_LOGFILE.
WARNING: YARN_PID_DIR has been replaced by HADOOP_PID_DIR. Using value of 
YARN_PID_DIR.
WARNING: YARN_OPTS has been replaced by HADOOP_OPTS. Using value of YARN_OPTS.
18/03/22 10:37:17 WARN util.NativeCodeLoader: Unable to load native-hadoop 
library for your platform... using builtin-java classes where applicable
18/03/22 10:37:17 INFO client.RMProxy: Connecting to ResourceManager at 
ctr-e138-1518143905142-105679-01-000002.hwx.site/172.27.14.27:8141
testUser5 : testUser5{noformat}
In Summary, *sudo su - -c "/usr/hdp/current/hadoop-yarn-client/bin/yarn rmadmin 
-getGroups testUser5" yarn* and *groups testUser5* gives same o/p.

 

[~leftnoteasy] pls help to review the patch. We also had to make change in 
AdminService.java in addition to RM init call.

> yarn rmadmin -getGroups returns group from which the user has been removed
> --------------------------------------------------------------------------
>
>                 Key: YARN-8062
>                 URL: https://issues.apache.org/jira/browse/YARN-8062
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: Sumana Sathish
>            Assignee: Sunil G
>            Priority: Critical
>         Attachments: YARN-8062.001.patch
>
>
> {code:title= adding group hrt_yarn_rmadmin_test}
> sudo su - -c "groupadd hrt_yarn_rmadmin_test" root
> {code}
> {Code:title=adding user hrt_yarn_rmadmin_test to group hrt_yarn_rmadmin_test}
> sudo su - -c "useradd hrt_yarn_rmadmin_test -g hrt_yarn_rmadmin_test" root
> {Code}
> {Code:title= adding group hrt_yarn_rmadmin_test_group2 }
> sudo su - -c "groupadd hrt_yarn_rmadmin_test_group2" root
> {Code}
> {Code:title=adding user hrt_yarn_rmadmin_test to group 
> hrt_yarn_rmadmin_test_group2}
> sudo su - -c "usermod -a -G hrt_yarn_rmadmin_test_group2 
> hrt_yarn_rmadmin_test" root
> {Code}
> Refresh and getGroups
> {code}
> yarn rmadmin -refreshUserToGroupsMappings
> /usr/hdp/current/hadoop-yarn-client/bin/yarn rmadmin -getGroups 
> hrt_yarn_rmadmin_test
> hrt_yarn_rmadmin_test : hrt_yarn_rmadmin_test hrt_yarn_rmadmin_test_group2
> {code}
> Delete group hrt_yarn_rmadmin_test_group2 from user hrt_yarn_rmadmin_test  
> and refresh and do getGroups.
> We can still see group hrt_yarn_rmadmin_test_group2
> {code}
> sudo su - -c "gpasswd -d hrt_yarn_rmadmin_test hrt_yarn_rmadmin_test_group2" 
> root
> {code}
> Removing user hrt_yarn_rmadmin_test from group hrt_yarn_rmadmin_test_group2
> {code}
> bash-4.2$  /usr/hdp/current/hadoop-yarn-client/bin/yarn rmadmin 
> -refreshUserToGroupsMappings
> /usr/hdp/current/hadoop-yarn-client/bin/yarn rmadmin -getGroups 
> hrt_yarn_rmadmin_test
> hrt_yarn_rmadmin_test : hrt_yarn_rmadmin_test hrt_yarn_rmadmin_test_group2
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to