The standard procedure to register a repository is to issue a PUT command
to the cluster.
I'd like to automatize the process, in a way such as a script can build a
search engine server and register a repository into it.
However, I can not trust the server be "ready and listening" immediately
after it's been started, so I'm afraid that if I issue the PUT command
right after starting the elasticsearch server, the server won't be ready
yet, and to repository is registered.
That's why I thought of specifying the repository in the elasticsearch
config file, but I haven't found any documentation regarding this.
Is this possible? or , at least, is there any signal or event I can listen
to to know when a elasticsearch server is "ready"?
On Friday, July 4, 2014 at 10:09:39 AM UTC-6, JoeZ99 wrote:
The standard procedure to register a repository is to issue a PUT command
to the cluster.
I'd like to automatize the process, in a way such as a script can build a
search engine server and register a repository into it.
However, I can not trust the server be "ready and listening" immediately
after it's been started, so I'm afraid that if I issue the PUT command
right after starting the elasticsearch server, the server won't be ready
yet, and to repository is registered.
That's why I thought of specifying the repository in the elasticsearch
config file, but I haven't found any documentation regarding this.
Is this possible? or , at least, is there any signal or event I can listen
to to know when a elasticsearch server is "ready"?
To determine when the cluster is ready, you can use the cluster health API
(http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html)
along with the wait_for_status and wait_for_nodes parameters, that way
you can wait for the cluster to be green with N nodes (however many are in
your cluster). After that returns successfully, you should be able to issue
the PUT command to register the repository.
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.