Skip to content

ZooKeeper

Auto-Discovery
Health Check
Metrics
Logs

The agent uses a ZooKeeper check if the service listen on port 2181.

The status check uses the ruok command, you may need to add it to the whitelist in 4lw.commands.whitelist, see the documentation for details.

To enable metrics gathering, Bleemeo agent needs to be installed with JMX enabled, see Java Metrics for setup details.

To gather JMX metrics, ZooKeeper must expose JMX over a TCP port. To enable JMX you will need to:

  • If using Docker for ZooKeeper, add environment variable JMXPORT=1234
  • In other cases, add the option -Dcom.sun.management.jmxremote.port=1234 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false to the JVM. Usually in JAVA_OPTS in /etc/default/zookeeper.

Warning: in both case, this will allow unauthenticated access. Make sure no untrusted access to this port is possible or you should setup authenticated JMX access.

If some auto-detected parameters are wrong, you can manually override them by adding the following to /etc/glouton/conf.d/99-local.conf:

service:
[...]
# For a ZooKeeper running outside a container
- type: "zookeeper"
address: "127.0.0.1"
port: 2181
jmx_port: "JMX_PORT"
jmx_username: "monitorRole" # by default, no authentication is done
jmx_password: "secret"
# For an additional ZooKeeper running outside a container
- type: "zookeeper"
instance: "NAME_ASSOCIATED_WITH_YOUR_ADDITIONAL_SERVICE"
address: "127.0.0.1"
port: 2182
jmx_port: "JMX_PORT"
jmx_username: "monitorRole" # by default, no authentication is done
jmx_password: "secret"
# For a ZooKeeper running in a Docker container
- type: "zookeeper"
instance: "CONTAINER_NAME"
address: "172.17.0.2"
port: 2181
jmx_port: "JMX_PORT"
jmx_username: "monitorRole" # by default, no authentication is done
jmx_password: "secret"

Agent gathers the following metrics:

MetricDescription
service_statusStatus of ZooKeeper
zookeeper_connectionsNumber of client connections to ZooKeeper server
zookeeper_packets_receivedNumber of packets received sent per second
zookeeper_packets_sentNumber of packets sent per second
zookeeper_ephemerals_countNumber of ephemeral node
zookeeper_watch_countNumber of ZooKeeper watch
zookeeper_znode_countNumber of znode

Agent gathers the following metrics through JMX:

MetricDescription
zookeeper_jvm_gcNumber of garbage collection per second
zookeeper_jvm_gc_utilizationGarbage collection utilization in percent
zookeeper_jvm_heap_usedHeap memory used in bytes
zookeeper_jvm_non_heap_usedNon-Heap memory used in bytes