In this tutorial, we are going to install and configure Apache Drill 1.3.0 on Ubuntu 16.04.
But, before starting with the installation and configuration, let us get to know about Apache Drill.
Following is the minimum information we should know before going ahead with Apache Drill Installation and Configuration.
- Drill converts CSV files, NoSQL Databases on-the-fly to query them using SQL.
- It reduces most of the overhead for extracting analysis out of the data and enables users to focus more on important and things that matter.
- It is a revolutionary project by Apache, enabling millions of users to ping files and NoSQL tables to extract useful analysis.
Now, let us dive into the installation document we are going to follow to install Apache Drill 1.3.0.
Please go through below document which I have uploaded on my GitHub profile.
|Following are the steps which you need to follow in order to install Apache Drill 1.3.0 on Ubuntu 16.04|
|Assumptions : username is hduser|
|Step 1 : JAVA Installation|
|If you have already installed JAVA, then you can skip this step.|
|If JAVA is not installed, then please follow below steps in order to install JAVA 1.7|
|command 1 : sudo apt-get update|
|command 2 : sudo apt-get install openjdk|
|Once above commands are executed successfully, then you can run following command for verification.|
|$ java -version|
|Above command should give you output which might look something like this.|
|openjdk version "1.8.0_111"|
|OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2ubuntu0.16.04.2-b14)|
|OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)|
|JAVA version may be different based on your installation.|
|Step 2 : Download Drill Package.|
|$ wget http://getdrill.org/drill/download/apache-drill-1.3.0.tar.gz|
|Step 3 : Extract Drill Package|
|$ sudo cp apache-drill-1.3.0.tar.gz /usr/local|
|$ cd /usr/local|
|$ sudo tar -xvf apache-drill-1.3.0.tar.gz|
|$ sudo mv apache-drill-1.3.0 drill|
|Step 4 : Update .bashrc file with following contents|
|#DRILL VARIABLES START|
|#DRILL VARIABLES END|
|$ sudo nano .bashrc|
|***PASTE ABOVE MENTIONED CONTENT IN THE FILE ANYWHERE***|
|press CTRL + X|
|Step 5 : Running Drill Agent|
|Changing the permission of drill installation directory|
|$ sudo chmod -R 777 /usr/local/drill|
|Running the drill agent|
|$ sqlline -u jdbc:drill:zk=local|
|Once you run above command, you will get the drill console window|
|For verifying Drill installation, you can run following command from different terminal window.|
|Above command's output looks something like this|
|This completes Apache Drill Installation.|
|Hope this helps.|
|Thanks for having a read.|
As it is mentioned in the closing about the process running for Apache Drill – SqlLine. The following screenshot depicts the same thing. Please have a look.
Now it is to log into Apache Drill.
There are two ways in which you can do this. The first one is command prompt approach and the second and the recommended one is through the web interface.
We will see each approach one by one.
- COMMAND PROMPT
We use the following command to log into Drill Command Prompt.
$ sqlline -u jdbc:drill:zk=local
Following screenshot shows you the expected output of above command.
2. WEB INTERFACE
You can put following address in your browser window to access the Apache Drill Web Interface. This is the most preferred way of accessing drill.
The address pattern is as follows.
Now, there are plenty of ways to find out the IP Addresses. I am showing the most convenient way as below.
You can run command $hostname -I to get the IP Address. Below screenshot gives you the expected output.
You take this IP Address and insert it into the web browser. Voila, you will get the Apache Drill Web Interface. It looks something like this.
Now, before verifying whether drill works fine or not. Let us take a close look at the tabs present shown in above screenshot.
The Query tab is the one on which we are going to write our SQL queries to get the useful information out of unstructured data.
It looks something like this.
The Storage tab is the one which shows the various storage types and nodes available for use. We are going to use dfs storage type which enables us to access any file loaded into the system.
It looks something like this.
Now, it is time to test our Drill Interface.
For that, we are going to use below JSON file.
Our job is to query the above data with the help of drill interface.
For that, we are going to follow below steps.
- Load this file in your system.
- Go to Apache Drill Query Web Interface.
- Write desired query in the query window.
- Hit on Submit
- Observe the output
Below screenshot depicts this step-by-step process.
I am using FileZilla client to copy above mentioned file from my Windows system to the Ubuntu system on which drill is installed.
Note that the complete path of the input file is ‘/home/hduser/drill_input.json‘
As you can see from above screenshot, I am running a simple select * query to get the output from the input JSON file which we uploaded a few moments ago.
I think, this explains how the drill works quite clearly. It took the file from the path mentioned in SQL query and on-the-fly converted into a table to give us the result in tabular format as shown above.
The last thing that we should always do is to close the Apache Drill connection. This can be done from the command prompt !quit command. Do not forget the preceding exclamation symbol.
Below screenshot might be helpful.
This completed Apache Drill Installation and Configuration.
Hope you people had a good read.