logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Search::Elasticsearch::CxnPool::Static - A CxnPool for connecting to a remote cluster with a static list

Author

       Enrico Zimuel <enrico.zimuel@elastic.co>

Configuration

"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 Search::Elasticsearch::Role::Cxn for details
       of the node specification.

   Seealso
       •   "request_timeout" in Search::Elasticsearch::Role::Cxn

       •   "ping_timeout" in Search::Elasticsearch::Role::Cxn

       •   "dead_timeout" in Search::Elasticsearch::Role::Cxn

       •   "max_dead_timeout" in Search::Elasticsearch::Role::Cxn

   Inheritedconfiguration
       From Search::Elasticsearch::Role::CxnPool

       •   randomize_cxns

Description

       The Static connection pool, which is the default, should be used when you don't have direct access to the
       Elasticsearch cluster, eg when you are accessing the cluster through a proxy.  It round-robins through
       the nodes that you specified, and pings each node before it is used for  the first time, to ensure that
       it is responding.

       If any node fails, then all nodes are pinged before the next request to ensure that they are still alive
       and responding.  Failed nodes will be pinged regularly to check if they have recovered.

       This class does Search::Elasticsearch::Role::CxnPool::Static and Search::Elasticsearch::Role::Is_Sync.

Methods

next_cxn()
           $cxn = $cxn_pool->next_cxn

       Returns  the  next  available live node (in round robin fashion), or throws a "NoNodes" error if no nodes
       respond to ping requests.

   Inheritedmethods
       From Search::Elasticsearch::Role::CxnPool::Static

       •   schedule_check()

       From Search::Elasticsearch::Role::CxnPool

       •   cxn_factory()logger()serializer()current_cxn_num()cxns()seed_nodes()next_cxn_num()set_cxns()request_ok()request_failed()should_retry()should_mark_dead()cxns_str()cxns_seeds_str()retries()reset_retries()

Name

       Search::Elasticsearch::CxnPool::Static - A CxnPool for connecting to a remote cluster with a static list
       of nodes.

Synopsis

           $e = Search::Elasticsearch->new(
               cxn_pool => 'Static'     # default
               nodes    => [
                   'search1:9200',
                   'search2:9200'
               ],
           );

Version

       version 8.12

See Also