Configure HDP ZooKeeper
This page describes how to enable ZooKeeper JMX so that Pulse can collect metrics.
Configure JMX Environment Variables and Flags
In the Ambari UI:
- Navigate to Zookeeper > Configs >
>Advanced zookeeper-envzookeeper-env template. - Set the JMXDISABLE environment variable:
export JMXDISABLE="true"
- In
, choose and add one of the following JMX configurations based on your security requirements.zookeeper-env template
Enable JMX without Security on JMX Remote Port
To enable JMX port without any security, add the following parameters at the end of the file:
export SERVER_JVMFLAGS="$SERVER_JVMFLAGS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8989 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dzookeeper.jmx.log4j.disable=true"
Enable Basic Authentication on JMX Remote Port (Optional)
To enable basic authentication on the JMX remote port, add the following parameters:
export SERVER_JVMFLAGS="$SERVER_JVMFLAGS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8989 -Dzookeeper.jmx.log4j.disable=true -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.access.file=</path/to/jmxremote.access/file> -Dcom.sun.management.jmxremote.password.file=</path/to/jmxremote.password/file>"
Enable TLS/SSL on JMX Remote Port (Optional)
To enable TLS/SSL authentication on the JMX remote port, add the following parameters:
export SERVER_JVMFLAGS="$SERVER_JVMFLAGS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8989 -Dzookeeper.jmx.log4j.disable=true -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.access.file=</path/to/jmxremote.access/file> -Dcom.sun.management.jmxremote.password.file=</path/to/jmxremote.password/file> -Dcom.sun.management.jmxremote.ssl=true -Dcom.sun.management.jmxremote.registry.ssl=true -Djavax.net.ssl.keyStore=</path/to/keystore.jks/file> -Djavax.net.ssl.keyStorePassword=<Keystore Password> -Djavax.net.ssl.trustStore=</path/to/truststore.jks/file> -Djavax.net.ssl.trustStorePassword=<Truststore Password>"
Change the values of with appropriate values.<>
Result
- ZooKeeper exposes JMX metrics on the configured port.
- JMX can be secured with Basic Auth and/or TLS as required.

Have a suggestion?