Configure transaction support

Before you can start using transactions, you must first add the Apache Omid service and configure Apache Phoenix to enable transactions. Apache Omid provides the transaction management capability in Apache Phoenix.

  • If your cluster is Kerberized, run the kinit command as hbase user before adding the Apache Omid service to the cluster. Ensure you have valid Kerberos credentials. You can list the Kerberos credentials using the klist command.

    or

    If you do not want to kinit as a hbase user, you can use Apache Ranger in the SDX Data Lake to grant the user permissions to CREATE, READ and WRITE on the commit table (default table name OMID_COMMIT_TABLE) and timestamp table (default table name OMID_TIMESTAMP_TABLE).

    Apache Omid creates and writes to OMID_COMMIT_TABLE and OMID_TIMESTAMP_TABLE during a transaction.

  • Ensure that the Apache Phoenix client doing transactions should have minimum WRITE permissions on commit table (default table name OMID_COMMIT_TABLE).

Add the Apache Omid service, and configure Apache Phoenix using Cloudera Manager.

  1. On the Home > Status tab, click to the right of the cluster name and select Add a Service. A list of service types display. You can add one type of service at a time.
  2. Select Omid and click Continue.
  3. Click Finish to complete adding the Omid service. Return to the Cloudera Manager home page.

    The Phoenix OMID TSO service listens to the 54758 port by default, which is in the ephemeral port range. Because of this, the service might randomly fail to start if the port is already used.

    To avoid this, change the TSO port to 24758. Follow these steps to change the default port.

    1. Click on the Omid service.
    2. Go to Configuration and search for OMID TSO server port.
    3. Modify the port to 24758.
    4. Enter a Reason for change, and then click Save Changes.
    5. Click (Stale configuration).
    6. Restart the Omid service when Cloudera Manager prompts you to restart.
  4. Verify the new service is started properly by checking the health status of the new service. If the Health Status is Good, then the service started properly.
  5. After the Omid service has started, go to the HBase service.
  6. Click the Configuration tab.
  7. Select Scope > Gateway.
  8. Select Category > Advanced.
  9. Locate the HBase Client Advanced Configuration Snippet property or search for HBase Client Advanced Configuration Snippet (Safety Valve) for hbase-site.xml:
    Click View as XML and add the following property value:
    <property>
      <name>phoenix.transactions.enabled</name>
      <value>true</value>
    </property>
  10. Enter a Reason for change, and then click Save Changes to commit the changes.
  11. Restart the role and service when Cloudera Manager prompts you to restart.