[ES]ElasticDump
개발/검색2015. 4. 23. 16:05
728x90
COMMAND ElasticDump INSTALL
git clone https://github.com/taskrabbit/elasticsearch-dump.git
NodeJS는 기본적으로 설치가 되어 있어야 한다.
COMMAND npm elasticdump
npm install elasticdump -g elasticdump
COMMAND ElasticDump EXE
./elasticdump --input=http://127.0.0.1:9200/idx_shop_autocomplete --out=data.json --type=data
추가적으로 메뉴얼에는 나와 있지 않지만 optimist 모듈이 없다는 Error 메시지가 나오는 경우
npm를 이용해서 설치를 하면 문제가 없이 해결이 된다.
SAMPLE
# Copy an index from production to staging with mappings: elasticdump \ --input=http://production.es.com:9200/my_index \ --output=http://staging.es.com:9200/my_index \ --type=mapping elasticdump \ --input=http://production.es.com:9200/my_index \ --output=http://staging.es.com:9200/my_index \ --type=data # Backup index data to a file: elasticdump \ --input=http://production.es.com:9200/my_index \ --output=/data/my_index_mapping.json \ --type=mapping elasticdump \ --input=http://production.es.com:9200/my_index \ --output=/data/my_index.json \ --type=data # Backup and index to a gzip using stdout: elasticdump \ --input=http://production.es.com:9200/my_index \ --output=$ \ | gzip > /data/my_index.json.gz # Backup ALL indices, then use Bulk API to populate another ES cluster: elasticdump \ --all=true \ --input=http://production-a.es.com:9200/ \ --output=/data/production.json elasticdump \ --bulk=true \ --input=/data/production.json \ --output=http://production-b.es.com:9200/ # Backup the results of a query to a file elasticdump \ --input=http://production.es.com:9200/my_index \ --output=query.json \ --searchBody '{"query":{"term":{"username": "admin"}}}'
728x90
댓글 영역