Hello,
I'm trying to use curl and call ElasticSearch bulk API.
The call is like this:
curl -XPOST "http://localhost:9200/myindex/mytype/_bulk" --data-binary @req -H "Con
tent-Type: application/x-ndjson" --user elastic:elastic_pwd
req is a file, whose content is like this
{ "index" : {} }
{"ServerName":"WIN-562V873OTU7","DateAction":"2017-12-21T13:38:09","ID":"Simple ID","Timestamp":"2017-12-21T13:38:06","Value":"47"}
last file in req is ending with \n.
I have an error message:
{"took":15,"errors":true,"items":[{"index":{"_index":"myindex","_type":"mytype","_id":"7kKteWABgkkg9WN7eY86","status":403,"error":{"type":"cluster_block_exception","rea
son":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"}}}]}
I found a topic on that issue, the solution was to send a PUT
http://localhost:9200/myindex/_settings/
{
"index": {
"blocks": {
"read_only_allow_delete": "false"
}
}
}
after this made, the call to curl is OK.
But when sending another curl call, I have again the error message. (which is resolved using the PUT request to the URL ___/_settings).
I don't want to send this request each time. It's why I tried to have in elasticsearch.yml the setting:
index.blocks.read_only_allow_delete: false
When restarted elasticsearch, I have a clear message indicating that this setting is not accepted:
Found index level settings on node level configuration.
Since elasticsearch 5.x index level settings can NOT be set on the nodes
configuration like the elasticsearch.yaml, in system properties or command line
arguments.In order to upgrade all indices the settings must be updated via the
/${index}/_settings API. Unless all settings are dynamic all indices must be closed
in order to apply the upgradeIndices created in the future should use index templates
to set default values.
Please ensure all required values are updated on all indices by executing:
curl -XPUT 'http://localhost:9200/_all/_settings?preserve_existing=true' -d '{
"index.blocks.read_only_allow_delete" : "false"
}'
What should i do in this case?
Regards
Driss