Skip to content

Using publish_host with host/domain name instead of IP address does not work with connection pools #1808

@joelse

Description

@joelse

Elasticsearch: 2.1.1
Elasticsearch.NET/NEST: 2.0.0-rc1

Configuring the cluster to use a host/domain name for the http.publish_host setting (useful for reverse proxies) does not work with connection pools. It seems that Elasticsearch itself tries to resolve the value of the setting into an IP address and stores both the name and the address as a publish_address. Querying a cluster set up like this with, e.g., /_nodes, shows that the http_address field has a value like this, for example:

<FQDN>/<IP>:<port>

When using a sniffing connection pool, and once a sniff has been completed, the pool will be reseeded with nodes using the above as the base URL. This means that subsequent calls have the following form:

<http(s)>://<FQDN>/<IP>:<port>/rest/of/url/in/request (with port 80 used implicitly for HTTP requests)

Before trying this, I would have expected the following:

<http(s)>://<FQDN>:<port>/rest/of/url/in/request

Where FQDN would be the value configured for http.publish_host and port the value configured for http.publish_port.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions