Skip to content

Simple java tool just to tranfer/copy/clone an elasticsearch index on different cluster using the REST endpoinds and migrating settings and mappings as well

Notifications You must be signed in to change notification settings

DaddyMoe/elasticsearch-index-cloner

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elasticsearch Index Cloner,

###Simple tool just to tranfer/copy/clone an elasticsearch index on different cluster using the REST endpoinds

Simple Java code to clone/replicate/copy an elasticsearch index accross different clusters, using the Scan/Scroll on the source index and Bulk upload on the destination cluster. The command are executed trought the REST endpoint (generally port 9200).

The settings and mappings by type are trasfered to the destination index (unless specified the option -keepDstIndex amd the destination index already present on the destination cluster). In case it's required an http autentication on the source or destination clusters, you can pass these as parameters.

Installation

To build the jar including all the dependencies run:

mvn clean compile assembly:single

That's the list of all the options:

Usage

java -jar IndexCloner-0.0.1-SNAPSHOT-jar-with-dependencies.jar -h

usage: Main

  • -srcHost source: host:port (e.g. localhost:9200)
  • -srcIndex source: index name
  • -srcUser source: user authentication
  • -srcPwd source: password authentication
  • -dstHost destination: host:port (e.g. localhost:9200)
  • -dstIndex destination: index name
  • -dstUser destination: user authentication
  • -dstPwd destination: password authentication
  • -keepDstIndex delete destination index if already existing

Example of usage:

java -jar IndexCloner-0.0.1-SNAPSHOT-jar-with-dependencies.jar \
 -srcHost localhost:9200 -srcIndex movies -srcUser user1 -srcPwd password1 \
 -dstHost SEARCH-DEV -dstIndex movies_copy -dstUser user2 -dstPwd password2 

About

Simple java tool just to tranfer/copy/clone an elasticsearch index on different cluster using the REST endpoinds and migrating settings and mappings as well

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%