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 Configuration.
  2. In the Remote Parcel Repository URLs section, add a new entry and type the correct Phoenix parcel repository URL, and then click Save Changes.

    The Phoenix parcel will now be available to download.

  3. In the Location selector, click the cluster name or Available Remotely.

    The Phoenix parcel that is available to download is listed as Available Remotely in the Status column.

  4. Click Download to download the Phoenix parcel to your local repository. The status changes to Downloading.
  5. 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.
  6. 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.

For instructions to install 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 properties to prevent deadlocks from occurring during index maintenance for global indexes by ensuring index updates are processed with priority higher than the 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>
    • 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 localhost:2181 /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 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.0/lib/phoenix/examples/WEB_STAT.sql