Moeb
Moeb

Reputation: 10861

How do I force HBase to run on HDFS?

I was using HBase on the native file system and created a few tables. Now I configured HDFS and want HBase to use that instead. I started Namenode and Datanode, but am not able to find a setting where I can tell HBase to use HDFS.

I thought it might pick up HDFS upon a restart, so I did that (stop-hbase + start-hbase), but I am still able to see the table I created earlier on the native file system.

How can I tell HBase to use HDFS?

Upvotes: 1

Views: 1908

Answers (1)

Lorand Bendig
Lorand Bendig

Reputation: 10650

In $HBASE_HOME/conf/hbase-site.xml hbase.rootdir defines the filesystem/directory where HBase persists. See: http://hbase.apache.org/book/config.files.html#hbase_default_configurations

I assume you want to configure HBase in pseudo-distributed mode. If so set the followings in hbase-site.xml:

<configuration>
  ...
  <property>
    <name>hbase.rootdir</name>
    <value>hdfs://localhost:9000/hbase</value>
  </property>
  <property>
    <name>dfs.replication</name>
    <value>1</value>
  </property>
  ...
</configuration>

In this case HBase will use the /hbase directory in your HDFS.

Upvotes: 4

Related Questions