# GET /\_all/\_aliases always redirects to the master

**URL:** <https://discuss.elastic.co/t/get--all--aliases-always-redirects-to-the-master/12715>\
**Category:** Elasticsearch\
**Created:** [July 9, 2013, 11:53am UTC](https://discuss.elastic.co/t/get--all--aliases-always-redirects-to-the-master/12715 "2013-07-09T11:53:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc\_Goosen](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@Marc\_Goosen](https://discuss.elastic.co/u/Marc_Goosen)\
**Post date:** [July 9, 2013, 11:53am UTC](https://discuss.elastic.co/t/get--all--aliases-always-redirects-to-the-master/12715/1 "2013-07-09T11:53:59Z")

</div>

In the documentation:  
[http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/](http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/)

It says:  
The get index alias api (Available since 0.90.1) allows to filter by alias  
name and index name. _This api redirects to the master_ and fetches the  
requested index aliases, if available. This api only serialises the found  
index aliases.

I have a cluster 3 ES instances, 2 workers and 1 master (which has no data).  
For every search I first need to know which aliases map to which indices.  
So I call te REST \_aliases endpoint.

However this always get redirect to the master, which I don't want all this  
traffic on.

So my question is:  
Is there a way to get /\_all/\_aliases/ from one of the worker nodes?

Regards  
Marc

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Boaz\_Leskes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/boaz_leskes/32/723_2.png) [@Boaz\_Leskes](https://discuss.elastic.co/u/Boaz_Leskes)\
**Post date:** [July 9, 2013, 2:12pm UTC](https://discuss.elastic.co/t/get--all--aliases-always-redirects-to-the-master/12715/2 "2013-07-09T14:12:04Z")

</div>

Hi Marc,

Sadly no way right now. You could use the cluster state api to get that  
info (it's under the metadata block) and support local=true for debugging  
purposes:

curl -XGET  
"[http://localhost:9200/\_cluster/state?filter\_nodes=true&filter\_routing\_table=true&filter\_blocks=true&local=true](http://localhost:9200/_cluster/state?filter_nodes=true&filter_routing_table=true&filter_blocks=true&local=true)"

I'm curious as to you why you are concerned about the load. The get aliases  
api is very light weight (unless you have a LOT of aliases). When calling  
the master you are guarantied to get an up-to-date answer (at the price of  
parallelism indeed). The rational was that these type of calls are  
infrequent and administrative in nature.

Cheers,  
Boaz

On Tuesday, July 9, 2013 1:53:59 PM UTC+2, Marc Goosen wrote:

> In the documentation:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/)
> 
> It says:  
> The get index alias api (Available since 0.90.1) allows to filter by  
> alias name and index name. _This api redirects to the master_ and fetches  
> the requested index aliases, if available. This api only serialises the  
> found index aliases.
> 
> I have a cluster 3 ES instances, 2 workers and 1 master (which has no  
> data).  
> For every search I first need to know which aliases map to which indices.  
> So I call te REST \_aliases endpoint.
> 
> However this always get redirect to the master, which I don't want all  
> this traffic on.
> 
> So my question is:  
> Is there a way to get /\_all/\_aliases/ from one of the worker nodes?
> 
> Regards  
> Marc

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![javanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javanna/32/4698_2.png) [@javanna](https://discuss.elastic.co/u/javanna)\
**Post date:** [July 17, 2013, 11:24am UTC](https://discuss.elastic.co/t/get--all--aliases-always-redirects-to-the-master/12715/3 "2013-07-17T11:24:51Z")

</div>

Hi Marc,  
I opened an issue[https://github.com/elasticsearch/elasticsearch/issues/3345](https://github.com/elasticsearch/elasticsearch/issues/3345)about adding the local flag to all the operations that get executed on the  
master node (where it is currently missing). Once that's fixed you'll be  
able to use the local flag in the get index alias api too in order to force  
the local execution, something that's now possible with the cluster state  
api like Boaz mentioned but not with the get index alias api.

Cheers  
Luca

On Tuesday, July 9, 2013 4:12:04 PM UTC+2, Boaz Leskes wrote:

> Hi Marc,
> 
> Sadly no way right now. You could use the cluster state api to get that  
> info (it's under the metadata block) and support local=true for debugging  
> purposes:
> 
> curl -XGET "  
> [http://localhost:9200/\_cluster/state?filter\_nodes=true&filter\_routing\_table=true&filter\_blocks=true&local=true](http://localhost:9200/_cluster/state?filter_nodes=true&filter_routing_table=true&filter_blocks=true&local=true)  
> "
> 
> I'm curious as to you why you are concerned about the load. The get  
> aliases api is very light weight (unless you have a LOT of aliases). When  
> calling the master you are guarantied to get an up-to-date answer (at the  
> price of parallelism indeed). The rational was that these type of calls are  
> infrequent and administrative in nature.
> 
> Cheers,  
> Boaz
> 
> On Tuesday, July 9, 2013 1:53:59 PM UTC+2, Marc Goosen wrote:
> 
> > In the documentation:  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases/)
> > 
> > It says:  
> > The get index alias api (Available since 0.90.1) allows to filter by  
> > alias name and index name. _This api redirects to the master_ and  
> > fetches the requested index aliases, if available. This api only serialises  
> > the found index aliases.
> > 
> > I have a cluster 3 ES instances, 2 workers and 1 master (which has no  
> > data).  
> > For every search I first need to know which aliases map to which indices.  
> > So I call te REST \_aliases endpoint.
> > 
> > However this always get redirect to the master, which I don't want all  
> > this traffic on.
> > 
> > So my question is:  
> > Is there a way to get /\_all/\_aliases/ from one of the worker nodes?
> > 
> > Regards  
> > Marc

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:25am UTC](https://discuss.elastic.co/t/get--all--aliases-always-redirects-to-the-master/12715/4 "2017-07-06T02:25:59Z")

</div>

Closed on July 6, 2017, 2:25am UTC


