public interface DiscoveryPlugin
Plugin
s that extends Elasticsearch's discovery functionality. To add an additional
NetworkService.CustomNameResolver
just implement the interface and implement the getCustomNameResolver(Settings)
method:
public class MyDiscoveryPlugin extends Plugin implements DiscoveryPlugin {
@Override
public NetworkService.CustomNameResolver getCustomNameResolver(Settings settings) {
return new YourCustomNameResolverInstance(settings);
}
}
Modifier and Type | Method and Description |
---|---|
default NetworkService.CustomNameResolver |
getCustomNameResolver(Settings settings)
Override to add additional
NetworkService.CustomNameResolver s. |
default NetworkService.CustomNameResolver getCustomNameResolver(Settings settings)
NetworkService.CustomNameResolver
s.
This can be handy if you want to provide your own Network interface name like _mycard_
and implement by yourself the logic to get an actual IP address/hostname based on this
name.
For example: you could call a third party service (an API) to resolve _mycard_.
Then you could define in elasticsearch.yml settings like:
network.host: _mycard_