Enable JMXTrans Agent

By default, Pulse uses PulseJMX to collect JMX metrics from services such as HiveServer2, Impala, ResourceManager, etc.

In some environments, you might encounter JMX port conflicts when multiple JVM processes try to bind to the same static port.

If you face these conflicts, you can replace PulseJMX with JMXTrans-Agent for metrics collection.

Background

PulseJMX relies on a statically assigned JMX port, such as:

-Dcom.sun.management.jmxremote.port=8008

In certain setups—such as Hadoop MapReduce running in local mode—multiple JVM processes run on the same host.

Each process tries to bind to the same port (for example, 8008), which causes port binding errors and prevents metrics collection.

Dynamic port assignment (for example, -Dcom.sun.management.jmxremote.port=0) is not supported by PulseJMX because it requires a known port to collect data.

Alternative: Use JMXTrans-Agent

If port conflicts occur, use JMXTrans-Agent instead of PulseJMX.

JMXTrans-Agent is a lightweight Java agent that runs inside the JVM and sends JMX metrics directly to VictoriaMetrics without using any external ports.

Key Benefits:

  • No port conflicts — metrics are collected in-process.
  • Simple setup — no need for fixed JMX ports.
  • Direct export — sends metrics straight to VictoriaMetrics.
  • Works reliably in multi-process environments.

How to Enable?

To use the JMXTrans Agent, complete the following steps to enable JMX metrics collection.

Disable the existing PulseJMX Agent

To disable the PulseJMX agent, update the configuration as follows:

  1. Add or update the following setting:

    • For Docker-based deployment: Edit the override.yml file on the Pulse node.
    • For Kubernetes-based deployment: In the Admin UI, on the Home page, select the configured cluster → Configuration tab, and update the VARs YAML section.
  2. Reconfigure the cluster to apply the changes.

  3. Verify that the pulsejmx agent is no longer running.

Load the JMXTrans Java Agent

When the Hydra Agent is deployed (via SSH or Parcel), it automatically copies the JMXTrans Agent JAR and configuration files for all enabled services to the Hadoop nodes, located in /opt/acceldata/jmx/config/enabled/.

To collect JMX metrics for any service using the JMXTrans Agent, the Java agent must be loaded into the JVM process of that service.

Add the following line to the JAVA_OPTS of the service for which you want to enable JMX metrics collection:

Bash
Copy

Example:

To collect ZooKeeper metrics, add the following line to the JAVA_OPTS for ZooKeeper:

Bash
Copy

The name of the JAVA_OPTS variable can vary depending on the service. For example, it is SERVER_JVMFLAGS for ZooKeeper and KAFKA_OPTS for Kafka.

All XML configuration files for supported services are located at: /opt/acceldata/jmx/config/enabled.

Update the Service Configuration

You can update the JAVA_OPTS for a service through Ambari or Cloudera Manager.

Example (Ambari):

  1. In the Ambari UI, select ZooKeeper.
  1. Click Configs.
  1. Open the ZooKeeper Env Template.
  2. Append the above configuration line to the SERVER_JVMFLAGS property.
  1. Restart the ZooKeeper service for the new JVM arguments to take effect.

Verify Metrics Collection

After a restart, the Java agent automatically starts sending metrics to VictoriaMetrics based on the configured polling interval.

Repeat these steps for all other services that need to use the new JMXTrans Agent.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard