Kshitij Bajracharya
Kshitij Bajracharya

Reputation: 851

Disk space not freed after deleting documents from Elasticsearch

I have an elasticsearch node with following specs:

Disk indices and disk used in elasticsearch

I have deleted several documents from the index but my disk space doesn't seem to free up. The screenshot above shows that the actual documents in Elasticsearch only occupies 1.5GB as shown by disk.indices whereas the disk.used is 73.6GB. I have found that just deleting the document doesn't remove the document from elasticsearch, but only marks it as deleted. I have tried freeing disk space by using forcemerge as mentioned in this answer, but still my disk space shows the same.

How do I permanently delete documents from elasticsearch and free up my disk space?

Upvotes: 1

Views: 4386

Answers (2)

Val
Val

Reputation: 217314

Something on that host is taking up space, but the problem is not related to ES data because it's almost impossible to have such a small ratio between disk.indices and disk.used, as the merging process would take care of freeing up space as frequently as possible.

It turns out that it could be log files located somewhere on your disk that have not been properly rotated and have been accumulating for months.

Upvotes: 1

hamid bayat
hamid bayat

Reputation: 2179

first of all you should free some space. check in '.' folder and see what is in it?

try du -sh *

and then:

as _cat/indices response you have 1119 deleted document. and according to error you should first reverse read_only_indices:

Clustor block expection

then run this command:

curl  -H'Content-Type:application/json' -XPOST localhost:9200/{AN-INDEX-NAME}/_forcemerge?max_num_segments=1

Upvotes: 1

Related Questions