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

Prabhu Joseph commented on FLINK-31518:
---------------------------------------

[~huwh] We have a separate service runs part of JobManager which queries the 
REST API exposed by JobManager to access the Flink Metrics. It has to discover 
the Webmonitor Address. The rest.port is set to a range of port numbers. 
ClusterRestEndpointLeaderRetriever is used to discover the service which works 
fine when rest.port is set to a static port but returns 0 if a range is set. 
This jira intends to fix/improve this to return the right port number in case 
if range of ports is configured with rest.port.

{code}
LeaderRetrievalService webMonitorRetrievalService = 
highAvailabilityServices.getClusterRestEndpointLeaderRetriever();
try {
   webMonitorRetrievalService.start(new WebMonitorLeaderListener());
} catch (Exception e) {
  throw new RuntimeException(e);
}


private class WebMonitorLeaderListener implements LeaderRetrievalListener {
@Override
public void notifyLeaderAddress(final String leaderAddress, final UUID 
leaderSessionID) {
  System.out.println(leaderAddress);
}
{code}



> HighAvailabilityServiceUtils resolves wrong webMonitorAddress in Standalone 
> mode
> --------------------------------------------------------------------------------
>
>                 Key: FLINK-31518
>                 URL: https://issues.apache.org/jira/browse/FLINK-31518
>             Project: Flink
>          Issue Type: Bug
>          Components: Runtime / Configuration, Runtime / REST
>    Affects Versions: 1.16.0, 1.17.0, 1.16.1, 1.17.1
>            Reporter: Vineeth Naroju
>            Priority: Major
>
> {{HighAvailabilityServiceUtils#createHighAvailabilityServices()}}  in 
> {{HighAvailabilityMode.NONE}} mode uses 
> {{HighAvailabilityServiceUtils#getWebMonitorAddress()}} to get web monitor 
> address.
> {{HighAvailabilityServiceUtils#getWebMonitorAddress()}} reads only from 
> {{rest.port}} in {{flink-conf.yaml}} . If {{rest.port}} is not enabled, then 
> it returns {{0}} port number. It should dynamically fetch port number if 
> {{rest.port}} is disabled.



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

Reply via email to