Relevant configuration block in $KOHA_CONF: <elasticsearch> <server>elasticsearch5</server> <index_name>koha_master</index_name> </elasticsearch> % misc/search_tools/rebuild_elastic_search.pl -v Indexing biblios [Cxn] ** [http://127.0.0.1:9200]-[599] Could not connect to '127.0.0.1:9200': Connection refused, called from sub Search::Elasticsearch::Role::Client::Direct::__ANON__ at /home/koha/env/master/src/Koha/SearchEngine/Elasticsearch/Indexer.pm line 382. With vars: {'status_code' => 599,'request' => {'serialize' => 'std','method' => 'HEAD','qs' => {},'path' => '/koha_master_biblios','ignore' => [],'body' => undef}} It looks like it is related to the 'Sniff' CxnPool. When I remove this line https://gitlab.com/koha-community/Koha/blob/7e218b81e6f7e4cf8bb8be3aef547cd1c1aac573/Koha/SearchEngine/Elasticsearch.pm#L146 everything works as expected
Okay, so I re-read https://wiki.koha-community.org/wiki/Elasticsearch and it's clear that the problem comes from the Sniff CxnPool, I changed $KOHA_CONF to use the Static CxnPool, and it works. Shouldn't we use Static as the default CxnPool ?
Could this be related to Bug 21974? Just going by keywords :)
(In reply to Katrin Fischer from comment #2) > Could this be related to Bug 21974? Just going by keywords :) That is totally related. I'm just complaining about the default value of cxn_pool :) Sniff (Koha's default) works only with a local ES, while Static (Search::Elasticsearch's default) works in most cases.
Created attachment 89781 [details] [review] Bug 22705: Change default value of cxn_pool to 'Static' 'Static' is the default value of Search::Elasticsearch and for a good reason : it works in most cases, unlike the 'Sniff' option
Created attachment 89897 [details] [review] Bug 22705: Change default value of cxn_pool to 'Static' 'Static' is the default value of Search::Elasticsearch and for a good reason : it works in most cases, unlike the 'Sniff' option To test: 1 - Apply patch 2 - Edit koha-conf.xml 3 - Add '<cxn_pool>Static</cxn_pool>' to the elasticsearch stanza 4 - Restart all the things! 5 - Reindex ES, it works 6 - Set SearchEngine to ES, try searching 7 - It works! Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 90033 [details] [review] Bug 22705: Change default value of cxn_pool to 'Static' 'Static' is the default value of Search::Elasticsearch and for a good reason : it works in most cases, unlike the 'Sniff' option To test: 1 - Apply patch 2 - Edit koha-conf.xml 3 - Add '<cxn_pool>Static</cxn_pool>' to the elasticsearch stanza 4 - Restart all the things! 5 - Reindex ES, it works 6 - Set SearchEngine to ES, try searching 7 - It works! Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Awesome work all! Pushed to master for 19.05
Pushed to 18.11.x for 18.11.06
I'm declining this for the 18.05 track, as there aren't probably many users using ES, and I want people to have a reason to upgrade. You can feel free to try and convince me to do something different. :) Cheers, Liz