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.
Bash
Copy
  1. Reconfigure the cluster to apply the changes.
  2. 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 in the Ambari UI:

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 Java Options for Services Using JMX Agent

You can update the Java options for the services through the Ambari UI.

Below are detailed, service-wise details for all services supported by the JMX agent.

Cruise Control

  1. In the Ambari UI, go to Kafka → Advanced → cruise-control-env template.
  2. Add the following line at the end of the template:
Bash
Copy

Cruise Control 3

  1. In the Ambari UI, go to Kafka3 → Advanced → cruise-control3-env template.
  2. Add the following line at the end of the template:
Bash
Copy

Hive Metastore

  1. In the Ambari UI, go to Hive → Advanced → hive-env template
  2. Add the following line inside the section: if [ "$SERVICE" = "metastore" ].
Bash
Copy

Hive Server

  1. In the Ambari UI, go to Hive → Advanced → hive-env template.
  2. Add the following line inside the section: if [ "$SERVICE" = "hiveserver2" ].
Bash
Copy

Kafka

If Kafka Connect is NOT enabled:

  1. Go to Kafka → Advanced → kafka-env template
  2. Add the following line at the end:
Bash
Copy

If Kafka Connect is enabled:

Add the following snippet at the end of the kafka-env template:

Bash
Copy

Kafka 3

If Kafka Connect is NOT enabled:

  1. Go to Kafka3 → Advanced → kafka-env template
  2. Add the following line at the end:
Bash
Copy

If Kafka Connect is enabled:

Add the following snippet:

Bash
Copy

Kafka Connect

  1. Go to Kafka → Advanced → kafka-env template
  2. Add the following snippet at the end:
Bash
Copy

Kafka3 Connect

  1. Go to Kafka3 → Advanced → kafka3-env template.
  2. Add the following snippet at the end:
Bash
Copy

Kafka MirrorMaker2

  1. Go to Kafka → Advanced → kafka-mirrormaker2-env
  2. Add the following line at the end:
Bash
Copy

Kafka3 MirrorMaker2

  1. Go to Kafka3 → Advanced → kafka-mirrormaker2-env
  2. Add the following line at the end:
Bash
Copy

Pinot Broker

  1. Go to Pinot Broker → Java Virtual Machine (JVM) Options
  2. Add the following line at the end:
Bash
Copy

Pinot Controller

  1. Go to Pinot Controller → Java Virtual Machine (JVM) Options
  2. Add the following line at the end:
Bash
Copy

Pinot Server

  1. Go to Pinot Server → Java Virtual Machine (JVM) Options
  2. Add the following line at the end:
Bash
Copy

Ranger (Admin, Tagsync, Usersync)

  1. Go to Ranger → Advanced → ranger-env template

Ranger Admin

Add the line below in the {% if is_ranger_admin_host %} section:

Bash
Copy

Ranger Tagsync

For Tagsync, add the below line in the {% if is_ranger_tagsync_host %} section:

Bash
Copy

Ranger Usersync

For Usersync, add the line below in the {% if is_ranger_usersync_host %} section:

Bash
Copy

Schema Registry

  1. Go to Schema Registry → registry-env template
  2. Add the following line at the end:
Bash
Copy

Trino (Coordinator and Worker)

  1. Go to Trino → JVM Config file
  2. Add the following snippet at the end:
Bash
Copy

Zookeeper

  1. Go to Zookeeper → Advanced → zookeeper-env template
  2. Add the following line at the end:
Bash
Copy

Zeppelin Master

  1. Go to Zeppelin → zeppelin_env_content
  2. Add the following line at the end:
Bash
Copy

Verify Metrics Collection

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

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