0

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.

umar faraz
  • 371
  • 5
  • 18

1 Answers1

1

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.

Val
  • 207,596
  • 13
  • 358
  • 360
  • Actually i found out a way, I downloaded the ".deb" pack (Debian) of elastic search v-2.3.1. I can start the elasticsearch service with the below command. "sudo /etc/init.d/elasticsearch start" Stop elasticsearch elasticsearch with the below command. "sudo /etc/init.d/elasticsearch stop" Made a shell script for this commands. and called from Java. Its working fine. There might be a better way but this way i was able to complete my requirement. – umar faraz May 25 '16 at 07:35
  • Yes, that's what start/stop scripts are for :) – Val May 25 '16 at 07:35