将一个Json文件发布到在Windows 10上运行在Docker,Kitematic上的elasticsearch

我一直在找遍所有的互联网没有任何运气。 我试图将文件fluidflux.json发布到运行在Windows 10上的fluidflux.json镜像,但是没有成功。

任何人都可以帮助我找出适当的Post命令和本地放置文件的位置?

我在Windows Docker“套件”附带的Kitematic Powershell中运行curl。 我装了一个音量:

Elasticsearch泊坞窗图像 - 卷装

我把我的文件放在本地文件夹“数据”,并运行我的命令,但没有运气。

我build议你将10GB的文件分成几个〜3MB的文件,并使用批量API发送数据。 使用python脚本比使用curl更容易,但是如果你想使用curl:

 curl -XPOST 'localhost:9200/_bulk?pretty' -H 'Content-Type: application/json' -d @fluidflux_part1.json 

你的json文件应该像下面那样用\ n分隔行,所以需要做一些预处理:

 { "index" : { "_index" : "myindex", "_type" : "mytype", "_id" : "1" } } { "name" : "john" } { "index" : { "_index" : "myindex", "_type" : "mytype", "_id" : "2" } } { "name" : "mary" }