elasticsearch 6 index change to read only after few second

I had this problem I think in elastic 6 add new setting to close index when empty hard less than 5% you can disable this by below line in elasticsearch.yml

 cluster.routing.allocation.disk.threshold_enabled: false

Then restart elasticsearch. I hope this work for you


Convenience for copy/pasting into Kibana console

# disable threshold alert
PUT /_cluster/settings
{
  "persistent" : {
        "cluster.routing.allocation.disk.threshold_enabled" : false
    }
}

# unlock indices from read-only state
PUT /_all/_settings
{
  "index.blocks.read_only_allow_delete": null
}

If you are working in with elastic search in Docker, it's possible that Docker has run out of space. Either run docker volume prune to remove unused local volumes or increase your disk image size in Docker Preferences.