$e = Elasticsearch->new( cxn_pool => 'Static::NoPing' nodes => [ 'search1:9200', 'search2:9200' ], );
The Static::NoPing connection pool (like the Static pool) should be used when your access to the cluster is limited. However, the Static
pool needs to be able to ping nodes in the cluster, with a HEAD /
request. If you can't ping your nodes, then you should use the Static::NoPing
connection pool instead.
Because the cluster cannot be pinged, this CxnPool cannot use a short ping request to determin whether nodes are live or not - it just has to send requests to the nodes to determine whether they are alive or not.
Most of the time, a dead node will cause the request to fail quickly. However, in situations where node failure takes time (eg malfunctioning routers or firewalls), a failure may not be reported until the request itself times out (see "request_timeout" in Elasticsearch::Cxn).
Failed nodes will be retried regularly to check if they have recovered.
This class does Elasticsearch::Role::CxnPool.
nodes
The list of nodes to use to serve requests. Can accept a single node, multiple nodes, and defaults to localhost:9200
if no nodes
are specified. See "node" in Elasticsearch::Role::Cxn::HTTP for details of the node specification.
next_cxn()
$cxn = $cxn_pool->next_cxn
Returns the next available node in round robin fashion - either a live node which has previously responded successfully, or a previously failed node which should be retried. If all nodes are dead, it will throw a NoNodes
error.