{"id":580,"date":"2018-10-23T13:52:33","date_gmt":"2018-10-23T04:52:33","guid":{"rendered":"https:\/\/dong1lkim.oboki.net\/?p=580"},"modified":"2019-09-01T22:20:24","modified_gmt":"2019-09-01T13:20:24","slug":"elasticsearch-elasticdump","status":"publish","type":"post","link":"https:\/\/oboki.net\/workspace\/data-engineering\/elasticsearch\/elasticsearch-elasticdump\/","title":{"rendered":"[ElasticSearch] elasticdump"},"content":{"rendered":"<h1>elasticdump<\/h1>\n<p>elasticsearch\uc5d0 \uc800\uc7a5\ub3fc \uc788\ub294 indice \ub370\uc774\ud130\ub97c json \ud30c\uc77c\ub85c \ub0b4\ub824\ubc1b\uac70\ub098 \ub2e4\ub978 elasticsearch cluster\uc5d0 indexing \ud560 \uc218 \uc788\ub294 \uc720\ud2f8\ub85c\uc11c<\/p>\n<p><a href=\"https:\/\/github.com\/taskrabbit\/elasticsearch-dump\"><a href=\"https:\/\/github.com\/taskrabbit\/elasticsearch-dump\">https:\/\/github.com\/taskrabbit\/elasticsearch-dump<\/a><\/a> \uc5d0\uc11c project \uad00\ub9ac\ub97c \ud558\uace0 \uc788\uace0 \ub2e4\uc6b4\ub85c\ub4dc \ubc0f \uac00\uc774\ub4dc \ud655\uc778\uc774 \uac00\ub2a5\ud558\ub2e4.<\/p>\n<h2>\uc124\uce58<\/h2>\n<h3>\uc758\uc874\uc131<\/h3>\n<p>node.js \uc5b4\ud50c\ub9ac\ucf00\uc774\uc158\uc73c\ub85c \uc791\uc131\ub3fc \uc788\uc5b4 node \ud544\uc694.<\/p>\n<h3>\uc124\uce58 \uc21c\uc11c<\/h3>\n<h4>1. source \ub2e4\uc6b4\ub85c\ub4dc \ubc0f \uc555\ucd95\ud574\uc81c<\/h4>\n<pre><code class=\"language-bash\">wget https:\/\/github.com\/taskrabbit\/elasticsearch-dump\/archive\/master.zip\nunzip master.zip<\/code><\/pre>\n<h4>2. npm install<\/h4>\n<pre><code class=\"language-bash\">cd elasticsearch-dump-master\nnpm install\nexport PATH=$PATH:$PWD\/bin<\/code><\/pre>\n<h2>\uc0ac\uc6a9\ubc95<\/h2>\n<h3>Backup index data to a file<\/h3>\n<pre><code class=\"language-bash\">elasticdump \\\n  --input=http:\/\/production.es.com:9200\/my_index \\\n  --output=\/data\/my_index_mapping.json \\\n  --type=mapping\nelasticdump \\\n  --input=http:\/\/production.es.com:9200\/my_index \\\n  --output=\/data\/my_index.json \\\n  --type=data<\/code><\/pre>\n<h3>Importing a JSON file into Elasticsearch<\/h3>\n<pre><code class=\"language-bash\">elasticdump \\\n  --bulk=true \\\n  --input=&quot;dumped.json&quot; \\\n  --output=http:\/\/localhost:9200<\/code><\/pre>\n<p>mapping, analyzer, data \ubcc4\ub85c \uac01\uac01 \uc218\ud589\ud574\uc900\ub2e4.<\/p>\n<h3>Copy an index from production to staging with analyzer and mapping<\/h3>\n<pre><code class=\"language-bash\">elasticdump \\\n  --input=http:\/\/production.es.com:9200\/my_index \\\n  --output=http:\/\/staging.es.com:9200\/my_index \\\n  --type=analyzer\nelasticdump \\\n  --input=http:\/\/production.es.com:9200\/my_index \\\n  --output=http:\/\/staging.es.com:9200\/my_index \\\n  --type=mapping\nelasticdump \\\n  --input=http:\/\/production.es.com:9200\/my_index \\\n  --output=http:\/\/staging.es.com:9200\/my_index \\\n  --type=data<\/code><\/pre>\n<p>\ucd94\uac00\uc801\uc778 \uc6a9\ubc95\uc740 github \uc5d0\uc11c \ud655\uc778.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>elasticdump elasticsearch\uc5d0 \uc800\uc7a5\ub3fc \uc788\ub294 indice \ub370\uc774\ud130\ub97c json \ud30c\uc77c\ub85c \ub0b4\ub824\ubc1b\uac70\ub098 \ub2e4\ub978 elasticsearch cluster\uc5d0 indexing \ud560 \uc218 \uc788\ub294 \uc720\ud2f8\ub85c\uc11c https:\/\/github.com\/taskrabbit\/elasticsearch-dump \uc5d0\uc11c project \uad00\ub9ac\ub97c \ud558\uace0 \uc788\uace0 \ub2e4\uc6b4\ub85c\ub4dc \ubc0f \uac00\uc774\ub4dc \ud655\uc778\uc774 \uac00\ub2a5\ud558\ub2e4. \uc124\uce58 \uc758\uc874\uc131 node.js \uc5b4\ud50c\ub9ac\ucf00\uc774\uc158\uc73c\ub85c \uc791\uc131\ub3fc \uc788\uc5b4 node \ud544\uc694. \uc124\uce58 \uc21c\uc11c 1. source \ub2e4\uc6b4\ub85c\ub4dc \ubc0f \uc555\ucd95\ud574\uc81c wget https:\/\/github.com\/taskrabbit\/elasticsearch-dump\/archive\/master.zip unzip master.zip 2. npm install cd elasticsearch-dump-master npm install export [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[136,25],"class_list":["post-580","post","type-post","status-publish","format-standard","hentry","category-elasticsearch","tag-backup","tag-elasticsearch"],"_links":{"self":[{"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/posts\/580","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/comments?post=580"}],"version-history":[{"count":5,"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/posts\/580\/revisions"}],"predecessor-version":[{"id":1203,"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/posts\/580\/revisions\/1203"}],"wp:attachment":[{"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/media?parent=580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/categories?post=580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/tags?post=580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}