[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-5029?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dávid Paksy reassigned ZOOKEEPER-5029:
--------------------------------------

    Assignee: Dávid Paksy

> Port unification for PrometheusMetricsProvider
> ----------------------------------------------
>
>                 Key: ZOOKEEPER-5029
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-5029
>             Project: ZooKeeper
>          Issue Type: Task
>            Reporter: Dávid Paksy
>            Assignee: Dávid Paksy
>            Priority: Major
>
> The Jetty admin server has a port unification feature, meaning both secure 
> and insecure connections can be established on the same port. It can be 
> enabled with the 
> admin.portUnification=true configuration setting.
>  
> In order to make it more consistent, PrometheusMetricsProvider could also 
> provide such feature when metricsProvider.httpPort and 
> metricsProvider.httpsPort are the same.
> For example:
> {noformat}
> metricsProvider.httpPort=7000
> metricsProvider.httpsPort=7000{noformat}
> At the moment ZooKeeper fails to start up when metricsProvider.httpPort and 
> metricsProvider.httpsPort are the same:
> {noformat}
> 2026-03-18 14:33:14,221 [myid:] - ERROR 
> [main:o.a.z.m.p.PrometheusMetricsProvider@194] - Failed to start Prometheus 
> Jetty server
> java.io.IOException: Failed to bind to /0.0.0.0:7000
>         at 
> org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:349)
>         at 
> org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:310)
>         at 
> org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
>         at 
> org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:234)
>         at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
>         at org.eclipse.jetty.server.Server.doStart(Server.java:401)
>         at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
>         at 
> org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider.start(PrometheusMetricsProvider.java:188)
>         at 
> org.apache.zookeeper.metrics.impl.MetricsProviderBootstrap.startMetricsProvider(MetricsProviderBootstrap.java:45)
>         at 
> org.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:126)
>         at 
> org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:112)
>         at 
> org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:67)
>         at 
> org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:141)
>         at 
> org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:91)
> Caused by: java.net.BindException: Address already in use
>         at java.base/sun.nio.ch.Net.bind0(Native Method)
>         at java.base/sun.nio.ch.Net.bind(Net.java:555)
>         at 
> java.base/sun.nio.ch.ServerSocketChannelImpl.netBind(ServerSocketChannelImpl.java:337)
>         at 
> java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:294)
>         at 
> java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:89)
>         at 
> org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:344)
>         ... 13 common frames omitted
> {noformat}



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

Reply via email to