blob: acc3f8de5c53c01da9273013d787f19fc52858eb [file] [log] [blame]
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5003],{3905:(e,n,t)=>{t.d(n,{Zo:()=>c,kt:()=>v});var r=t(7294);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function i(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?a(Object(t),!0).forEach((function(n){o(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function s(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t=a[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)t=a[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var l=r.createContext({}),p=function(e){var n=r.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):i(i({},n),e)),t},c=function(e){var n=p(e.components);return r.createElement(l.Provider,{value:n},e.children)},d="mdxType",u={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},m=r.forwardRef((function(e,n){var t=e.components,o=e.mdxType,a=e.originalType,l=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),d=p(t),m=o,v=d["".concat(l,".").concat(m)]||d[m]||u[m]||a;return t?r.createElement(v,i(i({ref:n},c),{},{components:t})):r.createElement(v,i({ref:n},c))}));function v(e,n){var t=arguments,o=n&&n.mdxType;if("string"==typeof e||o){var a=t.length,i=new Array(a);i[0]=m;var s={};for(var l in n)hasOwnProperty.call(n,l)&&(s[l]=n[l]);s.originalType=e,s[d]="string"==typeof e?e:o,i[1]=s;for(var p=2;p<a;p++)i[p]=t[p];return r.createElement.apply(null,i)}return r.createElement.apply(null,t)}m.displayName="MDXCreateElement"},8361:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>v,frontMatter:()=>s,metadata:()=>p,toc:()=>d});var r=t(7462),o=t(3366),a=(t(7294),t(3905)),i=["components"],s={id:"dynamic-config-provider",title:"Dynamic Config Providers"},l=void 0,p={unversionedId:"operations/dynamic-config-provider",id:"operations/dynamic-config-provider",title:"Dynamic Config Providers",description:"\x3c!--",source:"@site/docs/26.0.0/operations/dynamic-config-provider.md",sourceDirName:"operations",slug:"/operations/dynamic-config-provider",permalink:"/docs/26.0.0/operations/dynamic-config-provider",draft:!1,tags:[],version:"current",frontMatter:{id:"dynamic-config-provider",title:"Dynamic Config Providers"},sidebar:"docs",previous:{title:"Password providers",permalink:"/docs/26.0.0/operations/password-provider"},next:{title:"Authentication and Authorization",permalink:"/docs/26.0.0/design/auth"}},c={},d=[{value:"Environment variable dynamic config provider",id:"environment-variable-dynamic-config-provider",level:2}],u={toc:d},m="wrapper";function v(e){var n=e.components,t=(0,o.Z)(e,i);return(0,a.kt)(m,(0,r.Z)({},u,t,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"Druid relies on dynamic config providers to supply multiple related sets of credentials, secrets, and configurations within a Druid extension. Dynamic config providers are intended to eventually replace ",(0,a.kt)("a",{parentName:"p",href:"/docs/26.0.0/operations/password-provider"},"PasswordProvider"),"."),(0,a.kt)("p",null,"By default, Druid includes an environment variable dynamic config provider that supports Kafka consumer configuration in ",(0,a.kt)("a",{parentName:"p",href:"/docs/26.0.0/development/extensions-core/kafka-ingestion"},"Kafka ingestion"),"."),(0,a.kt)("p",null,"To develop a custom extension of the ",(0,a.kt)("inlineCode",{parentName:"p"},"DynamicConfigProvider")," interface that is registered at Druid process startup, see ",(0,a.kt)("a",{parentName:"p",href:"/docs/26.0.0/development/modules#adding-a-new-dynamicconfigprovider-implementation"},"Adding a new DynamicConfigProvider implementation"),"."),(0,a.kt)("h2",{id:"environment-variable-dynamic-config-provider"},"Environment variable dynamic config provider"),(0,a.kt)("p",null,"You can use the environment variable dynamic config provider (",(0,a.kt)("inlineCode",{parentName:"p"},"EnvironmentVariableDynamicConfigProvider"),") to store passwords or other sensitive information using system environment variables instead of plain text configuration."),(0,a.kt)("p",null,"The environment variable dynamic config provider uses the following syntax:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-json"},'druid.dynamic.config.provider={"type": "environment","variables":{"secret1": "SECRET1_VAR","secret2": "SECRET2_VAR"}}\n')),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:null},"Field"),(0,a.kt)("th",{parentName:"tr",align:null},"Type"),(0,a.kt)("th",{parentName:"tr",align:null},"Description"),(0,a.kt)("th",{parentName:"tr",align:null},"Required"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"type")),(0,a.kt)("td",{parentName:"tr",align:null},"String"),(0,a.kt)("td",{parentName:"tr",align:null},"dynamic config provider type"),(0,a.kt)("td",{parentName:"tr",align:null},"Yes: ",(0,a.kt)("inlineCode",{parentName:"td"},"environment"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:null},(0,a.kt)("inlineCode",{parentName:"td"},"variables")),(0,a.kt)("td",{parentName:"tr",align:null},"Map"),(0,a.kt)("td",{parentName:"tr",align:null},"environment variables that store the configuration information"),(0,a.kt)("td",{parentName:"tr",align:null},"Yes")))),(0,a.kt)("p",null,"When using the environment variable config provider, consider the following:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"If you manually specify a configuration key-value pair and use the dynamic config provider for the same key, Druid uses the value from the dynamic config provider."),(0,a.kt)("li",{parentName:"ul"},"For use in a supervisor spec, environment variables must be available to the system user that runs the Overlord service and that runs the Peon service.")),(0,a.kt)("p",null,"The following example shows how to configure environment variables to store the SSL key and truststore passwords for Kafka."),(0,a.kt)("p",null,"On the Overlord and Peon machines, set the following environment variables for the system user that runs the Druid services:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"export SSL_KEY_PASSWORD=mysecretkeypassword\nexport SSL_KEYSTORE_PASSWORD=mysecretkeystorepassword\nexport SSL_TRUSTSTORE_PASSWORD=mysecrettruststorepassword\n")),(0,a.kt)("p",null,"When you define the consumer properties in the supervisor spec, use the dynamic config provider to refer to the environment variables:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},'...\n "consumerProperties": {\n "bootstrap.servers": "localhost:9092",\n "ssl.keystore.location": "/opt/kafka/config/kafka01.keystore.jks",\n "ssl.truststore.location": "/opt/kafka/config/kafka.truststore.jks",\n "druid.dynamic.config.provider": {\n "type": "environment",\n "variables": {\n "ssl.key.password": "SSL_KEY_PASSWORD",\n "ssl.keystore.password": "SSL_KEYSTORE_PASSWORD",\n "ssl.truststore.password": "SSL_TRUSTSTORE_PASSWORD"\n }\n }\n },\n...\n')),(0,a.kt)("p",null,"When connecting to Kafka, Druid replaces the environment variables with their corresponding values."))}v.isMDXComponent=!0}}]);