How Recovery works in HBase

2019-03-04 03:22发布

I wanted to observe practically How Recovery Works in HBase, i had used the following snippet of code

    Put p=new Put(Bytes.toBytes("name10"));
    p.setWriteAheadLog(true);
    p.add(Bytes.toBytes("cf"), Bytes.toBytes("name"),Bytes.toBytes("Some Value 10"));
    table.setAutoFlush(true);
    table.put(p);

After executing the above code i restarted my VM (without stopping HBase) and started the HBase, when i scanned through this table the Rowkey name10 was not showing up. Where as, when i properly stopped the HBase instance and restarted the VM, it is showing perfectly(Since from MemStore the HBase pushed the data into HBase tables).
Although, my WAL was enabled why it's not able to recover. Is there any wrong in my understanding?
Where will be the WAL files are stored?I am using HBase on top of my local file system instead of HDFS....Where can i check the WAL files?

标签: hadoop hbase
2条回答
成全新的幸福
2楼-- · 2019-03-04 04:08

WAL files gets stored in .logs folder(hidden). In Stand alone mode it will takes time to write into WAL, where as in Pseudo Distributed mode it will works fine

查看更多
放荡不羁爱自由
3楼-- · 2019-03-04 04:27

Just try this :

After putting the data in table . Run " flush tablename" from hbase shell. then check

查看更多
登录 后发表回答