window环境下执行curl命令批量导入json到elasticsearch中

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

报错信息

curl: (6) Could not resolve host: application
curl: (6) Could not resolve host: 'localhost

解决方法
把命令中的单引号改为双引号

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

重新执行命令,导入成功

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐