Table of Contents

Tutorial: Load streaming data with HTTP push

Getting started

This tutorial shows you how to load streaming data into Apache Druid (incubating) using HTTP push via Tranquility Server.

Tranquility Server allows a stream of data to be pushed into Druid using HTTP POSTs.

For this tutorial, we'll assume you've already downloaded Druid as described in the quickstart using the micro-quickstart single-machine configuration and have it running on your local machine. You don't need to have loaded any data yet.

Download Tranquility

In the Druid package root, run the following commands:

curl -o tranquility-distribution-0.8.3.tgz
tar -xzf tranquility-distribution-0.8.3.tgz
mv tranquility-distribution-0.8.3 tranquility

The startup scripts for the tutorial will expect the contents of the Tranquility tarball to be located at tranquility under the apache-druid-0.15.1-incubating package root.

Enable Tranquility Server

  • In your conf/supervise/single-server/micro-quickstart.conf, uncomment the tranquility-server line.
  • Stop micro-quickstart cluster command (CTRL-C) then restart it again by running bin/start-micro-quickstart

As part of the output of supervise you should see something like:

Running command[tranquility-server], logging to[/stage/apache-druid-0.15.1-incubating/var/sv/tranquility-server.log]: tranquility/bin/tranquility server -configFile conf/tranquility/server.json -Ddruid.extensions.loadList=[]

You can check the log file in var/sv/tranquility-server.log to confirm that the server is starting up properly.

Send data

Let's send the sample Wikipedia edits data to Tranquility:

gunzip -k quickstart/tutorial/wikiticker-2015-09-12-sampled.json.gz 
curl -XPOST -H'Content-Type: application/json' --data-binary @quickstart/tutorial/wikiticker-2015-09-12-sampled.json http://localhost:8200/v1/post/wikipedia

Which will print something like:


This indicates that the HTTP server received 39,244 events from you, and sent 39,244 to Druid. This command may generate a "connection refused" error if you run it too quickly after enabling Tranquility Server, which means the server has not yet started up. It should start up within a few seconds. The command may also take a few seconds to finish the first time you run it, during which time Druid resources are being allocated to the ingestion task. Subsequent POSTs will complete quickly once this is done.

Once the data is sent to Druid, you can immediately query it.

If you see a sent count of 0, retry the send command until the sent count also shows 39244:


Querying your data

Please follow the query tutorial to run some example queries on the newly loaded data.


If you wish to go through any of the other ingestion tutorials, you will need to shut down the cluster and reset the cluster state by removing the contents of the var directory under the druid package, as the other tutorials will write to the same "wikipedia" datasource.

When cleaning up after running this Tranquility tutorial, it is also necessary to recomment the tranquility-server line in conf/supervise/single-server/micro-quickstart.conf before restarting the cluster.

Further reading

For more information on Tranquility, please see the Tranquility documentation.