elasticsearch create TransportConnection timeout

2019-07-05 13:26发布

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条回答
淡お忘
2楼-- · 2019-07-05 13:33
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

查看更多
登录 后发表回答