Skip to content
BleemeoBleemeo

ZooKeeper

Auto-Detection
Health Check
Built-in Metrics

Bleemeo monitors Apache ZooKeeper through automatic service detection, health checks via the ruok command, and built-in metrics collection including JMX.

Glouton automatically detects ZooKeeper instances listening on port 2181.

The health check uses the ruok command. You may need to add it to 4lw.commands.whitelist in your ZooKeeper configuration. See the ZooKeeper documentation for details.

To enable JMX metrics, ZooKeeper must expose JMX over a TCP port and Glouton must be installed with JMX enabled. See Java JMX Metrics for setup details.

To expose JMX:

  • If using Docker, add the environment variable JMXPORT=1234.
  • Otherwise, add -Dcom.sun.management.jmxremote.port=1234 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false to the JVM options (usually JAVA_OPTS in /etc/default/zookeeper).

If the auto-detected parameters are incorrect, you can override them manually.

Terminal window
sudo tee /etc/glouton/conf.d/99-zookeeper.conf > /dev/null << 'EOF'
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"
EOF

Glouton performs a health check using the ZooKeeper ruok command on port 2181.

MetricDescription
service_statusStatus of ZooKeeper
MetricDescription
zookeeper_connectionsNumber of client connections to the ZooKeeper server
zookeeper_packets_receivedNumber of packets received per second
zookeeper_packets_sentNumber of packets sent per second
zookeeper_ephemerals_countNumber of ephemeral nodes
zookeeper_watch_countNumber of ZooKeeper watches
zookeeper_znode_countNumber of znodes

The following metrics are gathered through JMX:

MetricDescription
zookeeper_jvm_gcNumber of garbage collections 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