druid/docs/content/Indexing-Service.md

92 lines
4.7 KiB
Markdown
Raw Normal View History

---
2013-09-26 19:22:28 -04:00
layout: doc_page
---
2014-02-07 14:35:44 -05:00
Indexing Service
================
For Indexing Service Configuration, see [Indexing Service Configuration](Indexing-Service-Config.html).
2013-10-08 19:34:58 -04:00
The indexing service is a highly-available, distributed service that runs indexing related tasks. Indexing service [tasks](Tasks.html) create (and sometimes destroy) Druid [segments](Segments.html). The indexing service has a master/slave like architecture.
2013-09-13 18:20:39 -04:00
2013-12-09 08:37:48 -05:00
The indexing service is composed of three main components: a peon component that can run a single task, a [Middle Manager](Middlemanager.html) component that manages peons, and an overlord component that manages task distribution to middle managers.
Overlords and middle managers may run on the same node or across multiple nodes while middle managers and [Peons](Peons.html) always run on the same node.
2013-09-13 18:20:39 -04:00
2013-12-09 08:37:48 -05:00
Indexing Service Overview
-------------------------
![Indexing Service](../img/indexing_service.png "Indexing Service")
<!--
Preamble
--------
The truth is, the indexing service is an experience that is difficult to characterize with words. When they asked me to write this preamble, I was taken aback. I wasnt quite sure what exactly to write or how to describe this… entity. I accepted the job, as much for the challenge and inner growth as the money, and took to the mountains for reflection. Six months later, I knew I had it, I was done and had achieved the next euphoric victory in the continuous struggle that plagues my life. But, enough about me. This is about the indexing service.
The indexing service is philosophical transcendence, an infallible truth that will shape your soul, mold your character, and define your reality. The indexing service is creating world peace, playing with puppies, unwrapping presents on Christmas morning, cradling a loved one, and beating Goro in Mortal Kombat for the first time. The indexing service is sustainable economic growth, global propensity, and a world of transparent financial transactions. The indexing service is a true belieber. The indexing service is panicking because you forgot you signed up for a course and the big exam is in a few minutes, only to wake up and realize it was all a dream. What is the indexing service? More like what isnt the indexing service. The indexing service is here and it is ready, but are you?
-->
Overlord Node
2014-02-07 14:35:44 -05:00
-------------
2013-12-09 08:37:48 -05:00
The overlord node is responsible for accepting tasks, coordinating task distribution, creating locks around tasks, and returning statuses to callers. Overlord can be configured to run in one of two modes - local or remote (local being default).
In local mode overlord is also responsible for creating peons for executing tasks. When running the overlord in local mode, all middle manager and peon configurations must be provided as well.
Local mode is typically used for simple workflows. In remote mode, the overlord and middle manager are run in separate processes and you can run each on a different server.
This mode is recommended if you intend to use the indexing service as the single endpoint for all Druid indexing.
#### Submitting Tasks and Querying Task Status
2013-10-08 19:34:58 -04:00
Tasks are submitted to the overlord node in the form of JSON objects. Tasks can be submitted via POST requests to:
2013-09-13 18:20:39 -04:00
```
2013-10-08 19:34:58 -04:00
http://<OVERLORD_IP>:<port>/druid/indexer/v1/task
```
2014-03-27 18:09:42 -04:00
this will return the taskId of the submitted task.
2013-09-13 18:20:39 -04:00
2014-03-27 18:09:42 -04:00
Tasks can be cancelled via POST requests to:
2013-09-13 18:20:39 -04:00
```
2013-10-08 19:34:58 -04:00
http://<OVERLORD_IP>:<port>/druid/indexer/v1/task/{taskId}/shutdown
```
2013-09-13 18:20:39 -04:00
2013-10-08 19:34:58 -04:00
Issuing the cancel request will kill 9 the task.
2013-09-13 18:20:39 -04:00
Task statuses can be retrieved via GET requests to:
```
2013-10-08 19:34:58 -04:00
http://<OVERLORD_IP>:<port>/druid/indexer/v1/task/{taskId}/status
```
2013-09-13 18:20:39 -04:00
Task segments can be retrieved via GET requests to:
```
2013-10-08 19:34:58 -04:00
http://<OVERLORD_IP>:<port>/druid/indexer/v1/task/{taskId}/segments
```
2013-09-13 18:20:39 -04:00
2013-12-09 08:37:48 -05:00
#### Overlord Console
2013-09-13 18:20:39 -04:00
2013-10-08 19:34:58 -04:00
The overlord console can be used to view pending tasks, running tasks, available workers, and recent worker creation and termination. The console can be accessed at:
2013-09-13 18:20:39 -04:00
```
2013-12-09 08:37:48 -05:00
http://<OVERLORD_IP>:<port>/console.html
```
2013-09-13 18:20:39 -04:00
2013-10-08 19:34:58 -04:00
#### Autoscaling
2013-09-13 18:20:39 -04:00
2013-10-08 19:34:58 -04:00
The Autoscaling mechanisms currently in place are tightly coupled with our deployment infrastructure but the framework should be in place for other implementations. We are highly open to new implementations or extensions of the existing mechanisms. In our own deployments, middle manager nodes are Amazon AWS EC2 nodes and they are provisioned to register themselves in a [galaxy](https://github.com/ning/galaxy) environment.
2013-09-13 18:20:39 -04:00
2013-10-08 19:34:58 -04:00
If autoscaling is enabled, new middle managers may be added when a task has been in pending state for too long. Middle managers may be terminated if they have not run any tasks for a period of time.
2013-09-13 18:20:39 -04:00
2013-12-09 08:37:48 -05:00
Middle Managers
2014-02-07 14:35:44 -05:00
---------------
2013-09-13 18:20:39 -04:00
2013-12-09 08:37:48 -05:00
See [Middle Manager](Middlemanager.html).
2013-09-13 18:20:39 -04:00
2013-10-08 19:34:58 -04:00
Peons
-----
2013-09-13 18:20:39 -04:00
2013-12-09 08:37:48 -05:00
See [Peon](Peons.html).
2013-09-13 18:20:39 -04:00
2013-10-08 19:34:58 -04:00
Tasks
-----
2013-09-13 18:20:39 -04:00
2013-10-08 19:34:58 -04:00
See [Tasks](Tasks.html).