Validating a Native Phoenix Installation on an Unsecured Cluster
To validate your installation, log in as the hbase user, navigate to the Phoenix home directory, and run the following smoke tests:
cd /usr/hdp/current/phoenix-client/bin/ ./psql.py localhost:2181:/hbase-unsecure /usr/hdp/current/phoenix-client/doc/examples/WEB_STAT.sql /usr/hdp/current/phoenix-client/doc/examples/WEB_STAT.csv /usr/hdp/current/phoenix-client/doc/examples/WEB_STAT_QUERIES.sql
Where localhost is your Zookeeper node.
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:
Set the HBASE_CONF_PATH for a secured cluster:
export HBASE_CONF_PATH=/etc/hbase/conf:/etc/hadoop/conf
![[Note]](../common/images/admon/note.png)
Note For more information, see Configuring Phoenix to Run in a Secure Cluster
Obtain a valid Kerberos ticket by running
kinit. For example:kinit -k -t /etc/security/keytabs/hbase.headless.keytab hbase
Navigate to the Phoenix home directory, and run the following smoke tests:
cd /usr/hdp/current/phoenix-client/bin/ ./psql.py localhost:2181:/hbase-unsecure /usr/hdp/current/phoenix-client/doc/examples/WEB_STAT.sql /usr/hdp/current/phoenix-client/doc/examples/WEB_STAT.csv /usr/hdp/current/phoenix-client/doc/examples/WEB_STAT_QUERIES.sql
Where
localhostis your Zookeeper node and you replace/hbase-unsecurewith your secured Zookeeper node. Check the value ofzookeeper.znode.parentin thehbase-site.xmlconfiguration file to confirm the directory path.
Validating the JDBC Connection to External Applications
If you are running external applications, it is recommended that you test the connection to HBase using the following connection strings for the Phoenix JDBC driver:
Add hbase-site.xml and core-site.xml to your application or client's class path:
set CLASSPATH=<path_to_hbase-site.xml>;<path_to_core-site.xml>
Depending on whether you have an unsecured cluster or a cluster secured with Kerberos, use one of the following connection strings to connect to HBase.
For unsecured clusters:
jdbc:phoenix:<Zookeeper_host_name>:<port_number>:<root_node>
Where <
Zookeeper_host_name> can specify one host or several hosts. If you specify several Zookeeper hosts, insert commas between host names. For example, <ZK_host1, ZK_host2, ZK_host3>.Example:
jdbc:phoenix:zk_quorum:2181:zk_parent
For clusters secured with Kerberos:
jdbc:phoenix:<Zookeeper_host_name>:<port_number>:<secured_Zookeeper_node>:<principal_name>:<HBase_headless_keytab_file>
Where <
secured_Zookeeper_node> is the path to the secured Zookeeper node, and <HBase_headless_keytab_file> is the location of this keytab file.Example:
jdbc:phoenix:zk_quorum:2181:/hbase-secure:[email protected]:/hbase-secure/keytab/keytab_file
![]() | Note |
|---|---|
If any part of the connection string is omitted, the corresponding property value (hbase.zookeeper.quorum, hbase.zookeeper.property.clientPort, or zookeeper.znode.parent) from the hbase-site.xml configuration file is used. 2181 is the default port. |

