Migrate existing tables to use strongly consistent indexing

You must use the index upgrade tool to rebuild your indexes. After you run this tool, your existing tables use the strongly consistent global index.

If you have Apache Phoenix tables that you migrated from Cloudera Runtime 7.1.5 or lower to Cloudera Runtime 7.1.6 or higher, you must convert the tables to use the strongly consistent index using the index upgrade tool.

  1. Perform the following as the HBase user, or as a user with HBase root privileges (global RXWCA).
  2. Run the following command for each table that has global indexes.
    hbase org.apache.phoenix.mapreduce.index.IndexUpgradeTool -o [***UPGRADE / ROLLBACK***] -tb [***TABLE NAME***]
    -lf [***/tmp/index-upgrade-tool.log***]
    

    Parameters:

    • -o: Type whether you want to upgrade or rollback.
    • -tb: Type the table name that you want to upgrade or rollback.
    • -lf: Type the path where you want to store the index upgrade tool log file.
  3. After the conversion is finished, it is highly recommended to rebuild the indexes. Use the following commands for each index.
    hbase org.apache.phoenix.mapreduce.index.IndexTool -s [***SCHEMA NAME***] -dt [***DATA TABLE NAME***] -it[***INDEX NAME***] -op /tmp/phoenix_index
    hbase org.apache.phoenix.mapreduce.index.IndexTool -fi -s [***SCHEMA NAME***] -dt [***DATA TABLE NAME***] -it[***INDEX NAME***] -op /tmp/phoenix_index

    Parameters:

    • -s: Type the schema name. Optional for default schema.
    • -dt: Type the data table name.
    • -it: Type the index name.
    • -op: Type the path where you want to store the index upgrade tool log file.