Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add simple sniffer for simple proxy/lb cases
When going through a proxy or load balancer to Elasticsearch, do not try to use the _nodes discovery mechanism - instead, just assume the given host(s) are the only hostnames to use. This is useful e.g. in the case of Kubernetes going through an Elasticsearch Service, where you want to periodically reconnect the long-lived http connections to evenly spread the load throughout the cluster.
- Loading branch information
Showing
4 changed files
with
67 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require 'elasticsearch' | ||
|
||
class Fluent::ElasticsearchSimpleSniffer < Elasticsearch::Transport::Transport::Sniffer | ||
|
||
def hosts | ||
@transport.logger.debug "In Fluent::ElasticsearchSimpleSniffer hosts #{@transport.hosts}" if @transport.logger | ||
@transport.hosts | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters