- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Retrieving HDFS Groups and users using programming
- Labels:
-
Apache Hadoop
-
HDFS
Created on ā09-08-2022 09:58 AM - edited ā09-08-2022 01:24 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Is there a way to retrieve all HDFS groups and respective users, in Cloudera, using Java or Scala/Spark code?
In other words, Iām looking for Java/Scala code equivalent to "hdfs groups <user1>, <user2>, ...".
Ideally, the code would run in Zeppelin.
Many thanks.
Created ā09-08-2022 01:02 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Created ā09-08-2022 12:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@phir1
I can think of something like a for maybe:
# for i in `cat <users_file>`; do hdfs groups $i; done
Created ā09-08-2022 01:04 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
thank you for your suggestion, but Iām looking for example Java or Scala code that uses the Hadoop or Cloudera API, instead of scripting the Ā« hdfs Ā» tool on Linux.
Created ā09-08-2022 01:02 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this
hdfs groups hdfs solr
