1Search::Elasticsearch::URsoelre:C:oCnxtnrPiSobeoualtr:ec:dhS:nP:ieEfrlfla(s3Dt)oiccusmeeanrtcaht:i:oRnole::CxnPool::Sniff(3)
2
3
4
6 Search::Elasticsearch::Role::CxnPool::Sniff - A CxnPool role for
7 connecting to a local cluster with a dynamic node list
8
10 version 8.00
11
13 "sniff_interval"
14 How often should we perform a sniff in order to detect whether new
15 nodes have been added to the cluster. Defaults to `300` seconds.
16
17 "sniff_max_content_length"
18 Whether we should set the max_content_length dynamically while
19 sniffing. Defaults to true unless a fixed "max_content_length" was
20 specified.
21
23 schedule_check()
24 $cxn_pool->schedule_check
25
26 Schedules a sniff before the next request is processed.
27
28 parse_sniff()
29 $bool = $cxn_pool->parse_sniff(\%nodes);
30
31 Parses the response from a sniff request and extracts the hostname/ip
32 of all listed nodes, filtered through "should_accept_node()". If any
33 live nodes are found, they are passed to "set_cxns()" in
34 Search::Elasticsearch::Role::CxnPool. The max_content_length is also
35 detected if "sniff_max_content_length" is true.
36
37 should_accept_node()
38 $host = $cxn_pool->should_accept_node($host,$node_id,\%node_data)
39
40 This method serves as a hook which can be overridden by the user. When
41 a sniff is performed, this method is called with the "host" (eg
42 "192.168.5.100:9200"), the "node_id" (the ID assigned to the node by
43 Elasticsearch) and the "node_data" which contains the information about
44 the node that Elasticsearch has returned, eg:
45
46 {
47 "transport_address" => "inet[192.168.5.100/192.168.5.100:9300]",
48 "http" : {
49 "publish_address" => "inet[/192.168.5.100:9200]",
50 "max_content_length" => "100mb",
51 "bound_address" => "inet[/0:0:0:0:0:0:0:0:9200]",
52 "max_content_length_in_bytes" : 104857600
53 },
54 "version" => "0.90.4",
55 "name" => "Silver Sable",
56 "hostname" => "search1.domain.com",
57 "http_address" => "inet[/192.168.5.100:9200]"
58 }
59
60 If the node should be accepted (ie used to serve data), then it should
61 return the "host" value to use. By default, nodes are always accepted.
62
64 Enrico Zimuel <enrico.zimuel@elastic.co>
65
67 This software is Copyright (c) 2022 by Elasticsearch BV.
68
69 This is free software, licensed under:
70
71 The Apache License, Version 2.0, January 2004
72
73
74
75perl v5.36.0 Se2a0r2c3h-:0:1E-l2a0sticsearch::Role::CxnPool::Sniff(3)