Installing Apache Phoenix using Cloudera Manager
You can install Apache Phoenix using Cloudera Manager 6.3.x.
To install Apache Phoenix:
Downloading and Installing the Phoenix Parcel
Minimum Required Role: Cluster Administrator (also provided by Full Administrator)
- In the Parcels page, click Parcel Repositories & Network Settings.
- 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/. You can use the Apache Phoenix parcel version 6.2.1 in CDH 6.2 and later versions.
- Click Save Changes.
The Phoenix parcel will now be available to download.
- 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.
- Click Download to download the Phoenix parcel to your local repository. The status changes to Downloading.
- 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.
- Click Activate to activate the parcel.
You will see Distributed, Activated in the Status column.
Installing the Custom Service Descriptor File
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:
- Go to the HBase service.
- Click the Configuration tab.
- Select .
- 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.
- 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>
- Set hbase.regionserver.wal.codec to enable custom Write Ahead Log ("WAL") edits to be written as follows:
- Enter a Reason for change, and then click Save Changes to commit the changes.
- 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:
- 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>
- 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.3.x/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.