I need to develop an es automation tool.
Our company's es cluster has multiple versions.
I found that many clients require the corresponding ES version.
Currently I can only think of Java indirectly using the curl and http tools to operate the ES.
Such as "curl -XGET http://localhost:9200/_snapshot/test_backup/_all?pretty".
Automated tools designed in this way can operate all versions of ES.
I hope some experts can help me and provide some suggestions. Thank you.
I don't use Java but Python and we have a similar case, so maybe my solution can also apply to your case. In my company we have different version of elastic [2, 5, 6] and for that we installed the different versions of the elastic library making call for the specific connection with the related elastic lib.
The syntax in library don't change so much between version so it will have a small impact on your code.
As I understand my case is different as I already know the endpoint and the version so I don't need to guess. For example 172.16.10.x is version 2.x and it will not change, at least this year.
If you don't know which version is running as far as I know the GET 123.0.0.1:9200/ always return the version of elastic. This one didn't change from version 0.x You can get it from here and load the correct lib version.
In python you can prefix your import and install in different directory so it make very easy to have different versions of a library. For Java it's maybe more hard.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.