看下官方文档的描述:
Since 3.6.0 ZooKeeper binary package bundles an integration with Prometheus.io
metricsProvider.className : Set to “org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider” to enable Prometheus.io exporter.
metricsProvider.httpHost : New in 3.8.0: Prometheus.io exporter will start a Jetty server and listen this address, default is “0.0.0.0”
metricsProvider.httpPort : Prometheus.io exporter will start a Jetty server and bind to this port, it defaults to 7000. Prometheus end point will be http://hostname:httPort/metrics.
metricsProvider.exportJvmInfo : If this property is set to true Prometheus.io will export useful metrics about the JVM. The default is true.
metricsProvider.numWorkerThreads : New in 3.7.1: Number of worker threads for reporting Prometheus summary metrics. Default value is 1. If the number is less than 1, the main thread will be used.
metricsProvider.maxQueueSize : New in 3.7.1: The max queue size for Prometheus summary metrics reporting task. Default value is 1000000.
metricsProvider.workerShutdownTimeoutMs : New in 3.7.1: The timeout in ms for Prometheus worker threads shutdown. Default value is 1000ms.
在3.8.1版本中,7000端口默认就没打开,所以啥也不用动
还是看下官方文档:
New in 3.5.0: The following options are used to configure the AdminServer.
admin.enableServer : (Java system property: zookeeper.admin.enableServer) Set to “false” to disable the AdminServer. By default the AdminServer is enabled.
admin.serverAddress : (Java system property: zookeeper.admin.serverAddress) The address the embedded Jetty server listens on. Defaults to 0.0.0.0.
admin.serverPort : (Java system property: zookeeper.admin.serverPort) The port the embedded Jetty server listens on. Defaults to 8080.
admin.idleTimeout : (Java system property: zookeeper.admin.idleTimeout) Set the maximum idle time in milliseconds that a connection can wait before sending or receiving data. Defaults to 30000 ms.
admin.commandURL : (Java system property: zookeeper.admin.commandURL) The URL for listing and issuing commands relative to the root URL. Defaults to “/commands”.
默认AdminServer是打开的,我们可以打开访问http://192.168.200.128:8080/commands这个url看下这个界面: