Connection refused after its been running for a while

I am using elastic search 1.7.0, and connection using .net nest client. when i leave elastic search service running for a while, and continue using, making requests. as some point in time, i start getting the following error.

no connection could be made because the target machine actively refused it at :9200

the only way to fix it is to restart the elasticseach service

There should be clues in the ES logs. Perhaps you're running out of JVM heap?

Thanks magnusbaeck,

It happened again, but the memory usage on the server was only 36%. I tried using the command -jstat -gc but it would allow me to connect to the elastic process.

I'm not sure how to check the JVM heap size properly.

On another note, I found that Mavel was still running in the background. I previously uninstalled it because it was choking up my elastic search with heaps of logs. But I must not have uninstalled it correctly, it was logging massive amounts of errors.

I also tried to set mlockall=true, but found there was another setting in elasticsearch.service which needed to be changed for this to work.

Fingers crossed it doesn't happen again. This app is in production now, still not too many users, but I wouldn't want it to fail for them.


to see the heap you may use _nodes/stats/jvm.