You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Henrique Mota (Jira)" <ji...@apache.org> on 2021/10/26 15:53:00 UTC
[jira] [Comment Edited] (FLINK-21068) Add new timeout options for
Elasticsearch connector
[ https://issues.apache.org/jira/browse/FLINK-21068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17434433#comment-17434433 ]
Henrique Mota edited comment on FLINK-21068 at 10/26/21, 3:52 PM:
------------------------------------------------------------------
My flink cluster is located in Europe and my Elasticsearch is in Canada, I'm having timeout problems due to latency, I want to change the batch size to have a higher throughput but I have a lot of connection timeout errors.
Currently I had to decrease the batch size to 100 to get good stability, but I have a very low transfer rate.
was (Author: henriquemota):
My flink cluster is located in Europe and my Elasticsearch is in Canada, I'm having timeout problems due to latency, I want to change the batch size to have a higher throughput but I have a lot of connection timeout errors.
> Add new timeout options for Elasticsearch connector
> ---------------------------------------------------
>
> Key: FLINK-21068
> URL: https://issues.apache.org/jira/browse/FLINK-21068
> Project: Flink
> Issue Type: Improvement
> Components: Connectors / ElasticSearch
> Affects Versions: 1.12.1
> Reporter: jinfeng
> Priority: Minor
> Labels: auto-deprioritized-major
>
> Currently, the connection.max-retry-timeout seems not work with new elasticsearch connector. The elasticsearch community has Remove setMaxRetryTimeoutMillis from RestClientBuilder. We can set timeout options when create RestHighLevelClient in
> Elasticsearch7ApiCallBridge , like
> {code:java}
> //代码占位符
> @Override
> public RestHighLevelClient createClient(Map<String, String> clientConfig) throws IOException {
> RestClientBuilder builder = RestClient.builder(httpHosts.toArray(new HttpHost[httpHosts.size()]));
> builder.setRequestConfigCallback(new RestClientBuilder.RequestConfigCallback() {
> @Override
> public RequestConfig.Builder customizeRequestConfig(RequestConfig.Builder builder) {
> if (clientConfig.containsKey(CONFIG_KEY_CONNECTION_TIMEOUT)) {
> builder.setConnectTimeout(Integer.valueOf(clientConfig.get(CONFIG_KEY_CONNECTION_TIMEOUT)));
> }
> if (clientConfig.containsKey(CONFIG_KEY_CONNECTION_SOCKET_TIMEOUT)) {
> builder.setSocketTimeout(Integer.valueOf(clientConfig.get(CONFIG_KEY_CONNECTION_SOCKET_TIMEOUT)));
> }
> if (clientConfig.containsKey(CONFIG_KEY_CONNECTION_REQUEST_TIMEOUT)) {
> builder.setConnectionRequestTimeout(Integer.valueOf(clientConfig.get(CONFIG_KEY_CONNECTION_REQUEST_TIMEOUT)));
> }
> return builder;
> }
> });
> {code}
>
> So, we can add three table config to config eleasticsearch timeout.
> connection.timeout
> connection.socket-timeout
> connection.request-timeout
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)