弹性搜索创建TransportConnection超时 [英] elasticsearch create TransportConnection timeout

查看:179
本文介绍了弹性搜索创建TransportConnection超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Java API创建一个Elasticsearch连接。我正在使用TransportConnection,我需要设置连接的超时。



我没有配置任何属性,连接需要三分钟的时间来给我一个超时。



知道是否有属性设置超时值?



Thaks。

解决方案

 设置设置= ImmutableSettings.settingsBuilder()
.put(cluster.name,cluster_name).put(client.transport.ping_timeout,30s )。建立();

TransportClient transport = new TransportClient(settings);

另请参阅ES文档页面中的以下内容:



故障检测


I am creating a Elasticsearch Connection with Java API. I am using TransportConnection and I need to set the timeout for the connection.

I haven't configured any property and the connect takes three minutes to give me a timeout.

Anybody know if any property exists to set the value of timeout?

Thaks.

解决方案

Settings settings = ImmutableSettings.settingsBuilder()
            .put("cluster.name", cluster_name).put("client.transport.ping_timeout", "30s").build();

    TransportClient transport = new TransportClient(settings);

See also the following from ES documentation page:

Fault Detection

这篇关于弹性搜索创建TransportConnection超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆