Command Line Installation
Also available as:
PDF
loading table of contents...

Configuring HBase for Phoenix

To enable global indexing and local indexing in Phoenix, complete the following steps.

  1. Add the following properties to the hbase-site.xml file on all HBase nodes, the Master server, and all RegionServers.

    • Set hbase.defaults.for.version.skip to true:

      <property>
           <name>hbase.defaults.for.version.skip</name>
           <value>true</value>
      </property>
    • Set hbase.regionserver.wal.codec to enable custom Write Ahead Log ("WAL") edits to be written as follows:

      <property>
           <name>hbase.regionserver.wal.codec</name>
           <value>org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec</value>
      </property>
    • Set the following properties to prevent deadlocks from occurring during index maintenance for global indexes by ensuring index updates are processed with a higher priority than data updates. The property settings also ensure metadata RPC calls are processed with a higher priority than data RPC calls.

      <property>
        <name>hbase.region.server.rpc.scheduler.factory.class</name>
        <value>org.apache.hadoop.hbase.ipc.PhoenixRpcSchedulerFactory</value>
        <description>Factory to create the Phoenix RPC Scheduler that uses separate queues for index and metadata updates</description>
      </property>
      
      <property>
        <name>hbase.rpc.controllerfactory.class</name>
        <value>org.apache.hadoop.hbase.ipc.controller.ServerRpcControllerFactory</value>
        <description>Factory to create the Phoenix RPC Scheduler that uses separate queues for index and metadata updates</description>
      </property>
  2. To enable user-defined functions, configure the following property in the hbase-site.xml file on all HBase nodes.

    <property>
     <name>phoenix.functions.allowUserDefinedFunctions</name>
     <value>true</value>
     <description>enable UDF functions</description>
    </property>
  3. Restart the HBase Master server and the RegionServers.

[Note]Note

Repairing overlap regions inconsistencies using the hbck tool can result in a situation where local indexes are inconsistent with the data in the table. If you know the database schema, you can fix this issue by dropping and recreating all local indexes of the table after the hbck tool completes its operation. Alternatively, you can rebuild the local indexes using the following ALTER query:

ALTER INDEX IF EXISTS index_name ON data_table_name REBUILD
[Note]Note

During local index creation manual splits and bulk loads fail because they are disabled. Avoid massive data insertion (bulk loads and batch upserts) during local index creation.