Use Apache Phoenix with Linux-based Apache HBase clusters in HDInsight

Learn how to use Apache Phoenix in Azure HDInsight, and how to use SQLLine. For more information about Phoenix, see Apache Phoenix in 15 minutes or less. For the Phoenix grammar, see Apache Phoenix grammar.


For Phoenix version information about HDInsight, see What's new in the Apache Hadoop cluster versions provided by HDInsight.

Use SQLLine

SQLLine is a command-line utility to execute SQL.


Before you can use SQLLine, you must have the following items:

When you connect to an HBase cluster, you need to connect to one of the Apache ZooKeeper VMs. Each HDInsight cluster has three ZooKeeper VMs.

To get the ZooKeeper host name

  1. Open Apache Ambari by browsing to https://<cluster name>
  2. To sign in, enter the HTTP (cluster) user name and password.
  3. In the left menu, select ZooKeeper. Three ZooKeeper Server instances are listed.
  4. Select one of the ZooKeeper Server instances. On the Summary pane, find the Hostname. It looks similar to

To use SQLLine

  1. Connect to the cluster by using SSH. For more information, see Use SSH with HDInsight.

  2. In SSH, use the following commands to run SQLLine:

     cd /usr/hdp/
     ./ <ZOOKEEPER SERVER FQDN>:2181:/hbase-unsecure
  3. To create an HBase table, and insert some data, run the following commands:

     UPSERT INTO Company VALUES(1, 'Microsoft');
     SELECT * FROM Company;

For more information, see the SQLLine manual and Apache Phoenix grammar.

Next steps

In this article, you learned how to use Apache Phoenix in HDInsight. To learn more, see these articles: