Reputation: 18329
One of our HBase tables was deleted, and I would like to determine how this happened. Does the HBase shell log every command issued and store it to disk?
In $HBASE_HOME/logs/ I see files such as:
hbase-<my_user>-shell-<hostname>.log.<dt>
However, the contents of all of these files are just a repitition of the following warning:
INFO [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available
Upvotes: 3
Views: 3137
Reputation: 1411
Unfortunately HBase Shell does not provide any form of logging out of the box. You could do a little work and try to correlate timing, but it might be a long shot depending on how many people have access as well as how many locations have access to the shell. To drop a table it first has to be disabled, so if you look at the HBase Master logs you should see both the disable and drop. This will give you at least a time frame which you could compare against user logins, etc.
To enable logging if you have Ruby installed, you can add the following to .irbrc:
$ cat .irbrc
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"
This would need to be in everyone's home directory, or set globally if possible.
Another option would be to setup ACLs. This would at least prevent this type of even unless you are a privileged user. See http://hbase.apache.org/0.94/book/hbase.accesscontrol.configuration.html for details regarding ACLs.
Upvotes: 1