This article is a mirror article of machine translation, please click here to jump to the original article.

View: 3710|Reply: 0

Elasticsearch (ES) fails to write data to the fault solution

[Copy link]
Posted on 4/17/2023 12:09:09 PM | | | |
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:



Elasticsearch(ES) cluster health: red Failure analysis
https://www.itsvse.com/thread-9543-1-1.html
(End)





Previous:Newcomer reports
Next:Three laws of the IT industry
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com