blob: 0abb18b2ea0c72c860ab471cea7ed14825216214 [file] [log] [blame]
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8570],{3905:(e,t,r)=>{r.d(t,{Zo:()=>d,kt:()=>g});var o=r(67294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var p=o.createContext({}),l=function(e){var t=o.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):s(s({},t),e)),r},d=function(e){var t=l(e.components);return o.createElement(p.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},u=o.forwardRef((function(e,t){var r=e.components,n=e.mdxType,a=e.originalType,p=e.parentName,d=i(e,["components","mdxType","originalType","parentName"]),c=l(r),u=n,g=c["".concat(p,".").concat(u)]||c[u]||m[u]||a;return r?o.createElement(g,s(s({ref:t},d),{},{components:r})):o.createElement(g,s({ref:t},d))}));function g(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var a=r.length,s=new Array(a);s[0]=u;var i={};for(var p in t)hasOwnProperty.call(t,p)&&(i[p]=t[p]);i.originalType=e,i[c]="string"==typeof e?e:n,s[1]=i;for(var l=2;l<a;l++)s[l]=r[l];return o.createElement.apply(null,s)}return o.createElement.apply(null,r)}u.displayName="MDXCreateElement"},93354:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>d,contentTitle:()=>p,default:()=>g,frontMatter:()=>i,metadata:()=>l,toc:()=>c});var o=r(87462),n=r(63366),a=(r(67294),r(3905)),s=["components"],i={id:"deep-storage-migration",title:"Deep storage migration"},p=void 0,l={unversionedId:"operations/deep-storage-migration",id:"operations/deep-storage-migration",title:"Deep storage migration",description:"\x3c!--",source:"@site/docs/29.0.1/operations/deep-storage-migration.md",sourceDirName:"operations",slug:"/operations/deep-storage-migration",permalink:"/docs/29.0.1/operations/deep-storage-migration",draft:!1,tags:[],version:"current",frontMatter:{id:"deep-storage-migration",title:"Deep storage migration"},sidebar:"docs",previous:{title:"pull-deps tool",permalink:"/docs/29.0.1/operations/pull-deps"},next:{title:"Export Metadata Tool",permalink:"/docs/29.0.1/operations/export-metadata"}},d={},c=[{value:"Shut down cluster services",id:"shut-down-cluster-services",level:2},{value:"Copy segments from old deep storage to new deep storage.",id:"copy-segments-from-old-deep-storage-to-new-deep-storage",level:2},{value:"Export segments with rewritten load specs",id:"export-segments-with-rewritten-load-specs",level:2},{value:"Import metadata",id:"import-metadata",level:3},{value:"Restart cluster",id:"restart-cluster",level:3}],m={toc:c},u="wrapper";function g(e){var t=e.components,r=(0,n.Z)(e,s);return(0,a.kt)(u,(0,o.Z)({},m,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"If you have been running an evaluation Druid cluster using local deep storage and wish to migrate to a\nmore production-capable deep storage system such as S3 or HDFS, this document describes the necessary steps."),(0,a.kt)("p",null,"Migration of deep storage involves the following steps at a high level:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Copying segments from local deep storage to the new deep storage"),(0,a.kt)("li",{parentName:"ul"},"Exporting Druid's segments table from metadata"),(0,a.kt)("li",{parentName:"ul"},"Rewriting the load specs in the exported segment data to reflect the new deep storage location"),(0,a.kt)("li",{parentName:"ul"},"Reimporting the edited segments into metadata")),(0,a.kt)("h2",{id:"shut-down-cluster-services"},"Shut down cluster services"),(0,a.kt)("p",null,"To ensure a clean migration, shut down the non-coordinator services to ensure that metadata state will not\nchange as you do the migration."),(0,a.kt)("p",null,"When migrating from Derby, the coordinator processes will still need to be up initially, as they host the Derby database."),(0,a.kt)("h2",{id:"copy-segments-from-old-deep-storage-to-new-deep-storage"},"Copy segments from old deep storage to new deep storage."),(0,a.kt)("p",null,"Before migrating, you will need to copy your old segments to the new deep storage."),(0,a.kt)("p",null,"For information on what path structure to use in the new deep storage, please see ",(0,a.kt)("a",{parentName:"p",href:"/docs/29.0.1/operations/export-metadata#deep-storage-migration"},"deep storage migration options"),"."),(0,a.kt)("h2",{id:"export-segments-with-rewritten-load-specs"},"Export segments with rewritten load specs"),(0,a.kt)("p",null,"Druid provides an ",(0,a.kt)("a",{parentName:"p",href:"/docs/29.0.1/operations/export-metadata"},"Export Metadata Tool")," for exporting metadata from Derby into CSV files\nwhich can then be reimported."),(0,a.kt)("p",null,"By setting ",(0,a.kt)("a",{parentName:"p",href:"/docs/29.0.1/operations/export-metadata#deep-storage-migration"},"deep storage migration options"),", the ",(0,a.kt)("inlineCode",{parentName:"p"},"export-metadata")," tool will export CSV files where the segment load specs have been rewritten to load from your new deep storage location."),(0,a.kt)("p",null,"Run the ",(0,a.kt)("inlineCode",{parentName:"p"},"export-metadata")," tool on your existing cluster, using the migration options appropriate for your new deep storage location, and save the CSV files it generates. After a successful export, you can shut down the coordinator."),(0,a.kt)("h3",{id:"import-metadata"},"Import metadata"),(0,a.kt)("p",null,"After generating the CSV exports with the modified segment data, you can reimport the contents of the Druid segments table from the generated CSVs."),(0,a.kt)("p",null,"Please refer to ",(0,a.kt)("a",{parentName:"p",href:"/docs/29.0.1/operations/export-metadata#importing-metadata"},"import commands")," for examples. Only the ",(0,a.kt)("inlineCode",{parentName:"p"},"druid_segments")," table needs to be imported."),(0,a.kt)("h3",{id:"restart-cluster"},"Restart cluster"),(0,a.kt)("p",null,"After importing the segment table successfully, you can now restart your cluster."))}g.isMDXComponent=!0}}]);