elasticsearch create TransportConnection timeout

喜欢而已 提交于 2019-12-23 21:40:24

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/27602499/elasticsearch-create-transportconnection-timeout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!