Step-by-Step: Connecting to Apache HiveServer2 from SquirrelSQL

In this Article I will show you how to Connect SquirrelSQL with HiveServer2.

Apache Hive is a Data warehouse software using which we can Read/Write & manage large datasets residing on distributed Storage systems like Hadoop using SQL Language.

HiveServer2 (HS2) is a server interface that enables remote clients to execute queries against Hive and retrieve the results. By default Hive Server runs on port 10000 & various clients can connect to it & manage the Data over there.

Firstly we need to Download the latest version of Hive Server and install it on a server if you do not have already. Document to install HiveServer2 is avaiable Here

I have installed my setup of HiveServer2 on a CentOS 6.7 machine on port 10000
I am using Hadoop 2.7.1 HDFS as distributed storage for Hive & Metadata gets stored in Derby database.

Connecting through SquirrelSQL 3.7

Step1:
Your First step will be downloading SquirrelSQL client, Which can be downloaded from Here http://squirrel-sql.sourceforge.net/#installation
You can simply extract the downloaded Package & run it by double clicking or Executing the executable JAR file squirrel-sql.jar

NOTE: Please note that SquirrelSQL runs requires Java on your machine, Make sure you have installed JRE on your PC.

Step2:
In this step we will Configure a Driver for Hive Server. To Configure a new driver Click on the Drivers Tab on the Left sidebar & Plus Sign as shown below.

squirel-sql-create-driver
Now we need to pass various values like Alias Name, Example URL which will be the default URL for every new Connection.
Name: This value can be any String, You can name it as “Hive”
Example URL: Provide value as jdbc:hive2://REMOTE_SERVER:10000/db_name where db_name is the database which you created or you can simply connect to default database. Leave website URL as Empty.

Now click on the tab “Extra Class Path” & add all the JAR files which are shown below.

hive-create-connection
These JAR files needs to be downloaded from the Hive server’s lib directory.
Once you have added the JAR files, Select all JAR files & click on “List Drivers” button. Clicking on this button should display the below class name “org.apache.hive.jdbc.HiveDriver” after “Class Name” label.
Verify & click on “OK” button.

Step3:
In this step, We will create an Alias for Connecting with Hive server, You need to configure the Alias settings as shown below.

hive-squirelsql

If your Hive Server is connected to Hadoop HDFS storage, Make sure to provide required username in the username field.

Once all the settings are Saved, Verify if the connection is working properly by clicking on “Test” button
If you see “Connection Successful” message, You’re done.

Feel free to Comment here if you face any issues during the setup.

Installing nginx-1.9.5 from source with HTTP/2 support

With the release of 1.9.5, nginx has added support for the awaited HTTP/2 protocol & it’s known that HTTP/2 has lots of performance enhancements to offer. Starting with nginx 1.9.5, SPDY module will be replaced by HTTP/2

It’s also important to know that 1.9.5 is currently an experimental version. Feel free to post if you are seeing any issues with this version.

Today i will show you the detailed steps on Installing nginx-1.9.5 from source with HTTP/2 support on a Linux server.
You need to login as root user to execute these steps.

STEP1: Install Dependencies

Since we are compiling nginx from source, we need to

yum -y install gcc pcre pcre-devel openssl openssl-devel

NOTE: Nginx http/2 module requires openssl 1.0.2 or latest version if you want to run website over HTTPS.

STEP2: Downlod the latest version of nginx & extract the archive.

cd /tmp/
wget http://nginx.org/download/nginx-1.9.5.tar.gz
tar -xzf nginx-1.9.5.tar.gz
cd nginx-1.9.5/

nginx-195

STEP3: Compile & install nginx from source.

As stated earlier, nginx will fail to compile if you try to enable SPDY module. You can see the following error.

 

spdy-disabled

Now let’s compile nginx from source.

./configure --with-http_v2_module --with-http_ssl_module
make
make install

Make sure to fix if you get any errors during compilation.

STEP4: Verify the Installation

After successful compilation & installation, check the directory /usr/local/nginx/ which will have all the installed files.

nginx-startup

Once nginx is installed successfully, you can run it using the below command

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

To test the scenario, Create a virtual host & add the directive to listen statement as shown below

server {
listen 80 http2;
......
}

or

server {
listen 443 http2;
......
}

Lastly, Test your web server for HTTP/2 support at https://www.h2check.org/

NOTE: Currently no browser supports HTTP/2 without HTTPS. This means that you are required to setup HTTP/2 over https only. Please refer this FAQ to know more