blob: 47602542e8e99843a0c9be3e6354267a43430ac7 [file] [log] [blame]
<!doctype html>
<html lang="en" dir="ltr" class="docs-wrapper docs-doc-page docs-version-current plugin-docs plugin-id-default docs-doc-id-development/extensions-core/kafka-supervisor-reference">
<head>
<meta charset="UTF-8">
<meta name="generator" content="Docusaurus v2.4.1">
<title data-rh="true">Apache Kafka supervisor reference | Apache® Druid</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://druid.apache.org/img/druid_nav.png"><meta data-rh="true" name="twitter:image" content="https://druid.apache.org/img/druid_nav.png"><meta data-rh="true" property="og:url" content="https://druid.apache.org/docs/latest/development/extensions-core/kafka-supervisor-reference"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Apache Kafka supervisor reference | Apache® Druid"><meta data-rh="true" name="description" content="Reference topic for Apache Kafka supervisors"><meta data-rh="true" property="og:description" content="Reference topic for Apache Kafka supervisors"><link data-rh="true" rel="icon" href="/img/favicon.png"><link data-rh="true" rel="canonical" href="https://druid.apache.org/docs/latest/development/extensions-core/kafka-supervisor-reference"><link data-rh="true" rel="alternate" href="https://druid.apache.org/docs/latest/development/extensions-core/kafka-supervisor-reference" hreflang="en"><link data-rh="true" rel="alternate" href="https://druid.apache.org/docs/latest/development/extensions-core/kafka-supervisor-reference" hreflang="x-default"><link rel="preconnect" href="https://www.google-analytics.com">
<link rel="preconnect" href="https://www.googletagmanager.com">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-131010415-1"></script>
<script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","UA-131010415-1",{})</script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js"></script><link rel="stylesheet" href="/assets/css/styles.546f39eb.css">
<link rel="preload" href="/assets/js/runtime~main.26d714fb.js" as="script">
<link rel="preload" href="/assets/js/main.bd54ee66.js" as="script">
</head>
<body class="navigation-with-keyboard">
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
<div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top navbar--dark"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/img/druid_nav.png" alt="Apache® Druid" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/druid_nav.png" alt="Apache® Druid" class="themedImage_ToTc themedImage--dark_i4oU"></div></a></div><div class="navbar__items navbar__items--right"><a class="navbar__item navbar__link" href="/technology">Technology</a><a class="navbar__item navbar__link" href="/use-cases">Use Cases</a><a class="navbar__item navbar__link" href="/druid-powered">Powered By</a><a class="navbar__item navbar__link" href="/docs/latest/design/">Docs</a><a class="navbar__item navbar__link" href="/community/">Community</a><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a href="#" aria-haspopup="true" aria-expanded="false" role="button" class="navbar__link">Apache®</a><ul class="dropdown__menu"><li><a href="https://www.apache.org/" target="_blank" rel="noopener noreferrer" class="dropdown__link">Foundation<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://apachecon.com/?ref=druid.apache.org" target="_blank" rel="noopener noreferrer" class="dropdown__link">Events<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://www.apache.org/licenses/" target="_blank" rel="noopener noreferrer" class="dropdown__link">License<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://www.apache.org/foundation/thanks.html" target="_blank" rel="noopener noreferrer" class="dropdown__link">Thanks<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://www.apache.org/security/" target="_blank" rel="noopener noreferrer" class="dropdown__link">Security<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://www.apache.org/foundation/sponsorship.html" target="_blank" rel="noopener noreferrer" class="dropdown__link">Sponsorship<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div><a class="navbar__item navbar__link" href="/downloads/">Download</a><div class="searchBox_ZlJk"><div class="navbar__search"><span aria-label="expand searchbar" role="button" class="search-icon" tabindex="0"></span><input type="search" id="search_input_react" placeholder="Loading..." aria-label="Search" class="navbar__search-input search-bar" disabled=""></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/docs/latest/design/">Getting started</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/docs/latest/tutorials/tutorial-msq-extern">Tutorials</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/docs/latest/design/architecture">Design</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" aria-expanded="true" href="/docs/latest/ingestion/">Ingestion</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/latest/ingestion/">Overview</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" tabindex="0" href="/docs/latest/ingestion/data-formats">Ingestion concepts</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" tabindex="0" href="/docs/latest/multi-stage-query/">SQL-based batch</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" aria-expanded="true" tabindex="0" href="/docs/latest/development/extensions-core/kafka-ingestion">Streaming</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/latest/development/extensions-core/kafka-ingestion">Apache Kafka ingestion</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/latest/development/extensions-core/kafka-supervisor-reference">Apache Kafka supervisor</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/latest/development/extensions-core/kafka-supervisor-operations">Apache Kafka operations</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/latest/development/extensions-core/kinesis-ingestion">Amazon Kinesis</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" tabindex="0" href="/docs/latest/ingestion/native-batch">Classic batch</a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/latest/ingestion/ingestion-spec">Ingestion spec reference</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/latest/ingestion/schema-design">Schema design tips</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/latest/ingestion/faq">Troubleshooting FAQ</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/docs/latest/data-management/">Data management</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/docs/latest/querying/sql">Querying</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/docs/latest/api-reference/">API reference</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/docs/latest/configuration/">Configuration</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/docs/latest/operations/web-console">Operations</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/docs/latest/development/overview">Development</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/docs/latest/misc/papers-and-talks">Misc</a></div></li></ul></nav></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">Ingestion</span><meta itemprop="position" content="1"></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">Streaming</span><meta itemprop="position" content="2"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Apache Kafka supervisor</span><meta itemprop="position" content="3"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>Apache Kafka supervisor reference</h1></header><p>This topic contains configuration reference information for the Apache Kafka supervisor for Apache Druid. The following table outlines the high-level configuration options:</p><table><thead><tr><th>Field</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><code>type</code></td><td>Supervisor type. For Kafka streaming, set to <code>kafka</code>.</td><td>yes</td></tr><tr><td><code>spec</code></td><td>Container object for the supervisor configuration.</td><td>yes</td></tr><tr><td><code>dataSchema</code></td><td>Schema for the Kafka indexing task to use during ingestion.</td><td>yes</td></tr><tr><td><code>ioConfig</code></td><td>A <code>KafkaSupervisorIOConfig</code> object to define the Kafka connection and I/O-related settings for the supervisor and indexing task. See <a href="#kafkasupervisorioconfig">KafkaSupervisorIOConfig</a>.</td><td>yes</td></tr><tr><td><code>tuningConfig</code></td><td>A KafkaSupervisorTuningConfig object to define performance-related settings for the supervisor and indexing tasks. See <a href="#kafkasupervisortuningconfig">KafkaSupervisorTuningConfig</a>.</td><td>no</td></tr></tbody></table><h2 class="anchor anchorWithStickyNavbar_LWe7" id="kafkasupervisorioconfig">KafkaSupervisorIOConfig<a href="#kafkasupervisorioconfig" class="hash-link" aria-label="Direct link to KafkaSupervisorIOConfig" title="Direct link to KafkaSupervisorIOConfig"></a></h2><table><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><code>topic</code></td><td>String</td><td>The Kafka topic to read from. Must be a specific topic. Topic patterns are not supported.</td><td>yes</td></tr><tr><td><code>inputFormat</code></td><td>Object</td><td><code>inputFormat</code> to define input data parsing. See <a href="#specifying-data-format">Specifying data format</a> for details about specifying the input format.</td><td>yes</td></tr><tr><td><code>consumerProperties</code></td><td>Map&lt;String, Object&gt;</td><td>A map of properties to pass to the Kafka consumer. See <a href="#more-on-consumerproperties">More on consumer properties</a>.</td><td>yes</td></tr><tr><td><code>pollTimeout</code></td><td>Long</td><td>The length of time to wait for the Kafka consumer to poll records, in milliseconds</td><td>no (default == 100)</td></tr><tr><td><code>replicas</code></td><td>Integer</td><td>The number of replica sets. &quot;1&quot; means a single set of tasks without replication. Druid always assigns replica tasks to different workers to provide resiliency against worker failure.</td><td>no (default == 1)</td></tr><tr><td><code>taskCount</code></td><td>Integer</td><td>The maximum number of <em>reading</em> tasks in a <em>replica set</em>. The maximum number of reading tasks equals <code>taskCount * replicas</code>. Therefore, the total number of tasks, <em>reading</em> + <em>publishing</em>, is greater than this count. See <a href="/docs/latest/development/extensions-core/kafka-supervisor-operations#capacity-planning">Capacity Planning</a> for more details. When <code>taskCount &gt; {numKafkaPartitions}</code>, the actual number of reading tasks is less than the <code>taskCount</code> value.</td><td>no (default == 1)</td></tr><tr><td><code>taskDuration</code></td><td>ISO8601 Period</td><td>The length of time before tasks stop reading and begin publishing segments.</td><td>no (default == PT1H)</td></tr><tr><td><code>startDelay</code></td><td>ISO8601 Period</td><td>The period to wait before the supervisor starts managing tasks.</td><td>no (default == PT5S)</td></tr><tr><td><code>period</code></td><td>ISO8601 Period</td><td>Frequency at which the supervisor executes its management logic. The supervisor also runs in response to certain events. For example, task success, task failure, and tasks reaching their <code>taskDuration</code>. The <code>period</code> value specifies the maximum time between iterations.</td><td>no (default == PT30S)</td></tr><tr><td><code>useEarliestOffset</code></td><td>Boolean</td><td>If a supervisor manages a <code>dataSource</code> for the first time, it obtains a set of starting offsets from Kafka. This flag determines whether it retrieves the earliest or latest offsets in Kafka. Under normal circumstances, subsequent tasks will start from where the previous segments ended. Therefore Druid only uses <code>useEarliestOffset</code> on first run.</td><td>no (default == false)</td></tr><tr><td><code>completionTimeout</code></td><td>ISO8601 Period</td><td>The length of time to wait before declaring a publishing task as failed and terminating it. If the value is too low, your tasks may never publish. The publishing clock for a task begins roughly after <code>taskDuration</code> elapses.</td><td>no (default == PT30M)</td></tr><tr><td><code>lateMessageRejectionStartDateTime</code></td><td>ISO8601 DateTime</td><td>Configure tasks to reject messages with timestamps earlier than this date time; for example if this is set to <code>2016-01-01T11:00Z</code> and the supervisor creates a task at <em>2016-01-01T12:00Z</em>, Druid drops messages with timestamps earlier than <em>2016-01-01T11:00Z</em>. This can prevent concurrency issues if your data stream has late messages and you have multiple pipelines that need to operate on the same segments (e.g. a realtime and a nightly batch ingestion pipeline).</td><td>no (default == none)</td></tr><tr><td><code>lateMessageRejectionPeriod</code></td><td>ISO8601 Period</td><td>Configure tasks to reject messages with timestamps earlier than this period before the task was created; for example if this is set to <code>PT1H</code> and the supervisor creates a task at <em>2016-01-01T12:00Z</em>, messages with timestamps earlier than <em>2016-01-01T11:00Z</em> will be dropped. This may help prevent concurrency issues if your data stream has late messages and you have multiple pipelines that need to operate on the same segments (e.g. a realtime and a nightly batch ingestion pipeline). Please note that only one of <code>lateMessageRejectionPeriod</code> or <code>lateMessageRejectionStartDateTime</code> can be specified.</td><td>no (default == none)</td></tr><tr><td><code>earlyMessageRejectionPeriod</code></td><td>ISO8601 Period</td><td>Configure tasks to reject messages with timestamps later than this period after the task reached its taskDuration; for example if this is set to <code>PT1H</code>, the taskDuration is set to <code>PT1H</code> and the supervisor creates a task at <em>2016-01-01T12:00Z</em>, messages with timestamps later than <em>2016-01-01T14:00Z</em> will be dropped. <strong>Note:</strong> Tasks sometimes run past their task duration, for example, in cases of supervisor failover. Setting earlyMessageRejectionPeriod too low may cause messages to be dropped unexpectedly whenever a task runs past its originally configured task duration.</td><td>no (default == none)</td></tr><tr><td><code>autoScalerConfig</code></td><td>Object</td><td>Defines auto scaling behavior for Kafka ingest tasks. See <a href="#task-autoscaler-properties">Tasks Autoscaler Properties</a>.</td><td>no (default == null)</td></tr><tr><td><code>idleConfig</code></td><td>Object</td><td>Defines how and when Kafka Supervisor can become idle. See <a href="#idle-supervisor-configuration">Idle Supervisor Configuration</a> for more details.</td><td>no (default == null)</td></tr></tbody></table><h2 class="anchor anchorWithStickyNavbar_LWe7" id="task-autoscaler-properties">Task Autoscaler Properties<a href="#task-autoscaler-properties" class="hash-link" aria-label="Direct link to Task Autoscaler Properties" title="Direct link to Task Autoscaler Properties"></a></h2><table><thead><tr><th>Property</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><code>enableTaskAutoScaler</code></td><td>Enable or disable autoscaling. <code>false</code> or blank disables the <code>autoScaler</code> even when <code>autoScalerConfig</code> is not null</td><td>no (default == false)</td></tr><tr><td><code>taskCountMax</code></td><td>Maximum number of ingestion tasks. Set <code>taskCountMax &gt;= taskCountMin</code>. If <code>taskCountMax &gt; {numKafkaPartitions}</code>, Druid only scales reading tasks up to the <code>{numKafkaPartitions}</code>. In this case <code>taskCountMax</code> is ignored.</td><td>yes</td></tr><tr><td><code>taskCountMin</code></td><td>Minimum number of ingestion tasks. When you enable autoscaler, Druid ignores the value of taskCount in <code>IOConfig</code> and starts with the <code>taskCountMin</code> number of tasks.</td><td>yes</td></tr><tr><td><code>minTriggerScaleActionFrequencyMillis</code></td><td>Minimum time interval between two scale actions.</td><td>no (default == 600000)</td></tr><tr><td><code>autoScalerStrategy</code></td><td>The algorithm of <code>autoScaler</code>. Only supports <code>lagBased</code>. See <a href="#lag-based-autoscaler-strategy-related-properties">Lag Based AutoScaler Strategy Related Properties</a> for details.</td><td>no (default == <code>lagBased</code>)</td></tr></tbody></table><h2 class="anchor anchorWithStickyNavbar_LWe7" id="lag-based-autoscaler-strategy-related-properties">Lag Based AutoScaler Strategy Related Properties<a href="#lag-based-autoscaler-strategy-related-properties" class="hash-link" aria-label="Direct link to Lag Based AutoScaler Strategy Related Properties" title="Direct link to Lag Based AutoScaler Strategy Related Properties"></a></h2><table><thead><tr><th>Property</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><code>lagCollectionIntervalMillis</code></td><td>Period of lag points collection.</td><td>no (default == 30000)</td></tr><tr><td><code>lagCollectionRangeMillis</code></td><td>The total time window of lag collection. Use with <code>lagCollectionIntervalMillis</code>,it means that in the recent <code>lagCollectionRangeMillis</code>, collect lag metric points every <code>lagCollectionIntervalMillis</code>.</td><td>no (default == 600000)</td></tr><tr><td><code>scaleOutThreshold</code></td><td>The threshold of scale out action</td><td>no (default == 6000000)</td></tr><tr><td><code>triggerScaleOutFractionThreshold</code></td><td>If <code>triggerScaleOutFractionThreshold</code> percent of lag points are higher than <code>scaleOutThreshold</code>, then do scale out action.</td><td>no (default == 0.3)</td></tr><tr><td><code>scaleInThreshold</code></td><td>The Threshold of scale in action</td><td>no (default == 1000000)</td></tr><tr><td><code>triggerScaleInFractionThreshold</code></td><td>If <code>triggerScaleInFractionThreshold</code> percent of lag points are lower than <code>scaleOutThreshold</code>, then do scale in action.</td><td>no (default == 0.9)</td></tr><tr><td><code>scaleActionStartDelayMillis</code></td><td>Number of milliseconds after supervisor starts when first check scale logic.</td><td>no (default == 300000)</td></tr><tr><td><code>scaleActionPeriodMillis</code></td><td>The frequency of checking whether to do scale action in millis</td><td>no (default == 60000)</td></tr><tr><td><code>scaleInStep</code></td><td>How many tasks to reduce at a time</td><td>no (default == 1)</td></tr><tr><td><code>scaleOutStep</code></td><td>How many tasks to add at a time</td><td>no (default == 2)</td></tr></tbody></table><h2 class="anchor anchorWithStickyNavbar_LWe7" id="idle-supervisor-configuration">Idle Supervisor Configuration<a href="#idle-supervisor-configuration" class="hash-link" aria-label="Direct link to Idle Supervisor Configuration" title="Direct link to Idle Supervisor Configuration"></a></h2><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p> Note that Idle state transitioning is currently designated as experimental.</p></div></div><table><thead><tr><th>Property</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><code>enabled</code></td><td>If <code>true</code>, Kafka supervisor will become idle if there is no data on input stream/topic for some time.</td><td>no (default == false)</td></tr><tr><td><code>inactiveAfterMillis</code></td><td>Supervisor is marked as idle if all existing data has been read from input topic and no new data has been published for <code>inactiveAfterMillis</code> milliseconds.</td><td>no (default == <code>600_000</code>)</td></tr></tbody></table><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p> When the supervisor enters the idle state, no new tasks will be launched subsequent to the completion of the currently executing tasks. This strategy may lead to reduced costs for cluster operators while using topics that get sporadic data.</p></div></div><p>The following example demonstrates supervisor spec with <code>lagBased</code> autoScaler and idle config enabled:</p><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;type&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&quot;kafka&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;spec&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;dataSchema&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> ...</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;ioConfig&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;topic&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&quot;metrics&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;inputFormat&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;type&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&quot;json&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;consumerProperties&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;bootstrap.servers&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&quot;localhost:9092&quot;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;autoScalerConfig&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;enableTaskAutoScaler&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token boolean" style="color:rgb(255, 88, 116)">true</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;taskCountMax&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">6</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;taskCountMin&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">2</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;minTriggerScaleActionFrequencyMillis&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">600000</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;autoScalerStrategy&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(195, 232, 141)">&quot;lagBased&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;lagCollectionIntervalMillis&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">30000</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;lagCollectionRangeMillis&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">600000</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;scaleOutThreshold&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">6000000</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;triggerScaleOutFractionThreshold&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0.3</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;scaleInThreshold&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1000000</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;triggerScaleInFractionThreshold&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">0.9</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;scaleActionStartDelayMillis&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">300000</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;scaleActionPeriodMillis&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">60000</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;scaleInStep&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;scaleOutStep&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">2</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;taskCount&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;replicas&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;taskDuration&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token string" style="color:rgb(195, 232, 141)">&quot;PT1H&quot;</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;idleConfig&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;enabled&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token boolean" style="color:rgb(255, 88, 116)">true</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;inactiveAfterMillis&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">600000</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">&quot;tuningConfig&quot;</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> ...</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="more-on-consumerproperties">More on consumerProperties<a href="#more-on-consumerproperties" class="hash-link" aria-label="Direct link to More on consumerProperties" title="Direct link to More on consumerProperties"></a></h2><p>Consumer properties must contain a property <code>bootstrap.servers</code> with a list of Kafka brokers in the form: <code>&lt;BROKER_1&gt;:&lt;PORT_1&gt;,&lt;BROKER_2&gt;:&lt;PORT_2&gt;,...</code>.
By default, <code>isolation.level</code> is set to <code>read_committed</code>. If you use older versions of Kafka servers without transactions support or don&#x27;t want Druid to consume only committed transactions, set <code>isolation.level</code> to <code>read_uncommitted</code>.</p><p>In some cases, you may need to fetch consumer properties at runtime. For example, when <code>bootstrap.servers</code> is not known upfront, or is not static. To enable SSL connections, you must provide passwords for <code>keystore</code>, <code>truststore</code> and <code>key</code> secretly. You can provide configurations at runtime with a dynamic config provider implementation like the environment variable config provider that comes with Druid. For more information, see <a href="/docs/latest/operations/dynamic-config-provider">DynamicConfigProvider</a>.</p><p>For example, if you are using SASL and SSL with Kafka, set the following environment variables for the Druid user on the machines running the Overlord and the Peon services:</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">export KAFKA_JAAS_CONFIG=&quot;org.apache.kafka.common.security.plain.PlainLoginModule required username=&#x27;admin_user&#x27; password=&#x27;admin_password&#x27;;&quot;</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">export SSL_KEY_PASSWORD=mysecretkeypassword</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">export SSL_KEYSTORE_PASSWORD=mysecretkeystorepassword</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">export SSL_TRUSTSTORE_PASSWORD=mysecrettruststorepassword</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain"> &quot;druid.dynamic.config.provider&quot;: {</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> &quot;type&quot;: &quot;environment&quot;,</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> &quot;variables&quot;: {</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> &quot;sasl.jaas.config&quot;: &quot;KAFKA_JAAS_CONFIG&quot;,</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> &quot;ssl.key.password&quot;: &quot;SSL_KEY_PASSWORD&quot;,</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> &quot;ssl.keystore.password&quot;: &quot;SSL_KEYSTORE_PASSWORD&quot;,</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> &quot;ssl.truststore.password&quot;: &quot;SSL_TRUSTSTORE_PASSWORD&quot;</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> }</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> }</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Verify that you&#x27;ve changed the values for all configurations to match your own environment. You can use the environment variable config provider syntax in the <strong>Consumer properties</strong> field on the <strong>Connect tab</strong> in the <strong>Load Data</strong> UI in the web console. When connecting to Kafka, Druid replaces the environment variables with their corresponding values.</p><p>Note: You can provide SSL connections with <a href="/docs/latest/operations/password-provider">Password Provider</a> interface to define the <code>keystore</code>, <code>truststore</code>, and <code>key</code>, but this feature is deprecated.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="specifying-data-format">Specifying data format<a href="#specifying-data-format" class="hash-link" aria-label="Direct link to Specifying data format" title="Direct link to Specifying data format"></a></h2><p>Kafka indexing service supports both <a href="/docs/latest/ingestion/data-formats#input-format"><code>inputFormat</code></a> and <a href="/docs/latest/ingestion/data-formats#parser"><code>parser</code></a> to specify the data format.
Use the <code>inputFormat</code> to specify the data format for Kafka indexing service unless you need a format only supported by the legacy <code>parser</code>.</p><p>Supported <code>inputFormat</code>s include:</p><ul><li><code>csv</code></li><li><code>tsv</code></li><li><code>json</code></li><li><code>kafka</code></li><li><code>avro_stream</code></li><li><code>avro_ocf</code></li><li><code>protobuf</code></li></ul><p>For more information, see <a href="/docs/latest/ingestion/data-formats">Data formats</a>. You can also read <a href="/docs/latest/development/extensions-contrib/thrift"><code>thrift</code></a> formats using <code>parser</code>.</p><a name="tuningconfig"></a><h2 class="anchor anchorWithStickyNavbar_LWe7" id="kafkasupervisortuningconfig">KafkaSupervisorTuningConfig<a href="#kafkasupervisortuningconfig" class="hash-link" aria-label="Direct link to KafkaSupervisorTuningConfig" title="Direct link to KafkaSupervisorTuningConfig"></a></h2><p>The <code>tuningConfig</code> is optional and default parameters will be used if no <code>tuningConfig</code> is specified.</p><table><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><code>type</code></td><td>String</td><td>The indexing task type, this should always be <code>kafka</code>.</td><td>yes</td></tr><tr><td><code>maxRowsInMemory</code></td><td>Integer</td><td>The number of rows to aggregate before persisting. This number is the post-aggregation rows, so it is not equivalent to the number of input events, but the number of aggregated rows that those events result in. This is used to manage the required JVM heap size. Maximum heap memory usage for indexing scales with <code>maxRowsInMemory</code> * (2 + <code>maxPendingPersists</code>). Normally user does not need to set this, but depending on the nature of data, if rows are short in terms of bytes, user may not want to store a million rows in memory and this value should be set.</td><td>no (default == 1000000)</td></tr><tr><td><code>maxBytesInMemory</code></td><td>Long</td><td>The number of bytes to aggregate in heap memory before persisting. This is based on a rough estimate of memory usage and not actual usage. Normally this is computed internally and user does not need to set it. The maximum heap memory usage for indexing is <code>maxBytesInMemory</code> * (2 + <code>maxPendingPersists</code>).</td><td>no (default == One-sixth of max JVM memory)</td></tr><tr><td><code>maxRowsPerSegment</code></td><td>Integer</td><td>The number of rows to aggregate into a segment; this number is post-aggregation rows. Handoff will happen either if <code>maxRowsPerSegment</code> or <code>maxTotalRows</code> is hit or every <code>intermediateHandoffPeriod</code>, whichever happens earlier.</td><td>no (default == 5000000)</td></tr><tr><td><code>maxTotalRows</code></td><td>Long</td><td>The number of rows to aggregate across all segments; this number is post-aggregation rows. Handoff will happen either if <code>maxRowsPerSegment</code> or <code>maxTotalRows</code> is hit or every <code>intermediateHandoffPeriod</code>, whichever happens earlier.</td><td>no (default == 20000000)</td></tr><tr><td><code>intermediatePersistPeriod</code></td><td>ISO8601 Period</td><td>The period that determines the rate at which intermediate persists occur.</td><td>no (default == PT10M)</td></tr><tr><td><code>maxPendingPersists</code></td><td>Integer</td><td>Maximum number of persists that can be pending but not started. If this limit would be exceeded by a new intermediate persist, ingestion will block until the currently-running persist finishes. Maximum heap memory usage for indexing scales with <code>maxRowsInMemory</code> * (2 + <code>maxPendingPersists</code>).</td><td>no (default == 0, meaning one persist can be running concurrently with ingestion, and none can be queued up)</td></tr><tr><td><code>indexSpec</code></td><td>Object</td><td>Tune how data is indexed. See <a href="#indexspec">IndexSpec</a> for more information.</td><td>no</td></tr><tr><td><code>indexSpecForIntermediatePersists</code></td><td></td><td>Defines segment storage format options to be used at indexing time for intermediate persisted temporary segments. This can be used to disable dimension/metric compression on intermediate segments to reduce memory required for final merging. However, disabling compression on intermediate segments might increase page cache use while they are used before getting merged into final segment published, see <a href="#indexspec">IndexSpec</a> for possible values.</td><td>no (default = same as <code>indexSpec</code>)</td></tr><tr><td><code>reportParseExceptions</code></td><td>Boolean</td><td><em>DEPRECATED</em>. If true, exceptions encountered during parsing will be thrown and will halt ingestion; if false, unparseable rows and fields will be skipped. Setting <code>reportParseExceptions</code> to true will override existing configurations for <code>maxParseExceptions</code> and <code>maxSavedParseExceptions</code>, setting <code>maxParseExceptions</code> to 0 and limiting <code>maxSavedParseExceptions</code> to no more than 1.</td><td>no (default == false)</td></tr><tr><td><code>handoffConditionTimeout</code></td><td>Long</td><td>Milliseconds to wait for segment handoff. It must be &gt;= 0, where 0 means to wait forever.</td><td>no (default == 0)</td></tr><tr><td><code>resetOffsetAutomatically</code></td><td>Boolean</td><td>Controls behavior when Druid needs to read Kafka messages that are no longer available (i.e. when <code>OffsetOutOfRangeException</code> is encountered).<br><br>If false, the exception will bubble up, which will cause your tasks to fail and ingestion to halt. If this occurs, manual intervention is required to correct the situation; potentially using the <a href="/docs/latest/api-reference/supervisor-api">Reset Supervisor API</a>. This mode is useful for production, since it will make you aware of issues with ingestion.<br><br>If true, Druid will automatically reset to the earlier or latest offset available in Kafka, based on the value of the <code>useEarliestOffset</code> property (earliest if true, latest if false). Note that this can lead to data being <em>DROPPED</em> (if <code>useEarliestOffset</code> is false) or <em>DUPLICATED</em> (if <code>useEarliestOffset</code> is true) without your knowledge. Messages will be logged indicating that a reset has occurred, but ingestion will continue. This mode is useful for non-production situations, since it will make Druid attempt to recover from problems automatically, even if they lead to quiet dropping or duplicating of data.<br><br>This feature behaves similarly to the Kafka <code>auto.offset.reset</code> consumer property.</td><td>no (default == false)</td></tr><tr><td><code>workerThreads</code></td><td>Integer</td><td>The number of threads that the supervisor uses to handle requests/responses for worker tasks, along with any other internal asynchronous operation.</td><td>no (default == min(10, taskCount))</td></tr><tr><td><code>chatAsync</code></td><td>Boolean</td><td>If true, use asynchronous communication with indexing tasks, and ignore the <code>chatThreads</code> parameter. If false, use synchronous communication in a thread pool of size <code>chatThreads</code>.</td><td>no (default == true)</td></tr><tr><td><code>chatThreads</code></td><td>Integer</td><td>The number of threads that will be used for communicating with indexing tasks. Ignored if <code>chatAsync</code> is <code>true</code> (the default).</td><td>no (default == min(10, taskCount * replicas))</td></tr><tr><td><code>chatRetries</code></td><td>Integer</td><td>The number of times HTTP requests to indexing tasks will be retried before considering tasks unresponsive.</td><td>no (default == 8)</td></tr><tr><td><code>httpTimeout</code></td><td>ISO8601 Period</td><td>How long to wait for a HTTP response from an indexing task.</td><td>no (default == PT10S)</td></tr><tr><td><code>shutdownTimeout</code></td><td>ISO8601 Period</td><td>How long to wait for the supervisor to attempt a graceful shutdown of tasks before exiting.</td><td>no (default == PT80S)</td></tr><tr><td><code>offsetFetchPeriod</code></td><td>ISO8601 Period</td><td>How often the supervisor queries Kafka and the indexing tasks to fetch current offsets and calculate lag. If the user-specified value is below the minimum value (<code>PT5S</code>), the supervisor ignores the value and uses the minimum value instead.</td><td>no (default == PT30S, min == PT5S)</td></tr><tr><td><code>segmentWriteOutMediumFactory</code></td><td>Object</td><td>Segment write-out medium to use when creating segments. See below for more information.</td><td>no (not specified by default, the value from <code>druid.peon.defaultSegmentWriteOutMediumFactory.type</code> is used)</td></tr><tr><td><code>intermediateHandoffPeriod</code></td><td>ISO8601 Period</td><td>How often the tasks should hand off segments. Handoff will happen either if <code>maxRowsPerSegment</code> or <code>maxTotalRows</code> is hit or every <code>intermediateHandoffPeriod</code>, whichever happens earlier.</td><td>no (default == P2147483647D)</td></tr><tr><td><code>logParseExceptions</code></td><td>Boolean</td><td>If true, log an error message when a parsing exception occurs, containing information about the row where the error occurred.</td><td>no, default == false</td></tr><tr><td><code>maxParseExceptions</code></td><td>Integer</td><td>The maximum number of parse exceptions that can occur before the task halts ingestion and fails. Overridden if <code>reportParseExceptions</code> is set.</td><td>no, unlimited default</td></tr><tr><td><code>maxSavedParseExceptions</code></td><td>Integer</td><td>When a parse exception occurs, Druid can keep track of the most recent parse exceptions. <code>maxSavedParseExceptions</code> limits how many exception instances will be saved. These saved exceptions will be made available after the task finishes in the <a href="/docs/latest/ingestion/tasks#task-reports">task completion report</a>. Overridden if <code>reportParseExceptions</code> is set.</td><td>no, default == 0</td></tr></tbody></table><h4 class="anchor anchorWithStickyNavbar_LWe7" id="indexspec">IndexSpec<a href="#indexspec" class="hash-link" aria-label="Direct link to IndexSpec" title="Direct link to IndexSpec"></a></h4><table><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td>bitmap</td><td>Object</td><td>Compression format for bitmap indexes. Should be a JSON object. See <a href="#bitmap-types">Bitmap types</a> below for options.</td><td>no (defaults to Roaring)</td></tr><tr><td>dimensionCompression</td><td>String</td><td>Compression format for dimension columns. Choose from <code>LZ4</code>, <code>LZF</code>, <code>ZSTD</code> or <code>uncompressed</code>.</td><td>no (default == <code>LZ4</code>)</td></tr><tr><td>metricCompression</td><td>String</td><td>Compression format for primitive type metric columns. Choose from <code>LZ4</code>, <code>LZF</code>, <code>ZSTD</code>, <code>uncompressed</code> or <code>none</code>.</td><td>no (default == <code>LZ4</code>)</td></tr><tr><td>longEncoding</td><td>String</td><td>Encoding format for metric and dimension columns with type long. Choose from <code>auto</code> or <code>longs</code>. <code>auto</code> encodes the values using offset or lookup table depending on column cardinality, and store them with variable size. <code>longs</code> stores the value as is with 8 bytes each.</td><td>no (default == <code>longs</code>)</td></tr></tbody></table><h5 class="anchor anchorWithStickyNavbar_LWe7" id="bitmap-types">Bitmap types<a href="#bitmap-types" class="hash-link" aria-label="Direct link to Bitmap types" title="Direct link to Bitmap types"></a></h5><p>For Roaring bitmaps:</p><table><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><code>type</code></td><td>String</td><td>Must be <code>roaring</code>.</td><td>yes</td></tr></tbody></table><p>For Concise bitmaps:</p><table><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><code>type</code></td><td>String</td><td>Must be <code>concise</code>.</td><td>yes</td></tr></tbody></table><h4 class="anchor anchorWithStickyNavbar_LWe7" id="segmentwriteoutmediumfactory">SegmentWriteOutMediumFactory<a href="#segmentwriteoutmediumfactory" class="hash-link" aria-label="Direct link to SegmentWriteOutMediumFactory" title="Direct link to SegmentWriteOutMediumFactory"></a></h4><table><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><code>type</code></td><td>String</td><td>See <a href="/docs/latest/configuration/#segmentwriteoutmediumfactory">Additional Peon Configuration: SegmentWriteOutMediumFactory</a> for explanation and available options.</td><td>yes</td></tr></tbody></table></div></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/latest/development/extensions-core/kafka-ingestion"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Apache Kafka ingestion</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/latest/development/extensions-core/kafka-supervisor-operations"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Apache Kafka operations</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#kafkasupervisorioconfig" class="table-of-contents__link toc-highlight">KafkaSupervisorIOConfig</a></li><li><a href="#task-autoscaler-properties" class="table-of-contents__link toc-highlight">Task Autoscaler Properties</a></li><li><a href="#lag-based-autoscaler-strategy-related-properties" class="table-of-contents__link toc-highlight">Lag Based AutoScaler Strategy Related Properties</a></li><li><a href="#idle-supervisor-configuration" class="table-of-contents__link toc-highlight">Idle Supervisor Configuration</a></li><li><a href="#more-on-consumerproperties" class="table-of-contents__link toc-highlight">More on consumerProperties</a></li><li><a href="#specifying-data-format" class="table-of-contents__link toc-highlight">Specifying data format</a></li><li><a href="#kafkasupervisortuningconfig" class="table-of-contents__link toc-highlight">KafkaSupervisorTuningConfig</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__bottom text--center"><div class="margin-bottom--sm"><img src="/img/favicon.png" class="themedImage_ToTc themedImage--light_HNdA footer__logo"><img src="/img/favicon.png" class="themedImage_ToTc themedImage--dark_i4oU footer__logo"></div><div class="footer__copyright">Copyright © 2023 Apache Software Foundation. Except where otherwise noted, licensed under CC BY-SA 4.0. Apache Druid, Druid, and the Druid logo are either registered trademarks or trademarks of The Apache Software Foundation in the United States and other countries.</div></div></div></footer></div>
<script src="/assets/js/runtime~main.26d714fb.js"></script>
<script src="/assets/js/main.bd54ee66.js"></script>
</body>
</html>