Elasticsearch 7.11

MattW

Well-known member
Just a heads up on this one. They have changed how the heap memory is defined and managed:

Code:
################################################################
## IMPORTANT: JVM heap size
################################################################
##
## The heap size is automatically configured by Elasticsearch
## based on the available memory in your system and the roles
## each node is configured to fulfill. If specifying heap is
## required, it should be done through a file in jvm.options.d,
## and the min and max should be set to the same value. For
## example, to set the heap to 4 GB, create a new file in the
## jvm.options.d directory containing these lines:
##
## -Xms4g
## -Xmx4g
##
## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html
## for more information
##
################################################################

It's no longer controlled by the jvm.options file, and if you server automatically restarts ES after the update (like one of my cPanel servers has just done), you'll probably run out of Memory!

On my server running my site, I previously had 1GB allocated to Java, with the new setup, it's restarted, and ballooned to RAM usage to attempt to use 50% (32GB!)
 
How to memory setup for Elastisearch?
What do you mean?

 
Doing some initial troubleshooting before I delve into the Elasticsearch logs and such.

Here are the typical error messages that I'm getting:
Code:
[LIST]
[*]               
[*]XFES\Elasticsearch\ConnectException: Elasticsearch indexing error (queued): cURL error 7: Failed to connect to 127.0.0.1 port 9200: Connection refused (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
[*]              
[*]src/addons/XFES/Elasticsearch/Api.php:391
[*]           
[/LIST]
          
[LIST]
[*]               
[*]Generated by: ace10
[*]              
[*]Feb 17, 2021 at 2:41 PM
[*]           
[/LIST]
       
      
[HEADING=2]Stack trace[/HEADING]
      
           #0 src/addons/XFES/Elasticsearch/Api.php(90): XFES\Elasticsearch\Api->request('get', '/')
#1 src/addons/XFES/Elasticsearch/Api.php(107): XFES\Elasticsearch\Api->version()
#2 src/addons/XFES/Elasticsearch/Api.php(134): XFES\Elasticsearch\Api->majorVersion()
#3 src/addons/XFES/Elasticsearch/Api.php(336): XFES\Elasticsearch\Api->isTypelessIndex()
#4 src/addons/XFES/Elasticsearch/Api.php(152): XFES\Elasticsearch\Api->requestById('put', 'post', 230929, Array)
#5 src/addons/XFES/Search/Source/Elasticsearch.php(54): XFES\Elasticsearch\Api->index('post', 230929, Array)
#6 src/XF/Search/Search.php(40): XFES\Search\Source\Elasticsearch->index(Object(XF\Search\IndexRecord))
#7 src/XF/Behavior/Indexable.php(46): XF\Search\Search->index('post', Object(XFMG\XF\Entity\Post), false)
#8 src/XF.php(341): XF\Behavior\Indexable->XF\Behavior\{closure}()
#9 src/XF/Mvc/Dispatcher.php(156): XF::triggerRunOnce(true)
#10 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#11 src/XF/App.php(2326): XF\Mvc\Dispatcher->run()
#12 src/XF.php(488): XF\App->run()
#13 index.php(20): XF::runApp('XF\\Pub\\App')
#14 {main}

-------------

Previous GuzzleHttp\Exception\ConnectException: cURL error 7: Failed to connect to 127.0.0.1 port 9200: Connection refused (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) - src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:185
#0 src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(149): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(102): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 src/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#3 src/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#4 src/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(51): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#5 src/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(37): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#6 src/vendor/guzzlehttp/guzzle/src/Middleware.php(30): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#7 src/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(70): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#8 src/vendor/guzzlehttp/guzzle/src/Middleware.php(58): GuzzleHttp\RedirectMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#9 src/vendor/guzzlehttp/guzzle/src/HandlerStack.php(67): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#10 src/vendor/guzzlehttp/guzzle/src/Client.php(277): GuzzleHttp\HandlerStack->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#11 src/vendor/guzzlehttp/guzzle/src/Client.php(98): GuzzleHttp\Client->transfer(Object(GuzzleHttp\Psr7\Request), Array)
#12 src/vendor/guzzlehttp/guzzle/src/Client.php(106): GuzzleHttp\Client->sendAsync(Object(GuzzleHttp\Psr7\Request), Array)
#13 src/addons/XFES/Elasticsearch/Api.php(374): GuzzleHttp\Client->send(Object(GuzzleHttp\Psr7\Request))
#14 src/addons/XFES/Elasticsearch/Api.php(90): XFES\Elasticsearch\Api->request('get', '/')
#15 src/addons/XFES/Elasticsearch/Api.php(107): XFES\Elasticsearch\Api->version()
#16 src/addons/XFES/Elasticsearch/Api.php(134): XFES\Elasticsearch\Api->majorVersion()
#17 src/addons/XFES/Elasticsearch/Api.php(336): XFES\Elasticsearch\Api->isTypelessIndex()
#18 src/addons/XFES/Elasticsearch/Api.php(152): XFES\Elasticsearch\Api->requestById('put', 'post', 230929, Array)
#19 src/addons/XFES/Search/Source/Elasticsearch.php(54): XFES\Elasticsearch\Api->index('post', 230929, Array)
#20 src/XF/Search/Search.php(40): XFES\Search\Source\Elasticsearch->index(Object(XF\Search\IndexRecord))
#21 src/XF/Behavior/Indexable.php(46): XF\Search\Search->index('post', Object(XFMG\XF\Entity\Post), false)
#22 src/XF.php(341): XF\Behavior\Indexable->XF\Behavior\{closure}()
#23 src/XF/Mvc/Dispatcher.php(156): XF::triggerRunOnce(true)
#24 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#25 src/XF/App.php(2326): XF\Mvc\Dispatcher->run()
#26 src/XF.php(488): XF\App->run()
#27 index.php(20): XF::runApp('XF\\Pub\\App')
#28 {main}
      
      
[HEADING=2]Request state[/HEADING]
      
           array(4) {
  ["url"] => string(93) "/forums/threads/electric-car-impact-on-fuel-availabilty-and-pricing-in-future.16082/add-reply"
  ["referrer"] => string(114) "https://www.500eboard.co/forums/threads/electric-car-impact-on-fuel-availabilty-and-pricing-in-future.16082/page-2"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(10) {
    ["message_html"] => string(249) "<blockquote data-attributes="member: 898" data-quote="alabbasi" data-source="post: 230928"><p>Yep, and I thought it was hard to switch from Dewalt to Makita</p></blockquote><p><br></p><p><br></p><p>Going from Yellow to Blue is an easy decision. </p>"
    ["attachment_hash"] => string(32) "2623b86b457929117b69545a6fca7c6c"
    ["attachment_hash_combined"] => string(87) "{"type":"post","context":{"thread_id":16082},"hash":"2623b86b457929117b69545a6fca7c6c"}"
    ["last_date"] => string(10) "1613590651"
    ["last_known_date"] => string(10) "1613590651"
    ["load_extra"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(90) "/forums/threads/electric-car-impact-on-fuel-availabilty-and-pricing-in-future.16082/page-2"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}

and this one:

Code:
[LIST]
[*]               
[*]XFES\Elasticsearch\ConnectException: cURL error 7: Failed to connect to 127.0.0.1 port 9200: Connection refused (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
[*]              
[*]src/addons/XFES/Elasticsearch/Api.php:391
[*]           
[/LIST]
          
[LIST]
[*]               
[*]Generated by: Unknown account
[*]              
[*]Feb 17, 2021 at 2:30 PM
[*]           
[/LIST]
       
      
[HEADING=2]Stack trace[/HEADING]
      
           #0 src/addons/XFES/Elasticsearch/Api.php(90): XFES\Elasticsearch\Api->request('get', '/')
#1 src/addons/XFES/Elasticsearch/Api.php(107): XFES\Elasticsearch\Api->version()
#2 src/addons/XFES/Search/Source/Elasticsearch.php(381): XFES\Elasticsearch\Api->majorVersion()
#3 src/addons/XFES/Search/Source/Elasticsearch.php(161): XFES\Search\Source\Elasticsearch->getCommonSearchDsl(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), '200')
#4 src/addons/SV/SearchImprovements/XFES/Search/Source/Elasticsearch.php(125): XFES\Search\Source\Elasticsearch->getKeywordSearchDsl(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), '200')
#5 src/addons/XFES/Search/Source/Elasticsearch.php(145): SV\SearchImprovements\XFES\Search\Source\Elasticsearch->getKeywordSearchDsl(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), '200')
#6 src/XF/Search/Search.php(183): XFES\Search\Source\Elasticsearch->search(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), '200')
#7 src/XF/Search/Search.php(212): XF\Search\Search->XF\Search\{closure}(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), '200')
#8 src/XF/Search/Search.php(179): XF\Search\Search->executeSearch(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), '200', Object(Closure), true)
#9 src/XF/Repository/Search.php(34): XF\Search\Search->search(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery))
#10 src/XF/Pub/Controller/Search.php(430): XF\Repository\Search->runSearch(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), Array, true)
#11 src/XF/Pub/Controller/Search.php(140): XF\Pub\Controller\Search->runSearch(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), Array)
#12 src/XF/Mvc/Dispatcher.php(350): XF\Pub\Controller\Search->actionResults(Object(XF\Mvc\ParameterBag))
#13 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF\\Pub\\Controll...', 'Results', Object(XF\Mvc\RouteMatch), Object(SV\SearchImprovements\XF\Pub\Controller\Search), Object(XF\Mvc\Reply\Reroute))
#14 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\SearchImprovements\XF\Pub\Controller\Search), Object(XF\Mvc\Reply\Reroute))
#15 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#16 src/XF/App.php(2326): XF\Mvc\Dispatcher->run()
#17 src/XF.php(488): XF\App->run()
#18 index.php(20): XF::runApp('XF\\Pub\\App')
#19 {main}

-------------

Previous GuzzleHttp\Exception\ConnectException: cURL error 7: Failed to connect to 127.0.0.1 port 9200: Connection refused (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) - src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:185
#0 src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(149): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(102): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 src/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#3 src/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#4 src/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(51): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#5 src/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(37): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#6 src/vendor/guzzlehttp/guzzle/src/Middleware.php(30): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#7 src/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(70): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#8 src/vendor/guzzlehttp/guzzle/src/Middleware.php(58): GuzzleHttp\RedirectMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#9 src/vendor/guzzlehttp/guzzle/src/HandlerStack.php(67): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#10 src/vendor/guzzlehttp/guzzle/src/Client.php(277): GuzzleHttp\HandlerStack->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#11 src/vendor/guzzlehttp/guzzle/src/Client.php(98): GuzzleHttp\Client->transfer(Object(GuzzleHttp\Psr7\Request), Array)
#12 src/vendor/guzzlehttp/guzzle/src/Client.php(106): GuzzleHttp\Client->sendAsync(Object(GuzzleHttp\Psr7\Request), Array)
#13 src/addons/XFES/Elasticsearch/Api.php(374): GuzzleHttp\Client->send(Object(GuzzleHttp\Psr7\Request))
#14 src/addons/XFES/Elasticsearch/Api.php(90): XFES\Elasticsearch\Api->request('get', '/')
#15 src/addons/XFES/Elasticsearch/Api.php(107): XFES\Elasticsearch\Api->version()
#16 src/addons/XFES/Search/Source/Elasticsearch.php(381): XFES\Elasticsearch\Api->majorVersion()
#17 src/addons/XFES/Search/Source/Elasticsearch.php(161): XFES\Search\Source\Elasticsearch->getCommonSearchDsl(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), '200')
#18 src/addons/SV/SearchImprovements/XFES/Search/Source/Elasticsearch.php(125): XFES\Search\Source\Elasticsearch->getKeywordSearchDsl(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), '200')
#19 src/addons/XFES/Search/Source/Elasticsearch.php(145): SV\SearchImprovements\XFES\Search\Source\Elasticsearch->getKeywordSearchDsl(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), '200')
#20 src/XF/Search/Search.php(183): XFES\Search\Source\Elasticsearch->search(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), '200')
#21 src/XF/Search/Search.php(212): XF\Search\Search->XF\Search\{closure}(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), '200')
#22 src/XF/Search/Search.php(179): XF\Search\Search->executeSearch(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), '200', Object(Closure), true)
#23 src/XF/Repository/Search.php(34): XF\Search\Search->search(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery))
#24 src/XF/Pub/Controller/Search.php(430): XF\Repository\Search->runSearch(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), Array, true)
#25 src/XF/Pub/Controller/Search.php(140): XF\Pub\Controller\Search->runSearch(Object(SV\SearchImprovements\XF\Search\Query\KeywordQuery), Array)
#26 src/XF/Mvc/Dispatcher.php(350): XF\Pub\Controller\Search->actionResults(Object(XF\Mvc\ParameterBag))
#27 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF\\Pub\\Controll...', 'Results', Object(XF\Mvc\RouteMatch), Object(SV\SearchImprovements\XF\Pub\Controller\Search), Object(XF\Mvc\Reply\Reroute))
#28 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\SearchImprovements\XF\Pub\Controller\Search), Object(XF\Mvc\Reply\Reroute))
#29 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#30 src/XF/App.php(2326): XF\Mvc\Dispatcher->run()
#31 src/XF.php(488): XF\App->run()
#32 index.php(20): XF::runApp('XF\\Pub\\App')
#33 {main}
      
      
[HEADING=2]Request state[/HEADING]
      
           array(4) {
  ["url"] => string(51) "/forums/search/34437/?page=1&q=Wiechers&o=relevance"
  ["referrer"] => bool(false)
  ["_GET"] => array(3) {
    ["page"] => string(1) "1"
    ["q"] => string(8) "Wiechers"
    ["o"] => string(9) "relevance"
  }
  ["_POST"] => array(0) {
  }
}

      
      
           Delete


Today I installed 7.11.1 per the Ubuntu command line.

Next, I did a restart of Elasticsearch from the command line, using /etc/init.d/elasticsearch restart

After the cluster restarted, I ran a couple of commands, with the following output:

First, using the "curl" command to test connectivity to the server via port 9200, which seems to have checked out fine.

Code:
root@500eboard:/etc/elasticsearch/jvm.options.d# curl 127.0.0.1:9200
{
  "name" : "500eboard",
  "cluster_name" : "500eboard-xenforo",
  "cluster_uuid" : "2-NmRlvDRUurPKg6jmFjEA",
  "version" : {
    "number" : "7.11.1",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "ff17057114c2199c9c1bbecc727003a907c0db7a",
    "build_date" : "2021-02-15T13:44:09.394032Z",
    "build_snapshot" : false,
    "lucene_version" : "8.7.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}
root@500eboard:/etc/elasticsearch/jvm.options.d#

Next, I ran /etc/init.d/elasticsearch status to check the health of the cluster, which seems to be fine:

Code:
root@500eboard:/etc/elasticsearch/jvm.options.d# /etc/init.d/elasticsearch status
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2021-02-17 15:05:33 EST; 14min ago
     Docs: https://www.elastic.co
Main PID: 23392 (java)
    Tasks: 61 (limit: 4638)
   CGroup: /system.slice/elasticsearch.service
           ├─23392 /usr/share/elasticsearch/jdk/bin/java -Xshare:auto -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX…et
           └─23610 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller

Feb 17 15:05:12 500eboard systemd[1]: Starting Elasticsearch...
Feb 17 15:05:33 500eboard systemd[1]: Started Elasticsearch.
root@500eboard:/etc/elasticsearch/jvm.options.d#


And finally, a check on Port 9200, which also seems to be OK:

Code:
root@500eboard:/etc/elasticsearch# netstat -tlpen | grep 9200
tcp6       0      0 127.0.0.1:9200          :::*                    LISTEN      116        614020     25335/java          
root@500eboard:/etc/elasticsearch#
 
Last edited:
Still no joy on the situation as to why the communication between the Elasticsearch engine is shutting itself down.

As a temporary Band-Aid, I created a cron job that runs every four hours, that restarts the Elasticsearch engine. This is working; the Elasticsearch server has now been "up" for about a day and a half with no errors (I rebooted the system because of a system update) and for about a day and a half before that.

No logged errors in the XF system console, and no users complaining about search not working.

Code:
root@500eboard:/# /etc/init.d/elasticsearch status
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2021-02-19 07:18:31 EST; 1 day 5h ago
     Docs: https://www.elastic.co
Main PID: 872 (java)
    Tasks: 65 (limit: 4638)
   CGroup: /system.slice/elasticsearch.service
           ├─ 872 /usr/share/elasticsearch/jdk/bin/java -Xshare:auto -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:…et
           └─2542 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller

Feb 19 07:18:01 500eboard systemd[1]: Starting Elasticsearch...
Feb 19 07:18:31 500eboard systemd[1]: Started Elasticsearch.
root@500eboard:/#

Still, a lot of work to do to delve into the problem to find the root cause. Something in the latest Elasticsearch update to 7.11 (and now 7.11.1) exacerbated / accelerated the communication problem I was having with the server.
 
@gerryvz

Your situation sounds pretty awful and it would annoy me like hell. Maybe just hire a server guru like Matt? So it gets fixed? It is not normal that it stops all the time. Running ES for over a year and not a single restart was needed so far. Lucky for me as I have no clue what I would do if I had your problem.
 
  • Like
Reactions: Xon
It is definitely possible to have a stable setup with a low memory limit. But it requires some configuring which may not act as expected all the time.
 
@gerryvz

Your situation sounds pretty awful and it would annoy me like hell. Maybe just hire a server guru like Matt? So it gets fixed? It is not normal that it stops all the time. Running ES for over a year and not a single restart was needed so far. Lucky for me as I have no clue what I would do if I had your problem.
I agree. I think I need to have some with more server admin experience perhaps remove and re-install things. Thanks for the suggestion.
 
@MattW Do you know if they kept this change in 7.12? I started using ES again (disabled it on 7.11) so wondering if I need to make the changes posted in this thread. Thx
EDIT: Yup still crashes.
 
Last edited:
Thanks for this info and also to @MattW for the info in the original post. I’ll add the settings and see how things go. This is really frustrating.


UPDATE
What I did was to go to /etc/elasticsearch and found the jvm.options file, as well as the jvm.options.d directory.

I did a cp jvm.options jvm.options.d to copy the jvm.options file into the jvm.options.d directory.

Then I did a cd jvm.options.d to go to the new directory. Then nano'd into the copied jvm.options file.

I uncommented the -Xms and -Xmx settings, and changed them from the default 4GB to 2GB, which is exactly one-half of my VPS' system memory, and what my java memory allocation has been (I checked via my system processes).

Saved the file, and issued a restart via /etc/init.d/elasticsearch restart command. I will report back as to how things go.

Cheers,
Gerry
Thanks for this, tried it! 🤞
 
I wanted to give folks an update on this situation. I went from having to reboot the elasticsearch server several times a day, to now perhaps once a month, if that. Normally it just runs until I do a full server reboot, which is when enough security patches and system updates have accrued that I need to install all of them and then just issue a full reboot.

What I found was interesting. When I was having the problems with the elasticsearch errors (mainly indexing errors), this was when I had one active / unassigned Elasticsearch shard.

When I went to two active / unassigned shards, the sytem then had no further issues with indexing. I don't quite remember what I did to increase the number of shards -- either I simply rebooted the Elasticsearch server at one point, or re-indexed the search. But I really have never had a problem again with Elasticsearch once I had more than one shard listed in the Elasticsearch info in the control panel.

So, it's defintely something that is related to the indexing errors. Perhaps an Elasticsearch expert can explain how and/or why this is.

Cheers,
Gerry
 
I also often this error:

cURL error 7: Failed to connect to localhost port 9200


Only help by restarting the elasticsearch server.

My server: 4GB
elasticsearch version 6.1.0
elasticsearch memory 256m
 
I also often this error:

cURL error 7: Failed to connect to localhost port 9200


Only help by restarting the elasticsearch server.

My server: 4GB
elasticsearch version 6.1.0
elasticsearch memory 256m
What I found with this situation is that it finally solved itself. What you need to do is to continue to restart your elasticsearch server when it fails. Also, reboot your server. What happens is that this failure is only happening when there are a very low number of shards associated with the Elasticsearch cluster.

Once some time goes by (and you reboot your server perhaps a couple of times), the number of Elasticsearch shards (assigned and unassigned) will begin to grow, and then the cluster will become reliable and never require any rebooting.

The cluster will continue to add additional shards by itself over time. Once you have 2-3 shards then it will become reliable, and you won't have these problems anymore. I was going to post what I found.

Here is the current status of my cluster. You can see what the number of shards has gradually grown to. A total of 17 shards. I have not had to reboot my Elasticsearch cluster itself, in probably at least 6 months.

This "Elasticsearch information" is part of my Admin control panel, and is from an add-on created by @AndyB called "Elasticsearch information" ... located here:


Screen Shot 2022-04-29 at 9.16.25 AM.jpg
 
Top Bottom