[Bug 44025] New: Elasticsearch: use all addresses of a single <server> host name as nodes, so the client can fail over
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44025 Bug ID: 44025 Summary: Elasticsearch: use all addresses of a single <server> host name as nodes, so the client can fail over Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Searching - Elasticsearch Assignee: koha-bugs@lists.koha-community.org Reporter: johan@imcode.com QA Contact: testopia@bugs.koha-community.org Target Milestone: --- A site normally has a single <server> in koha-conf.xml, for example https://user:pass@elastic.example.com:9200. When that name resolves to several addresses (DNS round robin for the nodes of a cluster), Search::Elasticsearch still gets one node. Requests are not spread over the nodes, and there is nothing to fail over to when that node hangs, is slow or answers with errors. The only fallback is in the socket layer, which tries the next address only when the TCP connect itself fails. When the configuration has exactly one <server> and its host name resolves to several IPv4 addresses, get_elasticsearch_params now returns one node per address, with user, password, scheme and port kept. For https, ssl_options SSL_verifycn_name and SSL_hostname are set to the original name, so the certificate is still verified against the name and not the address (giving the client the addresses directly fails certificate verification). Left unchanged: several <server> entries, an IP address, a name that resolves to one address, a failed lookup. Installations without a name that has several addresses are not affected. The addresses are resolved when the client is created, so a long running process needs a restart to see changes in the DNS. The patch adds t/Koha/SearchEngine/Elasticsearch/DnsNodes.t (no Elasticsearch or database needed). Failing over from a failed node to the next one needs bug 44022: without it the first failed request makes the process reject every healthy response. We have run this on 26.05 against a three node cluster behind one name, blocking one or two nodes for the indexer while it indexed: the jobs finished using the remaining node. I have made this as it was the behavior I expected when I configured elastic search for the first time in Koha. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44025 Johan Larsson <johan@imcode.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |44022 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44022 [Bug 44022] Elasticsearch: product check workaround is never restored, one failed request breaks the client for the rest of the process -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44025 --- Comment #1 from Johan Larsson <johan@imcode.com> --- Created attachment 210829 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210829&action=edit Bug 44025: Use all addresses of a single Elasticsearch server name as nodes A site normally has one <server> in koha-conf.xml, for example https://user:pass@elastic.example.com:9200. When that name resolves to several addresses (DNS round robin for the nodes of a cluster), Search::Elasticsearch still gets a single node. There is nothing to spread the requests over, and nothing to fail over to when that node is slow, hangs or answers with errors. When the configuration has exactly one <server> and its host name resolves to several IPv4 addresses, get_elasticsearch_params now returns one node per address, with user, password, scheme and port kept. For https ssl_options SSL_verifycn_name and SSL_hostname are set to the original name, so the certificate is still verified against the name. Left unchanged: several <server> entries, an IP address, a name that resolves to one address, a failed lookup. Installations that do not have a name with several addresses are not affected. The addresses are resolved when the client is created, so a long running process needs a restart to see changes in the DNS. Test plan: 1. prove t/Koha/SearchEngine/Elasticsearch/DnsNodes.t 2. Optional: make a name resolve to the address of your Elasticsearch and to a second address nobody listens on, for example in /etc/hosts: 127.0.0.1 multi-es <ES address> multi-es Set <server>multi-es:9200</server> in koha-conf.xml and check that Koha::SearchEngine::Elasticsearch->get_elasticsearch_params returns both addresses as nodes. Failing over from the dead address to the live one needs the patch of bug 44022. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44025 Johan Larsson <johan@imcode.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44025 Johan Larsson <johan@imcode.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |johan@imcode.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org