# Can I specify a repository in the configuration file?

**URL:** <https://discuss.elastic.co/t/can-i-specify-a-repository-in-the-configuration-file/18481>\
**Category:** Elasticsearch\
**Created:** [July 4, 2014, 4:09pm UTC](https://discuss.elastic.co/t/can-i-specify-a-repository-in-the-configuration-file/18481 "2014-07-04T16:09:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon44344346](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@anon44344346](https://discuss.elastic.co/u/anon44344346)\
**Post date:** [July 4, 2014, 4:09pm UTC](https://discuss.elastic.co/t/can-i-specify-a-repository-in-the-configuration-file/18481/1 "2014-07-04T16:09:39Z")

</div>

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"?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3733f7f1-1272-4ed0-9484-f4d85a8b6e90%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3733f7f1-1272-4ed0-9484-f4d85a8b6e90%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)\
**Post date:** [April 17, 2015, 2:58pm UTC](https://discuss.elastic.co/t/can-i-specify-a-repository-in-the-configuration-file/18481/2 "2015-04-17T14:58:12Z")

</div>

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](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.

;; Lee

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8daf638a-b500-4c9e-831f-024896281f08%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8daf638a-b500-4c9e-831f-024896281f08%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:19am UTC](https://discuss.elastic.co/t/can-i-specify-a-repository-in-the-configuration-file/18481/3 "2017-07-06T00:19:01Z")

</div>

Closed on July 6, 2017, 12:19am UTC


