0
0
Hadoopdata~20 mins

Audit logging in Hadoop - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Audit Logging Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
Audit log file content after enabling HDFS audit logging
You enabled audit logging in HDFS by setting dfs.namenode.audit.log.enabled=true in hdfs-site.xml. After restarting the NameNode, you perform a file read operation. What will you find in the audit log file?
AA summary of all file system operations without user details.
BOnly error messages related to failed operations.
CNo entries until the DataNode logs are checked.
DA log entry showing the user, operation type (READ), file path, and timestamp.
Attempts:
2 left
💡 Hint
Audit logs record detailed info about each operation including user and action.
Configuration
intermediate
1:30remaining
Configuring audit logging in Hadoop's hdfs-site.xml
Which configuration snippet correctly enables audit logging for the NameNode in Hadoop?
A
<property>
  <name>dfs.namenode.audit.log.enabled</name>
  <value>true</value>
</property>
B
<property>
  <name>dfs.datanode.audit.log.enabled</name>
  <value>true</value>
</property>
C
<property>
  <name>dfs.audit.logging</name>
  <value>enabled</value>
</property>
D
<property>
  <name>dfs.namenode.audit.enable</name>
  <value>yes</value>
</property>
Attempts:
2 left
💡 Hint
The correct property name is specific and must be exact.
Troubleshoot
advanced
2:00remaining
Why are no audit logs generated despite enabling audit logging?
You set dfs.namenode.audit.log.enabled=true and restarted the NameNode, but no audit logs appear in the expected directory. What is the most likely cause?
AThe property must be set in <code>core-site.xml</code>, not <code>hdfs-site.xml</code>.
BAudit logging only works on DataNodes, not NameNodes.
CThe NameNode user does not have write permission to the audit log directory.
DAudit logs are only generated if the cluster is in safe mode.
Attempts:
2 left
💡 Hint
Check file system permissions for the log directory.
Best Practice
advanced
1:30remaining
Best practice for managing audit log file size in Hadoop
What is the recommended way to manage audit log file size to prevent disk space issues?
AConfigure log rotation using tools like logrotate to archive and compress old audit logs.
BStore audit logs on the same disk as HDFS data for faster access.
CManually delete audit logs once a week without backups.
DDisable audit logging during peak hours to reduce log size.
Attempts:
2 left
💡 Hint
Automated log rotation helps keep logs manageable and safe.
🔀 Workflow
expert
2:30remaining
Sequence of steps to enable and verify audit logging in Hadoop HDFS
Arrange the following steps in the correct order to enable and verify audit logging on the Hadoop NameNode.
A3,1,2,4
B1,2,3,4
C1,3,2,4
D2,1,3,4
Attempts:
2 left
💡 Hint
Configuration changes require restart before testing and verification.