You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "Zhiguo Wu (Jira)" <ji...@apache.org> on 2022/10/24 09:01:00 UTC

[jira] [Commented] (AMBARI-25400) Issue while determining live collector in case of HA

    [ https://issues.apache.org/jira/browse/AMBARI-25400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17623059#comment-17623059 ] 

Zhiguo Wu commented on AMBARI-25400:
------------------------------------

Thanks [~eberhardtp] ! Would you like to create another PR for trunk?

> Issue while determining live collector in case of HA
> ----------------------------------------------------
>
>                 Key: AMBARI-25400
>                 URL: https://issues.apache.org/jira/browse/AMBARI-25400
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-metrics
>    Affects Versions: 2.6.2, 2.7.4
>            Reporter: amarnath reddy pappu
>            Assignee: Éberhardt Péter
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 2.7.5
>
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> If collector throws http://collectorhost:port/{color:#032f62}/ws/v1/timeline/metrics/livenodes{color} 500 error then sink is unable to determine live/healthy collector.
>  
> sink will try to connect to another collector only if it is not reachable/IOException to first collector.  if any other response code other than 200 then still it should consider as 1st Collector not reachable.
>  
> [https://github.com/apache/ambari/blob/release-2.7.4/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java#L629]
>  
>  Possible fix
>  
> {code:java}
>       if (responseCode == 200) {
>         try (InputStream in = connection.getInputStream()) {
>           StringWriter writer = new StringWriter();
>           IOUtils.copy(in, writer);
>           try {
>             collectors = gson.fromJson(writer.toString(), new TypeToken<List<String>>(){}.getType());
>           } catch (JsonSyntaxException jse) {
>             // Swallow this at the behest of still trying to POST
>             LOG.debug("Exception deserializing the json data on live " +
>               "collector nodes.", jse);
>           }
>         }
>       } else if (responseCode == 500){
>         String warnMsg = "Unable to connect to collector to find live nodes, Internal server error";
>         throw new MetricCollectorUnavailableException(warnMsg);
>       }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ambari.apache.org
For additional commands, e-mail: issues-help@ambari.apache.org