Part 1: How to Install DBeaver on Linux Server and Connect to Secure Cloudera Impala from Windows 10 using Xming

Query Cloudera Impala on DBeaver using Xming from a Windows 10 machine

Arun Algude
Clairvoyant Blog

--

DBeaver and Cloudera Impala (Source)

About DBeaver

While we can run Impala and Hive queries with the Hue service that comes with Cloudera, it is can be easier to run them on SQL Editor Tools, such as DBeaver. DBeaver is a free and open-source SQL Editor Tool that can connect to almost any databases that have the JDBC driver.

If your Cloudera cluster is secured with TLS and Kerberos, you know how hard it is to set up the Impala JDBC connection using any third-party SQL editor. So, I am sharing in this blog a detailed set of steps you can take to successfully connect to Cloudera Impala using DBeaver with TLS and Kerberos on CentOS 7 server and access this on your local Windows 10 using Xming.

Let’s get started!

Prerequisites

  • OS: CentOs 7 Server
  • OpenJDK/OracleJDK 8
  • DBeaver Community Edition 7.3.0 [https://dbeaver.io/download/]
  • Xming: It is a leading X Window System Server [https://sourceforge.net/projects/xming/]
  • Impala JDBC Connector 2.6.12 and Impala JDBC driver [impalaJDBC41.jar]
  • Cloudera Clusters krb5.conf configuration file
  • TLS certificate file of the cluster [cmtruststore.jks- You can get this from your Hadoop Admin team or you can find this in the Cloudera Manager host on path /opt/cloudera/security/ x509/]

DBeaver Setup Steps

A: Install OpenJDK 8 on CentOs server

Step 1: Update the System packages

As a best practice, we’ll update the system packages before installing any new programs:
yum -y update

Step 2: Install OpenJDK 8

yum install java-1.8.0-openjdk

Step 3: Check the installed Java Version

java -version

Output:

java -version
openjdk version "1.8.0_262"
OpenJDK Runtime Environment (build 1.8.0_262-b10)
OpenJDK 64-Bit Server VM (build 25.262-b10, mixed mode)

B: Set up Java Home for DBeaver

vi /etc/profile.d/java.sh

export JAVA_HOME=/usr/lib/jvm/java
export PATH=$JAVA_HOME/bin:$PATH

C: Download the Impala JDBC connector 2.6.12 from the link below

Once downloaded, extract the Impala JDBC connector file and you will have the Impala JDBC driver i.e impalaJDBC41.jar

Link: https://www.cloudera.com/downloads/connectors/impala/jdbc/2-6-15.html

D: Download and Install the DBeaver Community Edition 7.3.0

Step 1: Download the DBeaver Community Edition 7.3.0 RPM file from the link below:

Link: https://dbeaver.io/download/
https://dbeaver.io/download/

wget https://dbeaver.io/files/dbeaver-ce-latest-stable.x86_64.rpm

[root@cf5beef45c32 ~]# wget https://dbeaver.io/files/dbeaver-ce-latest-stable.x86_64.rpm

Connecting to download.dbeaver.com (download.dbeaver.com)|205.185.216.10|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 60313052 (58M) [application/x-rpm]
Saving to: ‘dbeaver-ce-latest-stable.x86_64.rpm’
100%[==============================================================================================================================>] 60,313,052 1.18MB/s in 21s2020–12–10 09:18:35 (2.78 MB/s) — ‘dbeaver-ce-latest-stable.x86_64.rpm’ saved [60313052/60313052][root@cf5beef45c32 ~]# ls -lhrt
total 58M
-rw-r — r — 1 root root 58M Nov 29 21:14 dbeaver-ce-latest-stable.x86_64.rpm
-rwxr-xr-x 1 root root 1.2K Dec 8 16:28 ca-chain.cert.pem

Step 2: Install dbeaver-ce-latest-stable.x86_64.rpm using RPM on CentOS 7 Server

rpm -Uvh dbeaver-ce-latest-stable.x86_64.rpm

[root@cf5beef45c32 ~]# rpm -Uvh dbeaver-ce-latest-stable.x86_64.rpm
Preparing... ################################# [100%]
Updating / installing...
1:dbeaver-ce-0:7.3.0-stable ################################# [100%]

Step 3: Configure the DBeaver to make a connection to Impala
a. Go to DBeaver configuration location i.e /usr/share/dbeaver

[root@cf5beef45c32 ~]# cd /usr/share/dbeaver[root@cf5beef45c32 dbeaver]# ll
total 168
drwxr-xr-x 4 root root 4096 Dec 10 09:21 configuration
-rwxr-xr-x 1 root root 61176 Nov 29 12:35 dbeaver
-rw-r--r-- 1 root root 886 Nov 29 12:35 dbeaver.appdata.xml
-rw-r--r-- 1 root root 254 Nov 29 12:35 dbeaver.ini
-rw-r--r-- 1 root root 7919 Nov 29 12:35 dbeaver.png
drwxr-xr-x 19 root root 4096 Dec 10 09:21 features
-rw-r--r-- 1 root root 35021 Nov 29 12:35 icon.xpm
drwxr-xr-x 2 root root 4096 Dec 10 09:21 licenses
drwxr-xr-x 3 root root 4096 Dec 10 09:21 p2
drwxr-xr-x 7 root root 36864 Dec 10 09:21 plugins
-rw-r--r-- 1 root root 1810 Nov 29 12:35 readme.txt

b. Edit dbeaver.ini file with the below configuration

vi dbeaver.ini

-startup
plugins/org.eclipse.equinox.launcher_1.5.700.v20200207-2156.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.1100.v20190907-0426
-vmargs
-XX:+IgnoreUnrecognizedVMOptions
--add-modules=ALL-SYSTEM
-Xms64m
-Xmx1024m
-Djavax.security.auth.useSubjectCredsOnly=false
-Djava.security.krb5.conf=/usr/share/dbeaver/krb5.conf
-Dsun.security.krb5.debug=true

c. Copy krb5.conf from cluster host to DBeaver configuration Path /usr/share/dbeaver/ on centos 7 server

Note: Make sure you have installed Kerberos client and are able to take a user ticket using kinit command. If not, use the below command to install:

yum install krb5-workstation

F: Download Impala JDBC Connector on CentOS server

Step 1: Go to the Cloudera download page link below and download the Impala JDBC connector.

In this blog, I am using the Impala JDBC connector 2.6.12

Link:

https://www.cloudera.com/downloads/connectors/impala/jdbc/2-6-12.html

Step 2: Extract the Impala JDBC connector file and copy the impala Jar [ImpalaJDBC41.jar]

Link:

https://www.cloudera.com/downloads/connectors/impala/jdbc/2-6-12.html

[root@cf5beef45c32 dbeaver]# wget https://downloads.cloudera.com/connectors/ClouderaImpala_JDBC_2.6.12.1013.zip
--2020-12-10 12:19:50-- https://downloads.cloudera.com/connectors/ClouderaImpala_JDBC_2.6.12.1013.zip
Resolving downloads.cloudera.com (downloads.cloudera.com)... 13.227.234.16, 13.227.234.14, 13.227.234.13, ...
Connecting to downloads.cloudera.com (downloads.cloudera.com)|13.227.234.16|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 29643607 (28M) [application/zip]
Saving to: ‘ClouderaImpala_JDBC_2.6.12.1013.zip’
100%[==============================================================================================================================>] 29,643,607 4.83MB/s in 7.1s2020-12-10 12:19:58 (3.96 MB/s) - ‘ClouderaImpala_JDBC_2.6.12.1013.zip’ saved [29643607/29643607][root@cf5beef45c32 dbeaver]# unzip ClouderaImpala_JDBC_2.6.12.1013.zip
Archive: ClouderaImpala_JDBC_2.6.12.1013.zip
creating: ClouderaImpala_JDBC_2.6.12.1013/
inflating: ClouderaImpala_JDBC_2.6.12.1013/ClouderaImpalaJDBC4-2.6.12.1013.zip
creating: __MACOSX/
creating: __MACOSX/ClouderaImpala_JDBC_2.6.12.1013/
inflating: __MACOSX/ClouderaImpala_JDBC_2.6.12.1013/._ClouderaImpalaJDBC4-2.6.12.1013.zip
creating: ClouderaImpala_JDBC_2.6.12.1013/docs/
inflating: ClouderaImpala_JDBC_2.6.12.1013/docs/Cloudera-JDBC-Driver-for-Impala-Install-Guide.pdf
creating: __MACOSX/ClouderaImpala_JDBC_2.6.12.1013/docs/
inflating: __MACOSX/ClouderaImpala_JDBC_2.6.12.1013/docs/._Cloudera-JDBC-Driver-for-Impala-Install-Guide.pdf
inflating: ClouderaImpala_JDBC_2.6.12.1013/docs/third-party-licenses.txt
inflating: __MACOSX/ClouderaImpala_JDBC_2.6.12.1013/docs/._third-party-licenses.txt
inflating: ClouderaImpala_JDBC_2.6.12.1013/docs/Cloudera-JDBC-Driver-for-Impala-Release-Notes.txt
inflating: __MACOSX/ClouderaImpala_JDBC_2.6.12.1013/docs/._Cloudera-JDBC-Driver-for-Impala-Release-Notes.txt
inflating: __MACOSX/ClouderaImpala_JDBC_2.6.12.1013/._docs
inflating: ClouderaImpala_JDBC_2.6.12.1013/ClouderaImpalaJDBC41-2.6.12.1013.zip
inflating: __MACOSX/ClouderaImpala_JDBC_2.6.12.1013/._ClouderaImpalaJDBC41-2.6.12.1013.zip
inflating: __MACOSX/._ClouderaImpala_JDBC_2.6.12.1013
[root@cf5beef45c32 ClouderaImpala_JDBC_2.6.12.1013]# ll
total 53732
drwxr-xr-x 2 root root 4096 May 24 2019 docs
-rw-rw-rw- 1 root root 25803862 May 10 2019 ImpalaJDBC41.jar
[root@cf5beef45c32 ClouderaImpala_JDBC_2.6.12.1013]# cp ImpalaJDBC41.jar /usr/share/dbeaver/

G: Download and install the Xming for accessing DBeaver on your Windows 10 system

Step 1: Download and install Xming from the link below:

https://sourceforge.net/projects/xming/files/Xming/6.9.0.31/Xming-6-9-0-31-setup.exe/download

Note: While Installing Xming, keep all the values to default.

Step 2: Configuring Xming

Now Open XLaunch from your Windows machine and follow the below steps for the configuration:

H: Open DBeaver on a local Windows 10 machine

Step 1: Set the display variable with your Windows Machine IP and Port that we configured in Xlaunch on Centos 7 Server

Press Windows+R to open the “Run” box. Type “cmd” and then click on “OK” to open a regular Command Prompt.

Then run “ipconfig” to get the windows machine’s IP address

Step 2: Copy the IP address of your windows machine and go to Centos 7 server and run the below command:

export DISPLAY=<Windows-IP>:<port>

Step 3: Open DBeaver on CentOs server 7

Run the below command, and it will open DBeaver on your Windows 10 machine using the Xming Server that we installed and configured in the above steps.

dbeaver

Note: If DBeaver gives out an error for the Eclipse package, please download the latest version of Eclipse and install it on the server.

Now, we have installed all the pre-requisites we need for DBeaver and in the next part of the blog, we are going to connect to Cloudera Impala using DBeaver.

--

--