elasticsearch/elasticsearch — pull request #8801 by dadoonet (2014-12-06 07:40:21+00:00)
Title: Allocation: add support for filtering by publish IP address

Allocation filtering by IP only works today using the node host address. But in some cases, you might want to filter using the publish/transport address which could be different.

For example, let say your nodes are like this:

```js
// First node
{
"host" : "es1.acme.com",
"transport_address" : "inet[/192.168.1.1:9300]",
"ip" : "127.0.0.1",
"http_address" : "inet[/192.168.1.1:9200]",
}
```

```js
// Second node
{
"host" : "es2.acme.com",
"transport_address" : "inet[/192.168.1.2:9300]",
"ip" : "127.0.0.1",
"http_address" : "inet[/192.168.1.2:9200]",
}
```

You can not filter using ip because it will the same on all hosts.
If we don't want to support it, we should change this PR by some documentation in http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules-allocation.html#index-modules-allocation to make sure people understand that only node `ip` is supported.

I'm not super familiar with this part of the code. @bleskes? Would you mind have a look and tell me what kind of test I could add and where I can find an example? Also, is it the right way for fixing that :)