Py学习  »  Elasticsearch

ElasticSearch:等待长时间运行的请求完成

Tony • 6 年前 • 2111 次点击  

知道什么时候 长距离跑 ElasticSearch请求完成了吗?

今天,我有一个进程周期性地从一个AWS托管的ES中清除大约10万个文档,其中包含大约6000万个文档。

var settings = new ConnectionSettings(new Uri("https://mycompany.es.aws.com"));
settings.RequestTimeout(TimeSpan.FromMinutes(3)); // not sure this helps

var client = new ElasticClient(settings);

var request = new DeleteByQueryRequest("MyIndex") { ... };

// this call will return an IsValid = true, httpstatus = 504 after ~60s,
var response = await client.DeleteByQueryAsync(request);

即使超时设置为3分钟,调用也始终在~60秒后返回,响应为空,状态代码为504。虽然通过Kibana,我可以看到删除操作在接下来的几分钟内继续(并正确完成)。

有没有更好的方法来请求和监视(等待完成)长时间运行的ES请求?

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/30714
 
2111 次点击  
文章 [ 2 ]  |  最新文章 6 年前