How to release memory of elastic search service? - elasticsearch

I'm now using Elastic Search service version 2.3.3 on Windows 7.
The memory usage of the service increase by each query statement but not release although the application was exit.
I tried to clear cached data as below command but the memory was still kept.
POST /_cache/clear
Is there anyway to release it?
Thanks in advance!

Related

How to migrate data from elasticsearch 5.6 to elasticsearch 8.3

I have an elastic search cluster running 5.6. I plan to upgrade my cluster but i plan to do it by basically running a ES cluster 8.3 running in parallel and then moving data over to it.
The preferred way i think is to do snapshot and restore https://www.elastic.co/guide/en/elasticsearch/reference/current/snapshot-restore.html
But I am confused about what exactly Snapshot version compatibility mean :
In the above does it mean that if i take a snapshot in elasticsearch 5.6, I cannot restore directly in version 8.3 ?? (which mean I have to first move to 6.x then to 7.x and finally to 8.x ) ??
The below index compatibility matrix, however says that a version in 5.x will work in 8.x ?
Am i missing something ? or can someone help me elaborate this?
So, the underlying problem is that data written in Lucene version N, can only be read with N+1. For Elasticsearch 5 to 8 the Lucene version was always 1 greater than the ES version (so 6 to 9).
That means, both for an upgrade or a restored snapshot: If your data was written with 5.x, you can only read / restore it with 6.x. For 7.x or 8.x you'll need to reindex the data. I would do a remote reindex straight from 5.x to 8.latest if possible: https://www.elastic.co/guide/en/elasticsearch/reference/current/reindex-upgrade-remote.html
There are some small caveats but they will probably not apply to you:
This doesn't apply to source only snapshots, but those always need a reindex, so that's not going to add any benefit for you.
8.3 added a feature to still read snapshots from 5.0 on but it is slower, doesn't support all features, and it is a commercial feature (platinum license if I'm not mistaken).
Depending on what kind of data it is: If it's aging out (like logs or metrics), maybe you don't have to migrate it to the new cluster?

Designing ElasticSearch Migration from 6.8 to 7.16 along with App Deployment

I have a Spring Boot application that uses ElasticSearch 6.8 and I would like to migrate it to Elasticsearch 7.16 with least downtime. I can do rolling update but the problem with migration is that when I migrate my ES cluster from version 6 to 7, some features in my application fails because of breaking changes (for example total hit response change)
I also upgraded my ElasticSearch client to version 7 in a separate branch and I can deploy it as well but that client doesn't work with ES version 6. So I cannot first release the application and then do the ES migration. I thought about doing application deployment and ES migration at the same time with a few hours downtime but in case something goes wrong rollback may take too much time (We have >10TB data in PROD).
I still couldn't find a good solution to this problem. I'm thinking to migrate only ES data nodes to 7.16 version and keep master nodes in 6.8. Then do application deployment and migrate ElasticSearch master nodes together with a small downtime. Has anyone tried doing this? Would running data and master nodes of my ElasticSearch cluster in different versions (6.8 and 7.16) cause problem?
Any help / suggestion is much appreciated
The breaking change you mention can be alleviated by using the query string parameter rest_total_hits_as_int=true in your client code in order to keep getting total hit count as in version 6 (mentioned in the same link you shared).
Running master and data nodes with different versions is not supported and I would not venture into it. If you have a staging environment where you can test this upgrade procedure it's better.
Since 6.8 clients are compatible with 7.16 clusters, you can add that small bit to your 6.8 client code, then you should be able to upgrade your cluster to 7.16.
When your ES server is upgraded, you can upgrade your application code to use the 7.16 client and you'll be good.
As usual with upgrades, since you cannot revert them once started, you should test this on a test environment first.

elasticsearch temporary crash when heavily adding/updating

I am running elasticsearch on a dedicated server on a Saas platform. The problem is that when cron jobs execute, and massively update/insert new values in elastic search, the front-office(the site) when it tries to connect to elasticsearch it returns false (the connection fails).
Anyone knows what can be the problem and how it can be fixed? We are running elasticsearch latest stable elastic search version.
This happens on and off, meaning when i refresh the page in the front office sometimes it cannot connect to elastic search, after another refresh it works again and so on, until the heavy load passes.
We have nvme hdds and elastic search is only running on that server not multi-nodes.
When i say heavily, I mean 1000-2000 updates per second.

How to test Elasticsearch without any possible harm for data?

I need to test functionality of project which is built on elasticsearch. I already have lots of data stored in the db. But i want somehow to test it without any possible harm. Is there any possible way or technology(which works like h2 f.e) to do it.
H2 is a in memory database, also embeddable in your application. In the past versions of ES there was a option to bootstrap a embedded elasticsearch node with your application.
In the current version this feature is not available anymore. So you'll need to bring up at least one node using a second machine, VM or container running elasticsearch. At least running elsticsearch on your machine is still a option.
But maybe you're still on a old version of elasticsearch? Then have a look on this SO (assuming you're using java): How to start elasticsearch 5.1 embedded in my java application?

ElasticSearch Couchbase integration

Basically I have followed the instructions here
But when I go to couchbase to setup the replication i get:
but I know it is there because
The machines can ping each other and no firewalls etc.....
I have found the following error in the log for elaticsearch every time i hit replicate in couchbase.
I am not sure what this means but....
Any pointers would be appreciated
Kindest Regards
Robin
Edit
Ps: lastest version of both couchbase and elasticsearch from today and running ubuntu server 12.04 LTS
I think that the CouchBase plugin has not been released yet for Elasticsearch 0.20.x but only for 0.19.x.
I think this is your issue here.
So try switching to a 0.19.9 ES version or wait for the next release of the CouchBase plugin.

Resources