2023/10/14

最近nas因為更新發生nfs不能使用的問題

因此暫時把graylog搬到其他台還沒更新的nas上

搬完後發現ES變成red

 








下指令看一下是那些shards


curl -XGET localhost:9200/_cat/shards|grep UNASSIGNED


index.action       0 r UNASSIGNED

index.do           0 r UNASSIGNED

index.aspx         0 r UNASSIGNED

graylog_159        2 p UNASSIGNED

index.htm          0 r UNASSIGNED

index.py           0 r UNASSIGNED

index.php          0 r UNASSIGNED

index.cgi          0 r UNASSIGNED

index.html         0 r UNASSIGNED

index.cfm          0 r UNASSIGNED

index.pl           0 r UNASSIGNED

index.jsp          0 r UNASSIGNED

index.asp          0 r UNASSIGNED


graylog_159 這個是放資料的 直接砍了 就損失一天的log

curl -XDELETE 'localhost:9200/graylog_159/'

此時ES已經變 yellow

但其他的shards也不知道砍了會不會有問題
forum上說的是因為沒有第二台可以replication所以會出現 UNASSIGNED
如果覺得礙眼不想看到 可以取消 replication
指令如下

curl -X PUT "http://localhost:9200/index_name/_settings" -H 'Content-Type: application/json' -d '{"index":{"number_of_replicas":0}}'

目前就先醬放著吧
再觀察看看