Download the SQuirrel jar from here, as per your operating system. Open the terminal and go to the directory where you have downloaded the file. Run the following command:
java -jar squirrel-sql-3.7.1-MACOSX-install.jar
Once the installer dialog pops up, follow the instructions to install SQuirreL onto your system. You can choose to select optional installs if you like. I am choosing only the base and standard install. If you want other plugins, you can select them from the list given.
Configuring SQuirrel and Phoenix Integration:
1. Make sure your Sandbox and HBase is up and running.
2. Open Additional Ports.
You need all the HBase and Region Server ports forwarded, 16000, 16010, 16020, 16030. To do this, click on the Settings button for the VM instance. Then click the Network button in the pop up window. There is a port forwarding button at the bottom, click it. Click to add each of the following ports that you don't currently have.
3. Copy the Phoenix client jar to SQuirrel
SSH to your Sandbox terminal with root user.
Check the location of phoenix client jar by navigating to /usr/hdp/18.104.22.168-817/phoenix/
Check your HDP version.
Now go back to your local machine terminal and run the following command to copy the jar from sandbox to the local machine:
Now let’s copy this jar to SQuirrel lib. On a Mac, go to Applications and click Open in Finder. Right click on SQuirrel SQL and then click on Show Package Contents. Then navigate to Contents > Resources > Java > lib and paste that phoenix client jar over here.
4. Add sandbox.hortonworks.com in /private/etc/hosts file
Type the following command
sudo vi /private/etc/hosts
And add this entry - sandbox.hortonworks.com and save the file.
5. Add Phoenix driver in SQuirrel
Open up SQuirrel, click the Drivers tab on the left side of the window, and click the plus button to create a new driver. Enter this information into the driver creation window:
Example URL: jdbc:phoenix:sandbox.hortonworks.com:2181:/hbase-unsecure
Website URL: (it should be blank)
Class Name: org.apache.phoenix.jdbc.PhoenixDriver
It should look like this:
6. Create an Alias
Switch to the Aliases tab and click the plus button to create a new alias. Enter this information in the alias creation window:
Name – PhoenixOnHortonworksSandbox
Driver – Phoenix
URL – This should be auto-populated when you select your driver with jdbc:phoenix:sandbox.hortonworks.com:2181:/hbase-unsecure
User Name – root
Password – same password that you use while ssh
It should look like this:
Once you’ve filled out the above information, click Test then select Connect. A box should pop up which says “Connection successful”.
Click OK then OK again to create the alias.
Double click on your newly created alias and click Connect. You will see a screen like this:
You should now be successfully connected and able to run SQL queries.