28 Jul 2022 11:42:27 UTC
- Distribution: Search-Elasticsearch
- Module version: 7.717
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (349 / 3 / 0)
- KwaliteeBus factor: 1
- 67.63% Coverage
- License: apache_2_0
- Activity24 month
- Download (129.95KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- Reverse dependencies
- CPAN Testers List
- Dependency graph
- COPYRIGHT AND LICENSE
Search::Elasticsearch::CxnPool::Sniff - A CxnPool for connecting to a local cluster with a dynamic node list
$e = Search::Elasticsearch->new( cxn_pool => 'Sniff', nodes => [ 'search1:9200', 'search2:9200' ], );
The Sniff connection pool should be used when you do have direct access to the Elasticsearch cluster, eg when your web servers and Elasticsearch servers are on the same network. The nodes that you specify are used to discover the cluster, which is then sniffed to find the current list of live nodes that the cluster knows about.
This sniff process is repeated regularly, or whenever a node fails, to update the list of healthy nodes. So if you add more nodes to your cluster, they will be auto-discovered during a sniff.
If all sniffed nodes fail, then it falls back to sniffing the original seed nodes that you specified in
For HTTP Cxn classes, this module will also dynamically detect the
max_content_lengthwhich the nodes in the cluster will accept.
The list of nodes to use to discover the cluster. Can accept a single node, multiple nodes, and defaults to
nodesare specified. See "node" in Search::Elasticsearch::Role::Cxn for details of the node specification.
$cxn = $cxn_pool->next_cxn
Returns the next available live node (in round robin fashion), or throws a
NoNodeserror if no nodes can be sniffed from the cluster.
Forces a sniff before the next Cxn is returned, to updated the list of healthy nodes in the cluster.
$bool = $cxn_pool->sniff
Sniffs the cluster and returns
trueif the sniff was successful.
Enrico Zimuel <firstname.lastname@example.org>
This software is Copyright (c) 2022 by Elasticsearch BV.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
Module Install Instructions
To install Search::Elasticsearch, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Search::Elasticsearch
For more information on module installation, please visit the detailed CPAN module installation guide.