Elasticsearch: Unable to restart the service because no space left on device

Viewed 7010

I am running a single node ES 2.X on a centOS aws instance

The ES service refuses to start because of - No space left on device error and unless the service starts, I can't run a snapshot & delete script that I have written.

Is there anyway I can restart the service? It would be helpful if you could give me pointers to monitor the size growth so that I don't end up in this situation again.

P.S: All the help online suggests deleting files to restart, but I am not sure what files to delete.

2 Answers

First thing you need to check is location of your files below:

path.data: /home/elasticsearch path.logs: /home/logs/elasticsearch

It should resolve the problem

But, if you don't have enough space even to restart the elastic after making changes you should consider removing all unwanted files.

Solution for Centos 6 is given below:

  1. yum -y install yum-utils
  2. find /var -name "*.log" ( ( -size +50M -mtime +7 ) -o -mtime +30 ) -exec truncate {} --size 0 \;
  3. yum clean all
  4. rm -rf /var/cache/yum
  5. rm -rf /var/tmp/yum-*
  6. package-cleanup --quiet --leaves --exclude-bin package-cleanup --quiet --leaves --exclude-bin | xargs yum remove -y
  7. rm -rf /root/.wp-cli/cache/*
  8. rm -rf /home//.wp-cli/cache/
  9. rm -rf /root/.wp-cli/cache/*
  10. rm -rf /home//.wp-cli/cache/
  11. package-cleanup --oldkernels --count=2
  12. rm -rf /root/.composer/cache
  13. rm -rf /home/*/.composer/cache
  14. find -regex ".*/core.[0-9]+$" -delete
  15. rm -rf /root/.npm /home//.npm /root/.node-gyp /home//.node-gyp /tmp/npm-*

Try restarting elastic search now.

Related