Reputation: 49
I just started with hbase. Therefore I created a table and filled this table with some data. But after restarting my computer all the data has gone. This even happens when stopping hbase with stop-hbase.sh. hbase installation : pseudo distributed hbase-site.xml :
hbase.rootdir hdfs://localhost:9000/hbase
Upvotes: 2
Views: 610
Reputation: 63
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>hbase.rootdir</name>
<value>file:///Users/yadav.hariom/local_tool_setup/hbase-2.2.3/hbase_my_data/rootdir</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/Users/yadav.hariom/local_tool_setup/hbase-2.2.3/hbase_my_data/datadir</value>
</property>
</configuration>
this is working for me : https://sparkbyexamples.com/hbase/setup-run-hbase-standalone-mode/
Upvotes: 0
Reputation: 470
By default, hbase.rootdir is set to /tmp/hbase-${user.name}, which could mean you lose all your data whenever your server or test machine reboots because a lot of operating systems (OSes) clear out /tmp during a restart.
Source: Hbase the definitive guide - 2 nd edition.
If you are saving your hbase files in local dir, then add below properties in your hbase-site.xml.
<property>
<name>hbase.rootdir</name>
<value>file:///<PATH>/hbase</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>file:///<PATH>/zookeeper</value>
</property>
Upvotes: 2