I want to get a notification when a certain file/ directory has been deleted in HDFS. It would also be possible to generate a kind of log file with timestamp, affected file/ directory and so on. I need this due to traceability requirements.
我希望在HDFS中删除某个文件/目录时收到通知。还可以生成一种带有时间戳,受影响的文件/目录等的日志文件。由于可追溯性要求,我需要这个。
Is there any script, software et cetera to cover this kind of task?
是否有任何脚本,软件等来涵盖这类任务?
1 个解决方案
#1
Use HdfsAdmin.getInotifyEventStream(...) to open an DFSInotifyEventInputStream. Monitor the events in the stream for an event of type Event.UnlinkEvent.
使用HdfsAdmin.getInotifyEventStream(...)打开DFSInotifyEventInputStream。监视流中的事件以查找Event.UnlinkEvent类型的事件。
#1
Use HdfsAdmin.getInotifyEventStream(...) to open an DFSInotifyEventInputStream. Monitor the events in the stream for an event of type Event.UnlinkEvent.
使用HdfsAdmin.getInotifyEventStream(...)打开DFSInotifyEventInputStream。监视流中的事件以查找Event.UnlinkEvent类型的事件。