Could not resolve host: 'localhost 报错解决办法

川长思鸟来 2022-05-31 23:23 732阅读 0赞
  1. Could not resolve host: 'localhost

是我在命令行中使用Curl往Kiabna中导入数据时报的错误。

首先,在Windows中curl命令后面用双引号;

其次,需要加-H “Content-Type: application/x-ndjson”

例如,原来的导入代码是:

  1. curl -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @accounts.json

则改成:

  1. curl -H "Content-Type: application/x-ndjson" -XPOST "localhost:9200/bank/account/_bulk?pretty" --data-binary @accounts.json

发表评论

表情:
评论列表 (有 0 条评论,732人围观)

还没有评论,来说两句吧...

相关阅读