How do I check the disk usage for elastic search?

Goal

Get the available disk size of elasticsearch

Assumptions

You already have elasticsearch set-up and running.

Steps

1. Log in to the app container using ssh

https://docs.platform.sh/development/access-site.html#accessing-the-application-with-ssh

2. Query the elastic search api

Run this curl snippet assuming your elasticsearch relationship is called elasticsearch. If the name is different, change the snippet below to reflect that.

curl -XGET 'elasticsearch.internal:9200/_cat/allocation?v&pretty'

shards disk.indices disk.used disk.avail disk.total disk.percent host   ip   node
4   124.7kb   22.6mb   1.8gb   1.9gb   1 127.0.0.0 127.0.0.0 2kv5ycbzprs4bomyaeu6zkvoh4

The command is missing a quote character. Should be curl -XGET 'elasticsearch.internal:9200/_cat/allocation?v&pretty'

1 Like