Requirements: The website finds that through the full-text search of keywords, the search results cannot display the latest data, log in to the server to check the disk space, and find that the disk space is full, in fact, I have encountered this kind of failure before, because it is my own personal website, and there are no tools such as resource information monitoring, so I did not find the problem at the first time.
After solving the server disk problem, test adding a new document (add data) to Elasticsearch (ES), and find that the data cannot be written, prompting a 403 error, as shown in the figure below:
Unsuccessful low level call on POST: /filecn/FileInfoEs # Audit trail of this API call: - [1] BadResponse: Node: http://xxxx:9200/ Took: 00:00:00.0068726 # OriginalException: Elasticsearch.Net.ElasticsearchClientException: Remote server returns error: (403) Forbidden. Call: Status code 403 from: POST /filecn/FileInfoEs. ServerError: Type: cluster_block_exception Reason: "blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];" ---> System.Net.WebException: Remote Server returns error: (403) Forbidden. at System.Net.HttpWebRequest.GetResponse() In Elasticsearch.Net.HttpWebRequestConnection.Request[TResponse](RequestData requestData) --- End of the internal exception stack trace --- # Request: <Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.> # Response: <Response stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.> Cause: Caused by the server disk space on which the ES is located, once any index of one or more shards is allocated to a node in a disk that stores more than 95% of the disk, the index will be forced into read-only mode.read_only_allow_delete attribute, when this attribute is true, the ES index only allows reading and deleting data, but does not allow adding and modifying data。
View all index settings information to visit:http://127.0.0.1:9200/_settings/_all?pretty
solution
Send a PUT command to Elasticsearch to modify the values of the read_only_allow_delete parameter as follows:
(End)
|