blob: 13936ca3328c2a3adfc7134bdb8ad88e2ed4bab7 [file] [log] [blame]
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[2047],{15680:(e,r,a)=>{a.d(r,{xA:()=>u,yg:()=>y});var t=a(96540);function n(e,r,a){return r in e?Object.defineProperty(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[r]=a,e}function o(e,r){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),a.push.apply(a,t)}return a}function i(e){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?o(Object(a),!0).forEach((function(r){n(e,r,a[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):o(Object(a)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))}))}return e}function l(e,r){if(null==e)return{};var a,t,n=function(e,r){if(null==e)return{};var a,t,n={},o=Object.keys(e);for(t=0;t<o.length;t++)a=o[t],r.indexOf(a)>=0||(n[a]=e[a]);return n}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(t=0;t<o.length;t++)a=o[t],r.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var s=t.createContext({}),d=function(e){var r=t.useContext(s),a=r;return e&&(a="function"==typeof e?e(r):i(i({},r),e)),a},u=function(e){var r=d(e.components);return t.createElement(s.Provider,{value:r},e.children)},p="mdxType",c={inlineCode:"code",wrapper:function(e){var r=e.children;return t.createElement(t.Fragment,{},r)}},g=t.forwardRef((function(e,r){var a=e.components,n=e.mdxType,o=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),p=d(a),g=n,y=p["".concat(s,".").concat(g)]||p[g]||c[g]||o;return a?t.createElement(y,i(i({ref:r},u),{},{components:a})):t.createElement(y,i({ref:r},u))}));function y(e,r){var a=arguments,n=r&&r.mdxType;if("string"==typeof e||n){var o=a.length,i=new Array(o);i[0]=g;var l={};for(var s in r)hasOwnProperty.call(r,s)&&(l[s]=r[s]);l.originalType=e,l[p]="string"==typeof e?e:n,i[1]=l;for(var d=2;d<o;d++)i[d]=a[d];return t.createElement.apply(null,i)}return t.createElement.apply(null,a)}g.displayName="MDXCreateElement"},94329:(e,r,a)=>{a.r(r),a.d(r,{assets:()=>u,contentTitle:()=>s,default:()=>y,frontMatter:()=>l,metadata:()=>d,toc:()=>p});var t=a(58168),n=a(98587),o=(a(96540),a(15680)),i=["components"],l={id:"rolling-updates",title:"Rolling updates"},s=void 0,d={unversionedId:"operations/rolling-updates",id:"operations/rolling-updates",title:"Rolling updates",description:"\x3c!--",source:"@site/docs/latest/operations/rolling-updates.md",sourceDirName:"operations",slug:"/operations/rolling-updates",permalink:"/docs/latest/operations/rolling-updates",draft:!1,tags:[],version:"current",frontMatter:{id:"rolling-updates",title:"Rolling updates"},sidebar:"docs",previous:{title:"High availability",permalink:"/docs/latest/operations/high-availability"},next:{title:"Using rules to drop and retain data",permalink:"/docs/latest/operations/rule-configuration"}},u={},p=[{value:"Historical",id:"historical",level:2},{value:"Overlord",id:"overlord",level:2},{value:"Middle Managers/Indexers",id:"middle-managersindexers",level:2},{value:"Rolling restart (restore-based)",id:"rolling-restart-restore-based",level:3},{value:"Rolling restart (graceful-termination-based)",id:"rolling-restart-graceful-termination-based",level:3},{value:"Autoscaling-based replacement",id:"autoscaling-based-replacement",level:3},{value:"Standalone Real-time",id:"standalone-real-time",level:2},{value:"Broker",id:"broker",level:2},{value:"Coordinator",id:"coordinator",level:2}],c={toc:p},g="wrapper";function y(e){var r=e.components,a=(0,n.A)(e,i);return(0,o.yg)(g,(0,t.A)({},c,a,{components:r,mdxType:"MDXLayout"}),(0,o.yg)("p",null,"For rolling Apache Druid cluster updates with no downtime, we recommend updating Druid processes in the\nfollowing order:"),(0,o.yg)("ol",null,(0,o.yg)("li",{parentName:"ol"},"Historical"),(0,o.yg)("li",{parentName:"ol"},"Middle Manager and Indexer (if any)"),(0,o.yg)("li",{parentName:"ol"},"Broker"),(0,o.yg)("li",{parentName:"ol"},"Router"),(0,o.yg)("li",{parentName:"ol"},"Overlord (Note that you can upgrade the Overlord before any MiddleManager processes if you use ",(0,o.yg)("a",{parentName:"li",href:"#autoscaling-based-replacement"},"autoscaling-based replacement"),".)"),(0,o.yg)("li",{parentName:"ol"},"Coordinator ( or merged Coordinator+Overlord )")),(0,o.yg)("p",null,"If you need to do a rolling downgrade, reverse the order and start with the Coordinator processes."),(0,o.yg)("p",null,"For information about the latest release, see ",(0,o.yg)("a",{parentName:"p",href:"https://github.com/apache/druid/releases"},"Druid releases"),"."),(0,o.yg)("h2",{id:"historical"},"Historical"),(0,o.yg)("p",null,"Historical processes can be updated one at a time. Each Historical process has a startup time to memory map\nall the segments it was serving before the update. The startup time typically takes a few seconds to\na few minutes, depending on the hardware of the host. As long as each Historical process is updated\nwith a sufficient delay (greater than the time required to start a single process), you can rolling\nupdate the entire Historical cluster."),(0,o.yg)("h2",{id:"overlord"},"Overlord"),(0,o.yg)("p",null,"Overlord processes can be updated one at a time in a rolling fashion."),(0,o.yg)("h2",{id:"middle-managersindexers"},"Middle Managers/Indexers"),(0,o.yg)("p",null,"Middle Managers or Indexer nodes run both batch and real-time indexing tasks. Generally you want to update Middle\nManagers in such a way that real-time indexing tasks do not fail. There are three strategies for\ndoing that."),(0,o.yg)("h3",{id:"rolling-restart-restore-based"},"Rolling restart (restore-based)"),(0,o.yg)("p",null,"Middle Managers can be updated one at a time in a rolling fashion when you set\n",(0,o.yg)("inlineCode",{parentName:"p"},"druid.indexer.task.restoreTasksOnRestart=true"),". In this case, indexing tasks that support restoring\nwill restore their state on Middle Manager restart, and will not fail."),(0,o.yg)("p",null,"Currently, only realtime tasks support restoring, so non-realtime indexing tasks will fail and will\nneed to be resubmitted."),(0,o.yg)("h3",{id:"rolling-restart-graceful-termination-based"},"Rolling restart (graceful-termination-based)"),(0,o.yg)("p",null,'Middle Managers can be gracefully terminated using the "disable" API. This works for all task types,\neven tasks that are not restorable.'),(0,o.yg)("p",null,"To prepare a Middle Manager for update, send a POST request to\n",(0,o.yg)("inlineCode",{parentName:"p"},"<MiddleManager_IP:PORT>/druid/worker/v1/disable"),". The Overlord will now no longer send tasks to\nthis Middle Manager. Tasks that have already started will run to completion. Current state can be checked\nusing ",(0,o.yg)("inlineCode",{parentName:"p"},"<MiddleManager_IP:PORT>/druid/worker/v1/enabled")," ."),(0,o.yg)("p",null,"To view all existing tasks, send a GET request to ",(0,o.yg)("inlineCode",{parentName:"p"},"<MiddleManager_IP:PORT>/druid/worker/v1/tasks"),".\nWhen this list is empty, you can safely update the Middle Manager. After the Middle Manager starts\nback up, it is automatically enabled again. You can also manually enable Middle Managers by POSTing\nto ",(0,o.yg)("inlineCode",{parentName:"p"},"<MiddleManager_IP:PORT>/druid/worker/v1/enable"),"."),(0,o.yg)("h3",{id:"autoscaling-based-replacement"},"Autoscaling-based replacement"),(0,o.yg)("p",null,"If autoscaling is enabled on your Overlord, then Overlord processes can launch new Middle Manager processes\nen masse and then gracefully terminate old ones as their tasks finish. This process is configured by\nsetting ",(0,o.yg)("inlineCode",{parentName:"p"},"druid.indexer.runner.minWorkerVersion=#{VERSION}"),". Each time you update your Overlord process,\nthe ",(0,o.yg)("inlineCode",{parentName:"p"},"VERSION")," value should be increased, which will trigger a mass launch of new Middle Managers."),(0,o.yg)("p",null,"The config ",(0,o.yg)("inlineCode",{parentName:"p"},"druid.indexer.autoscale.workerVersion=#{VERSION}")," also needs to be set."),(0,o.yg)("h2",{id:"standalone-real-time"},"Standalone Real-time"),(0,o.yg)("p",null,"Standalone real-time processes can be updated one at a time in a rolling fashion."),(0,o.yg)("h2",{id:"broker"},"Broker"),(0,o.yg)("p",null,"Broker processes can be updated one at a time in a rolling fashion. There needs to be some delay between\nupdating each process as Brokers must load the entire state of the cluster before they return valid\nresults."),(0,o.yg)("h2",{id:"coordinator"},"Coordinator"),(0,o.yg)("p",null,"Coordinator processes can be updated one at a time in a rolling fashion."))}y.isMDXComponent=!0}}]);