【问题标题】:Elasticsearch 7.10 : How to safely remove a node and free up space?Elasticsearch 7.10:如何安全地删除节点并释放空间?
【发布时间】:2021-03-25 10:05:35
【问题描述】:

由于磁盘空间不足,我想从节点中删除所有索引。请注意,我只有一个节点,并且我在本地机器上运行弹性服务器。

基本上,当我启动弹性服务器时,它会失败并显示以下日志 -

[2020-12-13T22:06:51,839][WARN ][o.e.c.r.a.DiskThresholdMonitor] [sedna] flood stage disk watermark [95%] exceeded on [k7t835EJQ6KzPu-7a-aW8Q][sedna][/home/ssahoo/elasticsearch-7.10.0/data/nodes/0] free: 879mb[0.8%], all indices on this node will be marked read-only

在终端上我收到以下错误 -

Could not rename log file 'logs/gc.log' to 'logs/gc.log.05' (Reserved).
(base) ssahoo@sedna:~/elasticsearch-7.10.0$ [2020-12-14T17:07:17,831][WARN ][stderr                   ] [sedna] Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: java.io.IOException: Input/output error
2020-12-14 17:07:17,848 main ERROR Unable to move file /home/ssahoo/elasticsearch-7.10.0/logs/elasticsearch_server.json to /home/ssahoo/elasticsearch-7.10.0/logs/elasticsearch-2020-12-13-1.json: java.nio.file.FileSystemException /home/ssahoo/elasticsearch-7.10.0/logs/elasticsearch_server.json -> /home/ssahoo/elasticsearch-7.10.0/logs/elasticsearch-2020-12-13-1.json: Disk quota exceeded
2020-12-14 17:07:17,852 main ERROR Unable to copy file /home/ssahoo/elasticsearch-7.10.0/logs/elasticsearch_server.json to /home/ssahoo/elasticsearch-7.10.0/logs/elasticsearch-2020-12-13-1.json: java.nio.file.FileSystemException /home/ssahoo/elasticsearch-7.10.0/logs/elasticsearch-2020-12-13-1.json: Disk quota exceeded
2020-12-14 17:07:17,857 main ERROR Unable to move file /home/ssahoo/elasticsearch-7.10.0/logs/elasticsearch.log to /home/ssahoo/elasticsearch-7.10.0/logs/elasticsearch-2020-12-13-1.log: java.nio.file.FileSystemException /home/ssahoo/elasticsearch-7.10.0/logs/elasticsearch.log -> /home/ssahoo/elasticsearch-7.10.0/logs/elasticsearch-2020-12-13-1.log: Disk quota exceeded
2020-12-14 17:07:17,861 main ERROR Unable to copy file /home/ssahoo/elasticsearch-7.10.0/logs/elasticsearch.log to /home/ssahoo/elasticsearch-7.10.0/logs/elasticsearch-2020-12-13-1.log: java.nio.file.FileSystemException /home/ssahoo/elasticsearch-7.10.0/logs/elasticsearch-2020-12-13-1.log: Disk quota exceeded
[2020-12-14T17:07:17,863][WARN ][stderr                   ] [sedna] Likely root cause: java.io.IOException: Input/output error
[2020-12-14T17:07:17,864][WARN ][stderr                   ] [sedna]     at java.base/java.io.FileDescriptor.close0(Native Method)
[2020-12-14T17:07:17,864][WARN ][stderr                   ] [sedna]     at java.base/java.io.FileDescriptor.close(FileDescriptor.java:297)

因此,我想通过删除所有索引以及节点来释放空间。那么如何删除我拥有的单个节点?

或者如果我可以问一下您的建议是什么来克服这个问题?我负担不起额外的磁盘空间,这是我的主要限制。

谢谢。

【问题讨论】:

标签: elasticsearch elasticsearch-5 elasticsearch-7


【解决方案1】:

我想从节点中删除所有索引

为了从节点中删除all 索引,获取索引列表,然后在每个索引上调用delete

例如

for i in $(curl -s -u user:password -XGET "<your_es_host_name>:9200/_cat/indices?s=index&h=index"); do echo "deleting Index --> $i"; curl -s -u user:password -XDELETE "< your_es_host_name>:9200/$i"; done

这将删除您的所有索引。如果您想排除某些索引,您可以修改代码以排除诸如"&lt;your_es_host_name&gt;:9200/_cat/indices?s=index&amp;h=index | grep -v exclude_index" 之类的索引。

希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 2019-01-15
    • 2018-08-10
    • 2019-08-29
    • 2016-03-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多