blob: a2722f995f42160c0517f2afa5a015e4d8c00d5d [file] [log] [blame]
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[2642],{15680:(e,t,n)=>{n.d(t,{xA:()=>d,yg:()=>y});var a=n(96540);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var o=a.createContext({}),g=function(e){var t=a.useContext(o),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},d=function(e){var t=g(e.components);return a.createElement(o.Provider,{value:t},e.children)},p="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},u=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,o=e.parentName,d=s(e,["components","mdxType","originalType","parentName"]),p=g(n),u=r,y=p["".concat(o,".").concat(u)]||p[u]||m[u]||i;return n?a.createElement(y,l(l({ref:t},d),{},{components:n})):a.createElement(y,l({ref:t},d))}));function y(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,l=new Array(i);l[0]=u;var s={};for(var o in t)hasOwnProperty.call(t,o)&&(s[o]=t[o]);s.originalType=e,s[p]="string"==typeof e?e:r,l[1]=s;for(var g=2;g<i;g++)l[g]=n[g];return a.createElement.apply(null,l)}return a.createElement.apply(null,n)}u.displayName="MDXCreateElement"},32859:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>o,default:()=>y,frontMatter:()=>s,metadata:()=>g,toc:()=>p});var a=n(58168),r=n(98587),i=(n(96540),n(15680)),l=["components"],s={id:"supervisor",title:"Supervisor",sidebar_label:"Supervisor"},o=void 0,g={unversionedId:"ingestion/supervisor",id:"ingestion/supervisor",title:"Supervisor",description:"\x3c!--",source:"@site/docs/latest/ingestion/supervisor.md",sourceDirName:"ingestion",slug:"/ingestion/supervisor",permalink:"/docs/latest/ingestion/supervisor",draft:!1,tags:[],version:"current",frontMatter:{id:"supervisor",title:"Supervisor",sidebar_label:"Supervisor"},sidebar:"docs",previous:{title:"Streaming ingestion",permalink:"/docs/latest/ingestion/streaming"},next:{title:"Apache Kafka ingestion",permalink:"/docs/latest/ingestion/kafka-ingestion"}},d={},p=[{value:"Supervisor spec",id:"supervisor-spec",level:2},{value:"I/O configuration",id:"io-configuration",level:3},{value:"Task autoscaler",id:"task-autoscaler",level:4},{value:"Autoscaler strategy",id:"autoscaler-strategy",level:5},{value:"Tuning configuration",id:"tuning-configuration",level:3},{value:"Start a supervisor",id:"start-a-supervisor",level:2},{value:"Schema and configuration changes",id:"schema-and-configuration-changes",level:3},{value:"Status report",id:"status-report",level:2},{value:"SUPERVISORS system table",id:"supervisors-system-table",level:2},{value:"Capacity planning",id:"capacity-planning",level:2},{value:"Learn more",id:"learn-more",level:2}],m={toc:p},u="wrapper";function y(e){var t=e.components,s=(0,r.A)(e,l);return(0,i.yg)(u,(0,a.A)({},m,s,{components:t,mdxType:"MDXLayout"}),(0,i.yg)("p",null,"A supervisor manages streaming ingestion from external streaming sources into Apache Druid.\nSupervisors oversee the state of indexing tasks to coordinate handoffs, manage failures, and ensure that the scalability and replication requirements are maintained."),(0,i.yg)("h2",{id:"supervisor-spec"},"Supervisor spec"),(0,i.yg)("p",null,"Druid uses a JSON specification, often referred to as the supervisor spec, to define streaming ingestion tasks.\nThe supervisor spec specifies how Druid should consume, process, and index streaming data."),(0,i.yg)("p",null,"The following table outlines the high-level configuration options for a supervisor spec:"),(0,i.yg)("table",null,(0,i.yg)("thead",{parentName:"table"},(0,i.yg)("tr",{parentName:"thead"},(0,i.yg)("th",{parentName:"tr",align:null},"Property"),(0,i.yg)("th",{parentName:"tr",align:null},"Type"),(0,i.yg)("th",{parentName:"tr",align:null},"Description"),(0,i.yg)("th",{parentName:"tr",align:null},"Required"))),(0,i.yg)("tbody",{parentName:"table"},(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"type")),(0,i.yg)("td",{parentName:"tr",align:null},"String"),(0,i.yg)("td",{parentName:"tr",align:null},"The supervisor type. One of ",(0,i.yg)("inlineCode",{parentName:"td"},"kafka"),"or ",(0,i.yg)("inlineCode",{parentName:"td"},"kinesis"),"."),(0,i.yg)("td",{parentName:"tr",align:null},"Yes")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"spec")),(0,i.yg)("td",{parentName:"tr",align:null},"Object"),(0,i.yg)("td",{parentName:"tr",align:null},"The container object for the supervisor configuration."),(0,i.yg)("td",{parentName:"tr",align:null},"Yes")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"spec.dataSchema")),(0,i.yg)("td",{parentName:"tr",align:null},"Object"),(0,i.yg)("td",{parentName:"tr",align:null},"The schema for the indexing task to use during ingestion. See ",(0,i.yg)("a",{parentName:"td",href:"/docs/latest/ingestion/ingestion-spec#dataschema"},(0,i.yg)("inlineCode",{parentName:"a"},"dataSchema"))," for more information."),(0,i.yg)("td",{parentName:"tr",align:null},"Yes")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"spec.ioConfig")),(0,i.yg)("td",{parentName:"tr",align:null},"Object"),(0,i.yg)("td",{parentName:"tr",align:null},"The I/O configuration object to define the connection and I/O-related settings for the supervisor and indexing tasks."),(0,i.yg)("td",{parentName:"tr",align:null},"Yes")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"spec.tuningConfig")),(0,i.yg)("td",{parentName:"tr",align:null},"Object"),(0,i.yg)("td",{parentName:"tr",align:null},"The tuning configuration object to define performance-related settings for the supervisor and indexing tasks."),(0,i.yg)("td",{parentName:"tr",align:null},"No")))),(0,i.yg)("h3",{id:"io-configuration"},"I/O configuration"),(0,i.yg)("p",null,"The following table outlines the ",(0,i.yg)("inlineCode",{parentName:"p"},"ioConfig")," configuration properties that apply to both Apache Kafka and Amazon Kinesis ingestion methods.\nFor configuration properties specific to Apache Kafka and Amazon Kinesis, see ",(0,i.yg)("a",{parentName:"p",href:"/docs/latest/ingestion/kafka-ingestion#io-configuration"},"Kafka I/O configuration")," and ",(0,i.yg)("a",{parentName:"p",href:"/docs/latest/ingestion/kinesis-ingestion#io-configuration"},"Kinesis I/O configuration")," respectively."),(0,i.yg)("table",null,(0,i.yg)("thead",{parentName:"table"},(0,i.yg)("tr",{parentName:"thead"},(0,i.yg)("th",{parentName:"tr",align:null},"Property"),(0,i.yg)("th",{parentName:"tr",align:null},"Type"),(0,i.yg)("th",{parentName:"tr",align:null},"Description"),(0,i.yg)("th",{parentName:"tr",align:null},"Required"),(0,i.yg)("th",{parentName:"tr",align:null},"Default"))),(0,i.yg)("tbody",{parentName:"table"},(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"inputFormat")),(0,i.yg)("td",{parentName:"tr",align:null},"Object"),(0,i.yg)("td",{parentName:"tr",align:null},"The ",(0,i.yg)("a",{parentName:"td",href:"/docs/latest/ingestion/data-formats#input-format"},"input format")," to define input data parsing."),(0,i.yg)("td",{parentName:"tr",align:null},"Yes"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"autoScalerConfig")),(0,i.yg)("td",{parentName:"tr",align:null},"Object"),(0,i.yg)("td",{parentName:"tr",align:null},"Defines auto scaling behavior for ingestion tasks. See ",(0,i.yg)("a",{parentName:"td",href:"#task-autoscaler"},"Task autoscaler")," for more information."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"null")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"taskCount")),(0,i.yg)("td",{parentName:"tr",align:null},"Integer"),(0,i.yg)("td",{parentName:"tr",align:null},"The maximum number of reading tasks in a replica set. Multiply ",(0,i.yg)("inlineCode",{parentName:"td"},"taskCount")," and replicas to measure the maximum number of reading tasks. The total number of tasks, reading and publishing, is higher than the maximum number of reading tasks. See ",(0,i.yg)("a",{parentName:"td",href:"/docs/latest/ingestion/supervisor#capacity-planning"},"Capacity planning")," for more details. When ",(0,i.yg)("inlineCode",{parentName:"td"},"taskCount")," is greater than the number of Kafka partitions or Kinesis shards, the actual number of reading tasks is less than the ",(0,i.yg)("inlineCode",{parentName:"td"},"taskCount")," value."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"1")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"replicas")),(0,i.yg)("td",{parentName:"tr",align:null},"Integer"),(0,i.yg)("td",{parentName:"tr",align:null},"The number of replica sets, where 1 is a single set of tasks (no replication). Druid always assigns replicate tasks to different workers to provide resiliency against process failure."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"1")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"taskDuration")),(0,i.yg)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.yg)("td",{parentName:"tr",align:null},"The length of time before tasks stop reading and begin publishing segments."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"PT1H"))),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"startDelay")),(0,i.yg)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.yg)("td",{parentName:"tr",align:null},"The period to wait before the supervisor starts managing tasks."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"PT5S"))),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"period")),(0,i.yg)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.yg)("td",{parentName:"tr",align:null},"Determines how often the supervisor executes its management logic. Note that the supervisor also runs in response to certain events, such as tasks succeeding, failing, and reaching their task duration. The ",(0,i.yg)("inlineCode",{parentName:"td"},"period")," value specifies the maximum time between iterations."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"PT30S"))),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"completionTimeout")),(0,i.yg)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.yg)("td",{parentName:"tr",align:null},"The length of time to wait before declaring a publishing task as failed and terminating it. If the value is too low, tasks may never publish. The publishing clock for a task begins roughly after ",(0,i.yg)("inlineCode",{parentName:"td"},"taskDuration")," elapses."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"PT30M"))),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"lateMessageRejectionStartDateTime")),(0,i.yg)("td",{parentName:"tr",align:null},"ISO 8601 date time"),(0,i.yg)("td",{parentName:"tr",align:null},"Configures tasks to reject messages with timestamps earlier than this date time. For example, if this property is set to ",(0,i.yg)("inlineCode",{parentName:"td"},"2016-01-01T11:00Z")," and the supervisor creates a task at ",(0,i.yg)("inlineCode",{parentName:"td"},"2016-01-01T12:00Z"),", Druid drops messages with timestamps earlier than ",(0,i.yg)("inlineCode",{parentName:"td"},"2016-01-01T11:00Z"),". 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, such as a realtime and a nightly batch ingestion pipeline."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"lateMessageRejectionPeriod")),(0,i.yg)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.yg)("td",{parentName:"tr",align:null},"Configures tasks to reject messages with timestamps earlier than this period before the task was created. For example, if this property is set to ",(0,i.yg)("inlineCode",{parentName:"td"},"PT1H")," and the supervisor creates a task at ",(0,i.yg)("inlineCode",{parentName:"td"},"2016-01-01T12:00Z"),", Druid drops messages with timestamps earlier than ",(0,i.yg)("inlineCode",{parentName:"td"},"2016-01-01T11:00Z"),". 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, such as a streaming and a nightly batch ingestion pipeline. You can specify only one of the late message rejection properties."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"earlyMessageRejectionPeriod")),(0,i.yg)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.yg)("td",{parentName:"tr",align:null},"Configures tasks to reject messages with timestamps later than this period after the task reached its task duration. For example, if this property is set to ",(0,i.yg)("inlineCode",{parentName:"td"},"PT1H"),", the task duration is set to ",(0,i.yg)("inlineCode",{parentName:"td"},"PT1H")," and the supervisor creates a task at ",(0,i.yg)("inlineCode",{parentName:"td"},"2016-01-01T12:00Z"),", Druid drops messages with timestamps later than ",(0,i.yg)("inlineCode",{parentName:"td"},"2016-01-01T14:00Z"),". Tasks sometimes run past their task duration, such as in cases of supervisor failover. Setting ",(0,i.yg)("inlineCode",{parentName:"td"},"earlyMessageRejectionPeriod")," too low may cause Druid to drop messages unexpectedly whenever a task runs past its originally configured task duration."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null})))),(0,i.yg)("h4",{id:"task-autoscaler"},"Task autoscaler"),(0,i.yg)("p",null,"You can optionally configure autoscaling behavior for ingestion tasks using the ",(0,i.yg)("inlineCode",{parentName:"p"},"autoScalerConfig")," property of the ",(0,i.yg)("inlineCode",{parentName:"p"},"ioConfig")," object."),(0,i.yg)("p",null,"The following table outlines the configuration properties for ",(0,i.yg)("inlineCode",{parentName:"p"},"autoScalerConfig"),":"),(0,i.yg)("table",null,(0,i.yg)("thead",{parentName:"table"},(0,i.yg)("tr",{parentName:"thead"},(0,i.yg)("th",{parentName:"tr",align:null},"Property"),(0,i.yg)("th",{parentName:"tr",align:null},"Description"),(0,i.yg)("th",{parentName:"tr",align:null},"Required"),(0,i.yg)("th",{parentName:"tr",align:null},"Default"))),(0,i.yg)("tbody",{parentName:"table"},(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"enableTaskAutoScaler")),(0,i.yg)("td",{parentName:"tr",align:null},"Enables the autoscaler. If not specified, Druid disables the autoscaler even when ",(0,i.yg)("inlineCode",{parentName:"td"},"autoScalerConfig")," is not null."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"false"))),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"taskCountMax")),(0,i.yg)("td",{parentName:"tr",align:null},"The maximum number of ingestion tasks. Must be greater than or equal to ",(0,i.yg)("inlineCode",{parentName:"td"},"taskCountMin"),". If ",(0,i.yg)("inlineCode",{parentName:"td"},"taskCountMax")," is greater than the number of Kafka partitions or Kinesis shards, Druid set the maximum number of reading tasks to the number of Kafka partitions or Kinesis shards and ignores ",(0,i.yg)("inlineCode",{parentName:"td"},"taskCountMax"),"."),(0,i.yg)("td",{parentName:"tr",align:null},"Yes"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"taskCountMin")),(0,i.yg)("td",{parentName:"tr",align:null},"The minimum number of ingestion tasks. When you enable the autoscaler, Druid ignores the value of ",(0,i.yg)("inlineCode",{parentName:"td"},"taskCount")," in ",(0,i.yg)("inlineCode",{parentName:"td"},"ioConfig")," and starts with the ",(0,i.yg)("inlineCode",{parentName:"td"},"taskCountMin")," number of tasks to launch."),(0,i.yg)("td",{parentName:"tr",align:null},"Yes"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"minTriggerScaleActionFrequencyMillis")),(0,i.yg)("td",{parentName:"tr",align:null},"The minimum time interval between two scale actions."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"600000")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"autoScalerStrategy")),(0,i.yg)("td",{parentName:"tr",align:null},"The algorithm of autoscaler. Druid only supports the ",(0,i.yg)("inlineCode",{parentName:"td"},"lagBased")," strategy. See ",(0,i.yg)("a",{parentName:"td",href:"#autoscaler-strategy"},"Autoscaler strategy")," for more information."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"lagBased"))))),(0,i.yg)("h5",{id:"autoscaler-strategy"},"Autoscaler strategy"),(0,i.yg)("admonition",{type:"info"},(0,i.yg)("p",{parentName:"admonition"},"Unlike the Kafka indexing service, Kinesis reports lag metrics measured in time difference in milliseconds between the current sequence number and latest sequence number, rather than message count.")),(0,i.yg)("p",null,"The following table outlines the configuration properties related to the ",(0,i.yg)("inlineCode",{parentName:"p"},"lagBased")," autoscaler strategy:"),(0,i.yg)("table",null,(0,i.yg)("thead",{parentName:"table"},(0,i.yg)("tr",{parentName:"thead"},(0,i.yg)("th",{parentName:"tr",align:null},"Property"),(0,i.yg)("th",{parentName:"tr",align:null},"Description"),(0,i.yg)("th",{parentName:"tr",align:null},"Required"),(0,i.yg)("th",{parentName:"tr",align:null},"Default"))),(0,i.yg)("tbody",{parentName:"table"},(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"lagCollectionIntervalMillis")),(0,i.yg)("td",{parentName:"tr",align:null},"The time period during which Druid collects lag metric points."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"30000")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"lagCollectionRangeMillis")),(0,i.yg)("td",{parentName:"tr",align:null},"The total time window of lag collection. Use with ",(0,i.yg)("inlineCode",{parentName:"td"},"lagCollectionIntervalMillis")," to specify the intervals at which to collect lag metric points."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"600000")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"scaleOutThreshold")),(0,i.yg)("td",{parentName:"tr",align:null},"The threshold of scale out action."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"6000000")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"triggerScaleOutFractionThreshold")),(0,i.yg)("td",{parentName:"tr",align:null},"Enables scale out action if ",(0,i.yg)("inlineCode",{parentName:"td"},"triggerScaleOutFractionThreshold")," percent of lag points is higher than ",(0,i.yg)("inlineCode",{parentName:"td"},"scaleOutThreshold"),"."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"0.3")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"scaleInThreshold")),(0,i.yg)("td",{parentName:"tr",align:null},"The threshold of scale in action."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"1000000")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"triggerScaleInFractionThreshold")),(0,i.yg)("td",{parentName:"tr",align:null},"Enables scale in action if ",(0,i.yg)("inlineCode",{parentName:"td"},"triggerScaleInFractionThreshold")," percent of lag points is lower than ",(0,i.yg)("inlineCode",{parentName:"td"},"scaleOutThreshold"),"."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"0.9")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"scaleActionStartDelayMillis")),(0,i.yg)("td",{parentName:"tr",align:null},"The number of milliseconds to delay after the supervisor starts before the first scale logic check."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"300000")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"scaleActionPeriodMillis")),(0,i.yg)("td",{parentName:"tr",align:null},"The frequency in milliseconds to check if a scale action is triggered."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"60000")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"scaleInStep")),(0,i.yg)("td",{parentName:"tr",align:null},"The number of tasks to reduce at once when scaling down."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"1")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"scaleOutStep")),(0,i.yg)("td",{parentName:"tr",align:null},"The number of tasks to add at once when scaling out."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"2")))),(0,i.yg)("p",null,"The following example shows a supervisor spec with ",(0,i.yg)("inlineCode",{parentName:"p"},"lagBased")," autoscaler:"),(0,i.yg)("details",null,(0,i.yg)("summary",null,"Click to view the example"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-json"},'{\n "type": "kinesis",\n "dataSchema": {\n "dataSource": "metrics-kinesis",\n "timestampSpec": {\n "column": "timestamp",\n "format": "auto"\n },\n "dimensionsSpec": {\n "dimensions": [],\n "dimensionExclusions": [\n "timestamp",\n "value"\n ]\n },\n "metricsSpec": [\n {\n "name": "count",\n "type": "count"\n },\n {\n "name": "value_sum",\n "fieldName": "value",\n "type": "doubleSum"\n },\n {\n "name": "value_min",\n "fieldName": "value",\n "type": "doubleMin"\n },\n {\n "name": "value_max",\n "fieldName": "value",\n "type": "doubleMax"\n }\n ],\n "granularitySpec": {\n "type": "uniform",\n "segmentGranularity": "HOUR",\n "queryGranularity": "NONE"\n }\n },\n "ioConfig": {\n "stream": "metrics",\n "autoScalerConfig": {\n "enableTaskAutoScaler": true,\n "taskCountMax": 6,\n "taskCountMin": 2,\n "minTriggerScaleActionFrequencyMillis": 600000,\n "autoScalerStrategy": "lagBased",\n "lagCollectionIntervalMillis": 30000,\n "lagCollectionRangeMillis": 600000,\n "scaleOutThreshold": 600000,\n "triggerScaleOutFractionThreshold": 0.3,\n "scaleInThreshold": 100000,\n "triggerScaleInFractionThreshold": 0.9,\n "scaleActionStartDelayMillis": 300000,\n "scaleActionPeriodMillis": 60000,\n "scaleInStep": 1,\n "scaleOutStep": 2\n },\n "inputFormat": {\n "type": "json"\n },\n "endpoint": "kinesis.us-east-1.amazonaws.com",\n "taskCount": 1,\n "replicas": 1,\n "taskDuration": "PT1H"\n },\n "tuningConfig": {\n "type": "kinesis",\n "maxRowsPerSegment": 5000000\n }\n}\n'))),(0,i.yg)("h3",{id:"tuning-configuration"},"Tuning configuration"),(0,i.yg)("p",null,"The ",(0,i.yg)("inlineCode",{parentName:"p"},"tuningConfig")," object is optional. If you don't specify the ",(0,i.yg)("inlineCode",{parentName:"p"},"tuningConfig")," object, Druid uses the default configuration settings."),(0,i.yg)("p",null,"The following table outlines the ",(0,i.yg)("inlineCode",{parentName:"p"},"tuningConfig")," configuration properties that apply to both Apache Kafka and Amazon Kinesis ingestion methods.\nFor configuration properties specific to Apache Kafka and Amazon Kinesis, see ",(0,i.yg)("a",{parentName:"p",href:"/docs/latest/ingestion/kafka-ingestion#tuning-configuration"},"Kafka tuning configuration")," and ",(0,i.yg)("a",{parentName:"p",href:"/docs/latest/ingestion/kinesis-ingestion#tuning-configuration"},"Kinesis tuning configuration")," respectively."),(0,i.yg)("table",null,(0,i.yg)("thead",{parentName:"table"},(0,i.yg)("tr",{parentName:"thead"},(0,i.yg)("th",{parentName:"tr",align:null},"Property"),(0,i.yg)("th",{parentName:"tr",align:null},"Type"),(0,i.yg)("th",{parentName:"tr",align:null},"Description"),(0,i.yg)("th",{parentName:"tr",align:null},"Required"),(0,i.yg)("th",{parentName:"tr",align:null},"Default"))),(0,i.yg)("tbody",{parentName:"table"},(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"type")),(0,i.yg)("td",{parentName:"tr",align:null},"String"),(0,i.yg)("td",{parentName:"tr",align:null},"The tuning type code for the ingestion method. One of ",(0,i.yg)("inlineCode",{parentName:"td"},"kafka")," or ",(0,i.yg)("inlineCode",{parentName:"td"},"kinesis"),"."),(0,i.yg)("td",{parentName:"tr",align:null},"Yes"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"maxRowsInMemory")),(0,i.yg)("td",{parentName:"tr",align:null},"Integer"),(0,i.yg)("td",{parentName:"tr",align:null},"The number of rows to aggregate before persisting. This number represents the post-aggregation rows. It is not equivalent to the number of input events, but the resulting number of aggregated rows. Druid uses ",(0,i.yg)("inlineCode",{parentName:"td"},"maxRowsInMemory")," to manage the required JVM heap size. The maximum heap memory usage for indexing scales is ",(0,i.yg)("inlineCode",{parentName:"td"},"maxRowsInMemory * (2 + maxPendingPersists)"),". Normally, you do not need to set this, but depending on the nature of data, if rows are short in terms of bytes, you may not want to store a million rows in memory and this value should be set."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"150000")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"maxBytesInMemory")),(0,i.yg)("td",{parentName:"tr",align:null},"Long"),(0,i.yg)("td",{parentName:"tr",align:null},"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. The maximum heap memory usage for indexing is ",(0,i.yg)("inlineCode",{parentName:"td"},"maxBytesInMemory * (2 + maxPendingPersists)"),"."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"One-sixth of max JVM memory")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"skipBytesInMemoryOverheadCheck")),(0,i.yg)("td",{parentName:"tr",align:null},"Boolean"),(0,i.yg)("td",{parentName:"tr",align:null},"The calculation of ",(0,i.yg)("inlineCode",{parentName:"td"},"maxBytesInMemory")," takes into account overhead objects created during ingestion and each intermediate persist. To exclude the bytes of these overhead objects from the ",(0,i.yg)("inlineCode",{parentName:"td"},"maxBytesInMemory")," check, set ",(0,i.yg)("inlineCode",{parentName:"td"},"skipBytesInMemoryOverheadCheck")," to ",(0,i.yg)("inlineCode",{parentName:"td"},"true"),"."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"false"))),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"maxRowsPerSegment")),(0,i.yg)("td",{parentName:"tr",align:null},"Integer"),(0,i.yg)("td",{parentName:"tr",align:null},"The number of rows to store in a segment. This number is post-aggregation rows. Handoff occurs when ",(0,i.yg)("inlineCode",{parentName:"td"},"maxRowsPerSegment")," or ",(0,i.yg)("inlineCode",{parentName:"td"},"maxTotalRows")," is reached or every ",(0,i.yg)("inlineCode",{parentName:"td"},"intermediateHandoffPeriod"),", whichever happens first."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"5000000")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"maxTotalRows")),(0,i.yg)("td",{parentName:"tr",align:null},"Long"),(0,i.yg)("td",{parentName:"tr",align:null},"The number of rows to aggregate across all segments; this number is post-aggregation rows. Handoff happens either if ",(0,i.yg)("inlineCode",{parentName:"td"},"maxRowsPerSegment")," or ",(0,i.yg)("inlineCode",{parentName:"td"},"maxTotalRows")," is reached or every ",(0,i.yg)("inlineCode",{parentName:"td"},"intermediateHandoffPeriod"),", whichever happens earlier."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"20000000")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"intermediateHandoffPeriod")),(0,i.yg)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.yg)("td",{parentName:"tr",align:null},"The period that determines how often tasks hand off segments. Handoff occurs if ",(0,i.yg)("inlineCode",{parentName:"td"},"maxRowsPerSegment")," or ",(0,i.yg)("inlineCode",{parentName:"td"},"maxTotalRows")," is reached or every ",(0,i.yg)("inlineCode",{parentName:"td"},"intermediateHandoffPeriod"),", whichever happens first."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"P2147483647D"))),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"intermediatePersistPeriod")),(0,i.yg)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.yg)("td",{parentName:"tr",align:null},"The period that determines the rate at which intermediate persists occur."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"PT10M"))),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"maxPendingPersists")),(0,i.yg)("td",{parentName:"tr",align:null},"Integer"),(0,i.yg)("td",{parentName:"tr",align:null},"Maximum number of persists that can be pending but not started. If a new intermediate persist exceeds this limit, Druid blocks ingestion until the currently running persist finishes. One persist can be running concurrently with ingestion, and none can be queued up. The maximum heap memory usage for indexing scales is ",(0,i.yg)("inlineCode",{parentName:"td"},"maxRowsInMemory * (2 + maxPendingPersists)"),"."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"0")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"indexSpec")),(0,i.yg)("td",{parentName:"tr",align:null},"Object"),(0,i.yg)("td",{parentName:"tr",align:null},"Defines segment storage format options to use at indexing time. See ",(0,i.yg)("a",{parentName:"td",href:"/docs/latest/ingestion/ingestion-spec#indexspec"},"IndexSpec")," for more information."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"indexSpecForIntermediatePersists")),(0,i.yg)("td",{parentName:"tr",align:null},"Object"),(0,i.yg)("td",{parentName:"tr",align:null},"Defines segment storage format options to use at indexing time for intermediate persisted temporary segments. You can use ",(0,i.yg)("inlineCode",{parentName:"td"},"indexSpecForIntermediatePersists")," 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."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"reportParseExceptions")),(0,i.yg)("td",{parentName:"tr",align:null},"Boolean"),(0,i.yg)("td",{parentName:"tr",align:null},"DEPRECATED. If ",(0,i.yg)("inlineCode",{parentName:"td"},"true"),", Druid throws exceptions encountered during parsing causing ingestion to halt. If ",(0,i.yg)("inlineCode",{parentName:"td"},"false"),", Druid skips unparseable rows and fields. Setting ",(0,i.yg)("inlineCode",{parentName:"td"},"reportParseExceptions")," to ",(0,i.yg)("inlineCode",{parentName:"td"},"true")," overrides existing configurations for ",(0,i.yg)("inlineCode",{parentName:"td"},"maxParseExceptions")," and ",(0,i.yg)("inlineCode",{parentName:"td"},"maxSavedParseExceptions"),", setting ",(0,i.yg)("inlineCode",{parentName:"td"},"maxParseExceptions")," to 0 and limiting ",(0,i.yg)("inlineCode",{parentName:"td"},"maxSavedParseExceptions")," to not more than 1."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"false"))),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"handoffConditionTimeout")),(0,i.yg)("td",{parentName:"tr",align:null},"Long"),(0,i.yg)("td",{parentName:"tr",align:null},"Number of milliseconds to wait for segment handoff. Set to a value >= 0, where 0 means to wait indefinitely."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"900000 (15 minutes) for Kafka. 0 for Kinesis.")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"resetOffsetAutomatically")),(0,i.yg)("td",{parentName:"tr",align:null},"Boolean"),(0,i.yg)("td",{parentName:"tr",align:null},"Resets partitions when the sequence number is unavailable. If set to ",(0,i.yg)("inlineCode",{parentName:"td"},"true"),", Druid resets partitions to the earliest or latest Kafka sequence number or Kinesis offset, based on the value of ",(0,i.yg)("inlineCode",{parentName:"td"},"useEarliestSequenceNumber")," or ",(0,i.yg)("inlineCode",{parentName:"td"},"useEarliestOffset")," (earliest if ",(0,i.yg)("inlineCode",{parentName:"td"},"true"),", latest if ",(0,i.yg)("inlineCode",{parentName:"td"},"false"),"). If set to ",(0,i.yg)("inlineCode",{parentName:"td"},"false"),", the exception bubbles up causing tasks to fail and ingestion to halt. If this occurs, manual intervention is required to correct the situation, potentially through ",(0,i.yg)("a",{parentName:"td",href:"/docs/latest/api-reference/supervisor-api#reset-a-supervisor"},"resetting the supervisor"),"."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"false"))),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"workerThreads")),(0,i.yg)("td",{parentName:"tr",align:null},"Integer"),(0,i.yg)("td",{parentName:"tr",align:null},"The number of threads that the supervisor uses to handle requests/responses for worker tasks, along with any other internal asynchronous operation."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"min(10, taskCount)"))),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"chatRetries")),(0,i.yg)("td",{parentName:"tr",align:null},"Integer"),(0,i.yg)("td",{parentName:"tr",align:null},"The number of times Druid retries HTTP requests to indexing tasks before considering tasks unresponsive."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"8")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"httpTimeout")),(0,i.yg)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.yg)("td",{parentName:"tr",align:null},"The period of time to wait for a HTTP response from an indexing task."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"PT10S"))),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"shutdownTimeout")),(0,i.yg)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.yg)("td",{parentName:"tr",align:null},"The period of time to wait for the supervisor to attempt a graceful shutdown of tasks before exiting."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"PT80S"))),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"offsetFetchPeriod")),(0,i.yg)("td",{parentName:"tr",align:null},"ISO 8601 period"),(0,i.yg)("td",{parentName:"tr",align:null},"Determines how often the supervisor queries the streaming source and the indexing tasks to fetch current offsets and calculate lag. If the user-specified value is below the minimum value of ",(0,i.yg)("inlineCode",{parentName:"td"},"PT5S"),", the supervisor ignores the value and uses the minimum value instead."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"PT30S"))),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"segmentWriteOutMediumFactory")),(0,i.yg)("td",{parentName:"tr",align:null},"Object"),(0,i.yg)("td",{parentName:"tr",align:null},"The segment write-out medium to use when creating segments. See ",(0,i.yg)("a",{parentName:"td",href:"/docs/latest/configuration/#segmentwriteoutmediumfactory"},"Additional Peon configuration: SegmentWriteOutMediumFactory")," for explanation and available options."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"If not specified, Druid uses the value from ",(0,i.yg)("inlineCode",{parentName:"td"},"druid.peon.defaultSegmentWriteOutMediumFactory.type"),".")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"logParseExceptions")),(0,i.yg)("td",{parentName:"tr",align:null},"Boolean"),(0,i.yg)("td",{parentName:"tr",align:null},"If ",(0,i.yg)("inlineCode",{parentName:"td"},"true"),", Druid logs an error message when a parsing exception occurs, containing information about the row where the error occurred."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"false"))),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"maxParseExceptions")),(0,i.yg)("td",{parentName:"tr",align:null},"Integer"),(0,i.yg)("td",{parentName:"tr",align:null},"The maximum number of parse exceptions that can occur before the task halts ingestion and fails. Overridden if ",(0,i.yg)("inlineCode",{parentName:"td"},"reportParseExceptions")," is set."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"unlimited")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"maxSavedParseExceptions")),(0,i.yg)("td",{parentName:"tr",align:null},"Integer"),(0,i.yg)("td",{parentName:"tr",align:null},"When a parse exception occurs, Druid keeps track of the most recent parse exceptions. ",(0,i.yg)("inlineCode",{parentName:"td"},"maxSavedParseExceptions")," limits the number of saved exception instances. These saved exceptions are available after the task finishes in the ",(0,i.yg)("a",{parentName:"td",href:"/docs/latest/ingestion/tasks#task-reports"},"task completion report"),". Overridden if ",(0,i.yg)("inlineCode",{parentName:"td"},"reportParseExceptions")," is set."),(0,i.yg)("td",{parentName:"tr",align:null},"No"),(0,i.yg)("td",{parentName:"tr",align:null},"0")))),(0,i.yg)("h2",{id:"start-a-supervisor"},"Start a supervisor"),(0,i.yg)("p",null,"Druid starts a new supervisor when you submit a supervisor spec.\nYou can submit the supervisor spec using the Druid console ",(0,i.yg)("a",{parentName:"p",href:"/docs/latest/operations/web-console#data-loader"},"data loader")," or by calling the ",(0,i.yg)("a",{parentName:"p",href:"/docs/latest/api-reference/supervisor-api"},"Supervisor API"),"."),(0,i.yg)("p",null,"The following screenshot shows the ",(0,i.yg)("a",{parentName:"p",href:"/docs/latest/operations/web-console#supervisors"},"Supervisors")," view of the Druid web console for a cluster with two supervisors:"),(0,i.yg)("p",null,(0,i.yg)("img",{alt:"Supervisors view",src:n(3797).A,width:"1250",height:"640"})),(0,i.yg)("p",null,"Once started, the supervisor persists in the configured metadata database. There can only be one supervisor per datasource. Submitting a second supervisor spec for the same datasource overwrites the previous one."),(0,i.yg)("p",null,"When an Overlord gains leadership, either by being started or as a result of another Overlord failing, it spawns a supervisor for each supervisor spec in the metadata database. The supervisor then discovers running indexing tasks and attempts to adopt them if they are compatible with the supervisor's configuration. If they are not compatible, the tasks are terminated and the supervisor creates a new set of tasks. This way, the supervisor ingestion tasks persist across Overlord restarts and failovers."),(0,i.yg)("h3",{id:"schema-and-configuration-changes"},"Schema and configuration changes"),(0,i.yg)("p",null,"Schema and configuration changes are handled by submitting the new supervisor spec. The Overlord initiates a graceful shutdown of the existing supervisor. The running supervisor signals its tasks to stop reading and begin publishing, exiting itself. Druid then uses the provided configuration to create a new supervisor. Druid submits a new schema while retaining existing publishing tasks and starts new tasks at the previous task offsets.\nThis way, configuration changes can be applied without requiring any pause in ingestion."),(0,i.yg)("h2",{id:"status-report"},"Status report"),(0,i.yg)("p",null,"The supervisor status report contains the state of the supervisor tasks and an array of recently thrown exceptions reported as ",(0,i.yg)("inlineCode",{parentName:"p"},"recentErrors"),".\nYou can control the maximum size of the exceptions using the ",(0,i.yg)("inlineCode",{parentName:"p"},"druid.supervisor.maxStoredExceptionEvents")," configuration."),(0,i.yg)("p",null,"To view the supervisor status in the web console, navigate to the ",(0,i.yg)("strong",{parentName:"p"},"Supervisors")," view and click the supervisor ID to open the ",(0,i.yg)("strong",{parentName:"p"},"Supervisor")," dialog.\nClick ",(0,i.yg)("strong",{parentName:"p"},"Status")," in the left navigation pane to display the status:"),(0,i.yg)("p",null,(0,i.yg)("img",{alt:"Supervisors info dialog",src:n(19789).A,width:"1250",height:"640"})),(0,i.yg)("p",null,"The following example shows the status of a supervisor with the name ",(0,i.yg)("inlineCode",{parentName:"p"},"social_media"),":"),(0,i.yg)("details",null,(0,i.yg)("summary",null,"Click to view the example"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-json"},'{\n "dataSource": "social_media",\n "stream": "social_media",\n "partitions": 1,\n "replicas": 1,\n "durationSeconds": 3600,\n "activeTasks": [\n {\n "id": "index_kafka_social_media_8ff3096f21fe448_jajnddno",\n "startingOffsets": {\n "0": 0\n },\n "startTime": "2024-01-30T21:21:41.696Z",\n "remainingSeconds": 479,\n "type": "ACTIVE",\n "currentOffsets": {\n "0": 50000\n },\n "lag": {\n "0": 0\n }\n }\n ],\n "publishingTasks": [],\n "latestOffsets": {\n "0": 50000\n },\n "minimumLag": {\n "0": 0\n },\n "aggregateLag": 0,\n "offsetsLastUpdated": "2024-01-30T22:13:19.335Z",\n "suspended": false,\n "healthy": true,\n "state": "RUNNING",\n "detailedState": "RUNNING",\n "recentErrors": []\n}\n'))),(0,i.yg)("p",null,"The status report contains two properties that correspond to the state of the supervisor: ",(0,i.yg)("inlineCode",{parentName:"p"},"state")," and ",(0,i.yg)("inlineCode",{parentName:"p"},"detailedState"),". The ",(0,i.yg)("inlineCode",{parentName:"p"},"state")," property contains a small number of generic states that apply to any type of supervisor. The ",(0,i.yg)("inlineCode",{parentName:"p"},"detailedState")," property contains a more descriptive, implementation-specific state that may provide more insight into the supervisor's activities."),(0,i.yg)("p",null,"Possible ",(0,i.yg)("inlineCode",{parentName:"p"},"state")," values are ",(0,i.yg)("inlineCode",{parentName:"p"},"PENDING"),", ",(0,i.yg)("inlineCode",{parentName:"p"},"RUNNING"),", ",(0,i.yg)("inlineCode",{parentName:"p"},"SUSPENDED"),", ",(0,i.yg)("inlineCode",{parentName:"p"},"STOPPING"),", ",(0,i.yg)("inlineCode",{parentName:"p"},"UNHEALTHY_SUPERVISOR"),", and ",(0,i.yg)("inlineCode",{parentName:"p"},"UNHEALTHY_TASKS"),"."),(0,i.yg)("p",null,"The following table lists ",(0,i.yg)("inlineCode",{parentName:"p"},"detailedState")," values and their corresponding ",(0,i.yg)("inlineCode",{parentName:"p"},"state")," mapping:"),(0,i.yg)("table",null,(0,i.yg)("thead",{parentName:"table"},(0,i.yg)("tr",{parentName:"thead"},(0,i.yg)("th",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"th"},"detailedState")),(0,i.yg)("th",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"th"},"state")),(0,i.yg)("th",{parentName:"tr",align:null},"Description"))),(0,i.yg)("tbody",{parentName:"table"},(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"UNHEALTHY_SUPERVISOR")),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"UNHEALTHY_SUPERVISOR")),(0,i.yg)("td",{parentName:"tr",align:null},"The supervisor encountered errors on previous ",(0,i.yg)("inlineCode",{parentName:"td"},"druid.supervisor.unhealthinessThreshold")," iterations.")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"UNHEALTHY_TASKS")),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"UNHEALTHY_TASKS")),(0,i.yg)("td",{parentName:"tr",align:null},"The last ",(0,i.yg)("inlineCode",{parentName:"td"},"druid.supervisor.taskUnhealthinessThreshold")," tasks all failed.")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"UNABLE_TO_CONNECT_TO_STREAM")),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"UNHEALTHY_SUPERVISOR")),(0,i.yg)("td",{parentName:"tr",align:null},"The supervisor is encountering connectivity issues with the stream and hasn't successfully connected in the past.")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"LOST_CONTACT_WITH_STREAM")),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"UNHEALTHY_SUPERVISOR")),(0,i.yg)("td",{parentName:"tr",align:null},"The supervisor is encountering connectivity issues with the stream but has successfully connected in the past.")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"PENDING")," (first iteration only)"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"PENDING")),(0,i.yg)("td",{parentName:"tr",align:null},"The supervisor has been initialized but hasn't started connecting to the stream.")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"CONNECTING_TO_STREAM")," (first iteration only)"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"RUNNING")),(0,i.yg)("td",{parentName:"tr",align:null},"The supervisor is trying to connect to the stream and update partition data.")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"DISCOVERING_INITIAL_TASKS")," (first iteration only)"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"RUNNING")),(0,i.yg)("td",{parentName:"tr",align:null},"The supervisor is discovering already-running tasks.")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"CREATING_TASKS")," (first iteration only)"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"RUNNING")),(0,i.yg)("td",{parentName:"tr",align:null},"The supervisor is creating tasks and discovering state.")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"RUNNING")),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"RUNNING")),(0,i.yg)("td",{parentName:"tr",align:null},"The supervisor has started tasks and is waiting for ",(0,i.yg)("inlineCode",{parentName:"td"},"taskDuration")," to elapse.")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"IDLE")),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"IDLE")),(0,i.yg)("td",{parentName:"tr",align:null},"The supervisor is not creating tasks since the input stream has not received any new data and all the existing data is read.")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"SUSPENDED")),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"SUSPENDED")),(0,i.yg)("td",{parentName:"tr",align:null},"The supervisor is suspended.")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"STOPPING")),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("inlineCode",{parentName:"td"},"STOPPING")),(0,i.yg)("td",{parentName:"tr",align:null},"The supervisor is stopping.")))),(0,i.yg)("p",null,"On each iteration of the supervisor's run loop, the supervisor completes the following tasks in sequence:"),(0,i.yg)("ol",null,(0,i.yg)("li",{parentName:"ol"},"Fetch the list of units of parallelism, such as Kinesis shards or Kafka partitions, and determine the starting sequence number or offset for each unit (either based on the last processed sequence number or offset if continuing, or starting from the beginning or ending of the stream if this is a new stream)."),(0,i.yg)("li",{parentName:"ol"},"Discover any running indexing tasks that are writing to the supervisor's datasource and adopt them if they match the supervisor's configuration, else signal them to stop."),(0,i.yg)("li",{parentName:"ol"},"Send a status request to each supervised task to update the view of the state of the tasks under supervision."),(0,i.yg)("li",{parentName:"ol"},"Handle tasks that have exceeded ",(0,i.yg)("inlineCode",{parentName:"li"},"taskDuration")," and should transition from the reading to publishing state."),(0,i.yg)("li",{parentName:"ol"},"Handle tasks that have finished publishing and signal redundant replica tasks to stop."),(0,i.yg)("li",{parentName:"ol"},"Handle tasks that have failed and clean up the supervisor's internal state."),(0,i.yg)("li",{parentName:"ol"},"Compare the list of healthy tasks to the requested ",(0,i.yg)("inlineCode",{parentName:"li"},"taskCount")," and ",(0,i.yg)("inlineCode",{parentName:"li"},"replicas")," configurations and create additional tasks if required.")),(0,i.yg)("p",null,"The ",(0,i.yg)("inlineCode",{parentName:"p"},"detailedState"),' property shows additional values (marked with "first iteration only" in the preceding table) the first time the\nsupervisor executes this run loop after startup or after resuming from a suspension. This is intended to surface\ninitialization-type issues, where the supervisor is unable to reach a stable state. For example, if the supervisor cannot connect to\nthe stream, if it\'s unable to read from the stream, or cannot communicate with existing tasks. Once the supervisor is stable;\nthat is, once it has completed a full execution without encountering any issues, ',(0,i.yg)("inlineCode",{parentName:"p"},"detailedState")," will show a ",(0,i.yg)("inlineCode",{parentName:"p"},"RUNNING"),"\nstate until it is stopped, suspended, or hits a failure threshold and transitions to an unhealthy state."),(0,i.yg)("admonition",{type:"info"},(0,i.yg)("p",{parentName:"admonition"},"For the Kafka indexing service, the consumer lag per partition may be reported as negative values if the supervisor hasn't received the latest offset response from Kafka. The aggregate lag value will always be >= 0.")),(0,i.yg)("h2",{id:"supervisors-system-table"},"SUPERVISORS system table"),(0,i.yg)("p",null,"Druid exposes system information through special system schemas. You can query the ",(0,i.yg)("inlineCode",{parentName:"p"},"sys.supervisors")," table to retrieve information about the supervisor internals.\nThe following example shows how to retrieve supervisor tasks information filtered by health status:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-sql"},"SELECT * FROM sys.supervisors WHERE healthy=0;\n")),(0,i.yg)("p",null,"For more information on the supervisors system table, see ",(0,i.yg)("a",{parentName:"p",href:"/docs/latest/querying/sql-metadata-tables#supervisors-table"},"SUPERVISORS table"),"."),(0,i.yg)("h2",{id:"capacity-planning"},"Capacity planning"),(0,i.yg)("p",null,"Indexing tasks run on MiddleManagers and are limited by the resources available in the MiddleManager cluster. In particular, you should make sure that you have sufficient worker capacity, configured using the\n",(0,i.yg)("inlineCode",{parentName:"p"},"druid.worker.capacity")," property, to handle the configuration in the supervisor spec. Note that worker capacity is\nshared across all types of indexing tasks, so you should plan your worker capacity to handle your total indexing load, such as batch processing, streaming tasks, and merging tasks. If your workers run out of capacity, indexing tasks queue and wait for the next available worker. This may cause queries to return partial results but will not result in data loss, assuming the tasks run before the stream purges those sequence numbers."),(0,i.yg)("p",null,"A running task can be in one of two states: reading or publishing. A task remains in reading state for the period defined in ",(0,i.yg)("inlineCode",{parentName:"p"},"taskDuration"),", at which point it transitions to publishing state. A task remains in publishing state for as long as it takes to generate segments, push segments to deep storage, and have them loaded and served by a Historical service or until ",(0,i.yg)("inlineCode",{parentName:"p"},"completionTimeout")," elapses."),(0,i.yg)("p",null,"The number of reading tasks is controlled by ",(0,i.yg)("inlineCode",{parentName:"p"},"replicas")," and ",(0,i.yg)("inlineCode",{parentName:"p"},"taskCount"),". In general, there are ",(0,i.yg)("inlineCode",{parentName:"p"},"replicas * taskCount")," reading tasks. An exception occurs if ",(0,i.yg)("inlineCode",{parentName:"p"},"taskCount")," is over the number of shards in Kinesis or partitions in Kafka, in which case Druid uses the number of shards or partitions. When ",(0,i.yg)("inlineCode",{parentName:"p"},"taskDuration")," elapses, these tasks transition to publishing state and ",(0,i.yg)("inlineCode",{parentName:"p"},"replicas * taskCount")," new reading tasks are created. To allow for reading tasks and publishing tasks to run concurrently, there should be a minimum capacity of:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-text"},"workerCapacity = 2 * replicas * taskCount\n")),(0,i.yg)("p",null,"This value is for the ideal situation in which there is at most one set of tasks publishing while another set is reading.\nIn some circumstances, it is possible to have multiple sets of tasks publishing simultaneously. This would happen if the\ntime-to-publish (generate segment, push to deep storage, load on Historical) is greater than ",(0,i.yg)("inlineCode",{parentName:"p"},"taskDuration"),". This is a valid and correct scenario but requires additional worker capacity to support. In general, it is a good idea to have ",(0,i.yg)("inlineCode",{parentName:"p"},"taskDuration")," be large enough that the previous set of tasks finishes publishing before the current set begins."),(0,i.yg)("h2",{id:"learn-more"},"Learn more"),(0,i.yg)("p",null,"See the following topics for more information:"),(0,i.yg)("ul",null,(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("a",{parentName:"li",href:"/docs/latest/api-reference/supervisor-api"},"Supervisor API")," for how to manage and monitor supervisors using the API."),(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("a",{parentName:"li",href:"/docs/latest/ingestion/kafka-ingestion"},"Apache Kafka ingestion")," to learn about ingesting data from an Apache Kafka stream."),(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("a",{parentName:"li",href:"/docs/latest/ingestion/kinesis-ingestion"},"Amazon Kinesis ingestion")," to learn about ingesting data from an Amazon Kinesis stream.")))}y.isMDXComponent=!0},19789:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/supervisor-info-dialog-300a1e58533b10622fd945eca74911e4.png"},3797:(e,t,n)=>{n.d(t,{A:()=>a});const a=n.p+"assets/images/supervisor-view-83f761c82cf23094ae3d37c91371b655.png"}}]);