Installing Apache Phoenix using Cloudera Manager

Downloading and Installing the Phoenix Parcel

Minimum Required Role: Cluster Administrator (also provided by Full Administrator)

  1. In the Parcels page, click Parcel Repositories & Network Settings.
  2. In the Remote Parcel Repository URLs section, add a new entry and type the correct Phoenix parcel repository URL in the format: https://username:password@archive.cloudera.com/p/phoenix/<parcel_version>/parcels/. For example, https://username:password@archive.cloudera.com/p/phoenix/6.2.1/parcels/.
  3. Click Save Changes.

    The Phoenix parcel will now be available to download.

  4. In the Location selector, click the cluster name in which you want to install Phoenix.

    The Phoenix parcel is listed as Available Remotely in the Status column.

  5. Click Download to download the Phoenix parcel to your local repository. The status changes to Downloading.
  6. Click Distribute. The status changes to Distributing. During distribution, you can:
    • Click the Details link in the Status column to view the Parcel Distribution Status page.
    • Click Cancel to cancel the distribution. When the Distribute action completes, the button changes to Activate, and you can click the Distributed status link to view the status page.
  7. Click Activate to activate the parcel.

    You will see Distributed, Activated in the Status column.

Installing the Custom Service Descriptor File

You must install the Custom Service Descriptor File (CSD) file before you can add the Phoenix Query Server service in CDH. You can download the CSD file from here: https://username:password@archive.cloudera.com/p/phoenix/<parcel_version>/csd/. For example, https://username:password@archive.cloudera.com/p/phoenix/6.2.1/csd/.

For more information about installing the CSD file, see Installing an Add-on Service.

Adding the Phoenix Service

You must add the Phoenix service before you can use PQS. The Phoenix service takes care of starting and stopping the PQS. For instructions to add the Phoenix service, see Adding a Service.

Configuring HBase for use with Phoenix

Minimum Required Role: Cluster Administrator (also provided by Full Administrator)

Before you start using Phoenix, you must configure the following HBase properties using Cloudera Manager:

  1. Go to the HBase service.
  2. Click the Configuration tab.
  3. Select Scope > HBase Cluster (Service-Wide).
  4. Locate the HBase Service Advanced Configuration Snippet (Safety Valve) for hbase-site.xml property or search for it by typing its name in the Search box.
  5. Click View as XML, and add the following properties:
    • 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 property to enable user-defined functions:
      <property>
       <name>phoenix.functions.allowUserDefinedFunctions</name>
       <value>true</value>
       <description>enable UDF functions</description>
      </property>
  6. Enter a Reason for change, and then click Save Changes to commit the changes.
  7. Restart the role and service when Cloudera Manager prompts you to restart.

Validating the Phoenix Installation

Validating a Native Phoenix Installation on an Unsecured Cluster

To validate your installation, log in as the hbase user, and run the following smoke tests from the command prompt: :

phoenix-psql /opt/cloudera/parcels/<phoenix parcel>/lib/phoenix/examples/WEB_STAT.sql 
/opt/cloudera/parcels/<phoenix parcel>/lib/phoenix/examples/WEB_STAT.csv 
/opt/cloudera/parcels/<phoenix parcel>/lib/phoenix/examples/WEB_STAT_QUERIES.sql

Validating a Native Phoenix Installation on a Cluster Secured with Kerberos

To validate your installation, log in as the hbase user, and perform the following actions:

  1. Obtain a valid Kerberos ticket by running kinit. For example:
    kinit -kt var/run/cloudera-scm-agent/process/<latest-process-id>-HBASE/hbase.keytab hbase/<local.node.host.name>
    
  2. Run the following smoke tests from your command line in your cluster:
    phoenix-psql

    You will see the help displayed for the phoenix-psql script. You can test Phoenix using one of the examples that you can find here: /opt/cloudera/parcels/<Phoenix parcel>/lib/phoenix/examples

    For example,
    phoenix-psql /opt/cloudera/parcels/PHOENIX-5.0.0-cdh6.2.1/lib/phoenix/examples/WEB_STAT.sql

After you have completed installing the Apache Phoenix parcel, you can access data on Apache HBase using the Phoenix Query Server or by Orchestrating SQL and APIs with Apache Phoenix. You can use the Phoenix-Spark connector to perform READ and WRITE operations, and the Phoenix-Hive connector to access the Phoenix data from Hive without any data transfer.