1. Description
This article focuses on using the Squirrel GUI client to connect to Phoenix, just as MySQL uses Navicat for mysql,oracle to use PL/SQL developer, making some database operations more intuitive and convenient. The installation process refers to the official documentation with slightly different steps.
Http://phoenix.apache.org/installation.html#SQL_Client
1. Remove Prior Phoenix-[version]-client.jar from the Lib directory of SQuirrel
2. Start SQuirrel and add new driver to SQuirrel (Drivers-New driver)
3. In the ' Extra Class Path ' tab, add the path to the Phoenix-[version-client.jar.
4. In Add Driver dialog box, set Name to Phoenix, and set the Example URL to Jdbc:phoenix:localhost.
5. Press List Drivers button and Org.apache.phoenix.jdbc.PhoenixDriver should is automatically populated in the Class Name Textbox. Press OK to close this dialog.
6. Switch to Alias tab and create the new Alias (Aliases-New Aliases)
7. In the dialog box, Name:any Name, Driver:phoenix, User name:anything, password:anything
8. Construct URL as Follows:jdbc:phoenix:zookeeper quorum server. For example, to connect to a local HBase use:jdbc:phoenix:localhost
9. Press Test (which should succeed if everything is setup correctly) and press OK to close.
Now double click on your newly created Phoenix alias and click Connect. Now is ready to run SQL queries against Phoenix.
2. Download
Download the installation package for the system from the official website
http://squirrel-sql.sourceforge.net/
3. Installation
Simply double-click on the downloaded installation package for a dummy install all the way next (the installation package I downloaded here is in the form of a jar package).
4. Configuration
The installed squirrel requires some additional configuration, such as a copy jar package and configuration driver.
4.1 Copy jar package
Copy the Phoenix-4.2.2-client.jar to the Lib directory of the Squirrel installation directory.
High-energy warning: Phoenix-4.2.2-client.jar can be found from the installation directory in Phoenix, if other versions of Phoenix are replaced with the corresponding Phoenix-[version]-client.jar
4.2 Start Squirrel
Go to the Squirrel installation directory and double-click Squirrel-sql.bat to start Squirrel.
4.3 Configuring driver
Enter the Drivers tab to create a new driver.
Parameter description:
Name:phoenix (other names can be filled in)
Exampleurl: Fill in the connection information for the HBase cluster's zookeeper cluster, this is jdbc:phoenix:192.168.187.128,192.168.187.129,192.168.187.130:2181
Website URL: Not filled in here
Java class path: Select Phoenix-4.2.2-client.jar (whether or not it is checked, as long as the Java class path is OK)
Class Name:org.apache.phoenix.jdbc.PhoenixDriver
4.4 Configuring aliases
Enter the Aliases tab to create a new alias.
Parameter description:
Name:phoenix (other names can be filled in)
Driver: Select Phoenix, which is the Driver you created in the previous step
URL: This is the Zookeeper connection IP and port of the HBase cluster
User Name: Fill in
Password: Fill it out
Here you can click Test for connection Testing
5. Use
In the Aliases tab, double-click the Phoenix Open connection that you just created.
Click the SQL tab to enter the SQL command line interface.
Write SQL statements and execute
In the GUI, you can also see the table fields, views, indexes and other information, which is not described here.
Configuration using squirrel GUI to connect Phoenix