A set of scripts to compare indices, aliases and mappings between two elasticsearch clusters.
Create config files for the clusters you want to compare.
Cluster 1
# ./config/dev.config
URL="https://dev.domain.com:9200"
TOKEN="dXNlcm5hbWU6cGFzc3dvcmQK"
# TOKEN is the base64 encoded version of 'username:password'
# To encode this:
# - create a file called 'token'
# - add one line in the file containing the credentials:
# username:password
# - run: `base64 -i token`
Cluster 2
# ./config/qa.config
URL="https://qa.domain.com:9200"
TOKEN="dXNlcm5hbWU6cGFzc3dvcmQK"./get_es_stats.sh devGetting Elasticsearch statistics for dev (https://dev.domain.com:9200)
Getting indices.
Getting aliases.
Getting mappings.
index1
index2
index3
Done../get_es_stats.sh qaGetting Elasticsearch statistics for dev (https://qa.domain.com:9200)
Getting indices.
Getting aliases.
Getting mappings.
index1
index2
index3
Done../es_diff.sh dev qaTo run these scripts on Windows
- Download and install git for Windows: https://gitforwindows.org/
- Download jq: https://github.com/stedolan/jq/releases/download/jq-1.6/jq-win64.exe
- rename to jq.exe
- save a copy to C:\Program Files\Git\usr\bin