Search code examples
javarestelasticsearch-pluginelasticsearch-2.0elasticsearch-java-api

Completely stopping elasticsearch server and starting again, using java


I am working on Elastic search v-2.3.1. And i have added ReadOnlyRest plugin for Auth purpose.

To add users, i need to make changes in elasticsearch.yml, To add users in yml file i used snakeyaml from Java. successfully done.

Once the user is added to elasticsearch.yml, i need to stop and start the Elastic search server, so that new changes to yml file is read and Auth assigned to new users work.

I am able to do this manually, but i want to stop and start Elastic search from Java. if not Java API, rest will also work.

Please assist me.


Solution

  • There once was an API called _shutdown but it has been removed in 2.0.

    You should now use the provided start/stop scripts in order to manage your ES cluster.