- 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
