How to deploy Apache Druid on AWS EC2 Instance
Tags: druid, aws, database, ec2
Published: 2022-12-07 18:48:09

> An easy way to deploy Apache Druid on EC2 in order to load data from any source .

## Introduction

Currently, real-time analysis plays a large role and is a symbol of competitiveness in the technology sector due to the fact the amount of data grows exponentially and the same way the great variety of tools, for this reason, I want to show you how we can use one of them call Apache Druid and how you can deploy it on EC2 instances as easy as a fast way.

---

## Apache Druid

Druid is a high-performance real-time analytics database. Druid’s main value add is to reduce time to insight and action.

Druid is designed for workflows where fast queries and ingest really matter. Druid excels at powering UIs, running operational (ad-hoc) queries, or handling high concurrency. Consider Druid as an open-source alternative to data warehouses for a variety of use cases. The [**_design documentation_**](https://druid.apache.org/docs/latest/design/architecture.html) explains the key concepts.

---

## Step by step for deploying:

1. Go to the AWS EC2 console
2. Create a new EC2 instance
3. Install Apache Druid
4. Run & Open Druid on your browser

## Here we go!

Before launching an EC2 instance you keeping in mind this [_**Quickstart documentation**_](https://druid.apache.org/docs/latest/tutorials/index.html) where we must consider a virtual server with 16 GiB of RAM for this reason we going to choose a _t2.xlarge_ with _4 vCPUs & 16 RAM (GiB)_.

## Create a new EC2 instance

We are ready to create an EC2 instance, as follows :

- OS 👉 Ubuntu 22.04
- Instance Type 👉 t2.xlarge
- Create a Security Group with the Inbound rules indicated in the image
- Launch instance


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n3d5c4dorpuyeixdggnw.png)

![Choose OS & Instance Type](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/opx9nfuswhiwrirt5l6e.png)

![Inbound Rules](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eddpn04rexbkiwu8ikyj.png)

## Install Apache Druid

Now, we are going to connect to your instance recently created from SSH and configure it with this little step-by-step:



```
1) sudo apt update -y
2) sudo apt install openjdk-8-jdk -y
3) wget https://dlcdn.apache.org/druid/24.0.0/apache-druid-24.0.0-bin.tar.gz (Last updated version)
4) tar -xzf apache-druid-24.0.0-bin.tar.gz
5) cd apache-druid-24.0.0
6) export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
7) export DRUID_HOME=/home/ubuntu/apache-druid-24.0.0
8) PATH=$JAVA_HOME/bin:$DRUID_HOME/bin:$PATH

```


## Run Apache Druid

Finally, we can run Apache Druid from the EC2 instance with the command

`./bin/start-micro-quickstart`

![Run Druid on EC2 Instances](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uqkh041x2tequizin0sz.gif)

## Apache Druid in action 🚀

Now, you can open your browser in order to see the web console in the URL 👉 _**AWS Public IPv4 address:8888**_


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1smetgn6p2gjc2dnwew3.gif)

---

## Summary

As you can see deploying Apache Druid on an EC2 instance is so easy, on the other hand, is one of the best ways to analyze data in real-time from Kafka topics by applying simple SQL queries for free because is open source.


Thank you for reading this far. If you find this article useful, like and share this article. Someone could find it useful too and why not invite me for a coffee.

[![Sponsor 💵](https://sinestesiaradio.net/images/paypal-donate-button-high-quality-png-1_orig.png)](https://www.paypal.com/donate/?hosted_button_id=GBVXVLXMETRHE)