Configuring Fault Tolerance
Also available as:
PDF
loading table of contents...

Creating Highly Available HBase Tables with the HBase Java API

HBase tables are not highly available by default. To enable high availability, designate a table as HA during table creation.

HBase Java API

Create highly available HBase tables programmatically, using the Java API, as shown in the following example:

HTableDescriptor htd = 
    new HTableDesscriptor(TableName.valueOf("test_table"));
htd.setRegionReplication(2);
...
admin.createTable(htd);

This example creates a table named test_table that is replicated to one secondary region. To replicate test_table to two secondary replicas, pass 3 as a parameter to the setRegionReplication() method.