elasticsearch 卷曲;(6) 无法解析主机:http";
我正在尝试运行此命令elasticsearch 卷曲;(6) 无法解析主机:http";,elasticsearch,curl,elasticsearch,Curl,我正在尝试运行此命令 curl -XPUT -H "Content-Type: application/json" https://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}' 但这导致了这个错误 curl: (6) Could not resolve host: http curl: (3) unmatched close brace/bracket in URL positi
curl -XPUT -H "Content-Type: application/json" https://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'
但这导致了这个错误
curl: (6) Could not resolve host: http
curl: (3) unmatched close brace/bracket in URL position 5:
null}'
我从这里得到这个命令
我对curl和elasticseach还不是很熟悉,所以我不确定如何找出错误
如果有区别的话,我使用的是Windows
我也试过了
$ curl -X PUT -H "Content-Type: application/json" https://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'
编辑2:
我试过了
curl-XPUT-H“内容类型:应用程序/json”http://localhost:9200/_all/_settings -d'{“index.blocks.read\u only\u allow\u delete:null}'
但是现在得到这个错误
{“error”:{“root_cause”:[{“type”:“json_parse_exception”,“reason”:“意外字符(''”(代码39)):在[Source:org.elasticsearch.transport.netty4]处应为有效值(数字、字符串、数组、对象、'true'、'false'或'null')\n。ByteBufStreamInput@446f2dd5;行:1,列:2]“}],“类型”:“json_解析_异常”,“原因”:意外字符(“”(代码39)):在[来源:org.elasticsearch.transport.netty4]处应为有效值(数字、字符串、数组、对象、“true”、“false”或“null”)\n。ByteBufStreamInput@446f2dd5;行:1,列:2]“}”,状态:400}卷曲:(3)URL位置5中不匹配的右括号/方括号:
空}'
^
然后我试着
curl-XPUT-H“内容类型:应用程序/json”http://localhost:9200/_all/_settings -d“{”index.blocks.read\u only\u allow\u delete:null}”
我得到了
{“error”:{“root_cause”:[{“type”:“json_parse_exception”,“reason”:“意外字符('i'(代码105)):应在[Source:org.elasticsearch.transport.netty4]处的字段名\n开头加上双引号。ByteBufStreamInput@696b36d3;行:1,列:3]“}],“类型”:“json_parse_exception”,“原因”:“意外字符('i'(代码105)):应在[Source:org.elasticsearch.transport.netty4]处以双引号开始字段名\n。ByteBufStreamInput@696b36d3;第1行,第3列]“},“状态”:400}
首先,在另一个SO问题中,ES节点是活动节点,因此其URL包括https
您的本地主机ist几乎肯定不会有https
,因此将其更改为http
:
curl -XPUT -H "Content-Type: application/json" \
http://localhost:9200/_all/_settings \
-d '{"index.blocks.read_only_allow_delete": null}'
除此之外,只要您的ES正在运行,一切看起来都正常
成功后,您将收到一条简单的消息:
{"acknowledged":true}
编辑:与
curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_all/_settings -d "{\"index.blocks.read_only_allow_delete\": null}"
我尝试了这个,但现在得到了一个不同的错误,原来的问题更新为新的错误