1Search::Elasticsearch::UCsxenrPoCooln:t:rSinbiuftfe(d3S)PeearrlchD:o:cEulmaesnttiactsieoanrch::CxnPool::Sniff(3)
2
3
4
6 Search::Elasticsearch::CxnPool::Sniff - A CxnPool for connecting to a
7 local cluster with a dynamic node list
8
10 version 8.00
11
13 $e = Search::Elasticsearch->new(
14 cxn_pool => 'Sniff',
15 nodes => [
16 'search1:9200',
17 'search2:9200'
18 ],
19 );
20
22 The Sniff connection pool should be used when you do have direct access
23 to the Elasticsearch cluster, eg when your web servers and
24 Elasticsearch servers are on the same network. The nodes that you
25 specify are used to discover the cluster, which is then sniffed to find
26 the current list of live nodes that the cluster knows about.
27
28 This sniff process is repeated regularly, or whenever a node fails, to
29 update the list of healthy nodes. So if you add more nodes to your
30 cluster, they will be auto-discovered during a sniff.
31
32 If all sniffed nodes fail, then it falls back to sniffing the original
33 seed nodes that you specified in new().
34
35 For HTTP Cxn classes, this module will also dynamically detect the
36 "max_content_length" which the nodes in the cluster will accept.
37
38 This class does Search::Elasticsearch::Role::CxnPool::Sniff and
39 Search::Elasticsearch::Role::Is_Sync.
40
42 "nodes"
43 The list of nodes to use to discover the cluster. Can accept a single
44 node, multiple nodes, and defaults to "localhost:9200" if no "nodes"
45 are specified. See "node" in Search::Elasticsearch::Role::Cxn for
46 details of the node specification.
47
48 See also
49 • "request_timeout" in Search::Elasticsearch::Role::Cxn
50
51 • "sniff_timeout" in Search::Elasticsearch::Role::Cxn
52
53 • "sniff_request_timeout" in Search::Elasticsearch::Role::Cxn
54
55 Inherited configuration
56 From Search::Elasticsearch::Role::CxnPool::Sniff
57
58 • sniff_interval
59
60 • sniff_max_content_length
61
62 From Search::Elasticsearch::Role::CxnPool
63
64 • randomize_cxns
65
67 next_cxn()
68 $cxn = $cxn_pool->next_cxn
69
70 Returns the next available live node (in round robin fashion), or
71 throws a "NoNodes" error if no nodes can be sniffed from the cluster.
72
73 schedule_check()
74 $cxn_pool->schedule_check
75
76 Forces a sniff before the next Cxn is returned, to updated the list of
77 healthy nodes in the cluster.
78
79 sniff()
80 $bool = $cxn_pool->sniff
81
82 Sniffs the cluster and returns "true" if the sniff was successful.
83
84 Inherited methods
85 From Search::Elasticsearch::Role::CxnPool::Sniff
86
87 • schedule_check()
88
89 • parse_sniff()
90
91 • should_accept_node()
92
93 From Search::Elasticsearch::Role::CxnPool
94
95 • cxn_factory()
96
97 • logger()
98
99 • serializer()
100
101 • current_cxn_num()
102
103 • cxns()
104
105 • seed_nodes()
106
107 • next_cxn_num()
108
109 • set_cxns()
110
111 • request_ok()
112
113 • request_failed()
114
115 • should_retry()
116
117 • should_mark_dead()
118
119 • cxns_str()
120
121 • cxns_seeds_str()
122
123 • retries()
124
125 • reset_retries()
126
128 Enrico Zimuel <enrico.zimuel@elastic.co>
129
131 This software is Copyright (c) 2022 by Elasticsearch BV.
132
133 This is free software, licensed under:
134
135 The Apache License, Version 2.0, January 2004
136
137
138
139perl v5.38.0 2023-S0e7a-r2c1h::Elasticsearch::CxnPool::Sniff(3)