Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Solr, Adding a Javaagent

avatar

Hi,

Probably a simple question. I am attempting to run a javaagent in the form of the jmx metrics exporter to prometheus jar file. I can kick off the java agent manually on each server but it would be preferred if I could add the command to the Solr Env file so Ambari manages start/stop of it with Solr.

Here is the working syntax I use when starting Solr not managed by Ambari. I am not sure where to add this on Solr's Ambari configuration as I have not been successful in getting it to work yet.

-a "-javaagent:/incubate/solr_jmx/solr-7.1.0/jmx/jmx_prometheus_javaagent-0.1.0.jar=7500:/incubate/solr_jmx/solr-7.1.0/jmx/config.yml"

Any help is appreciated!

1 ACCEPTED SOLUTION

avatar

Hey Kevin, I have tried this syntax. It allows SOLR to load but it does not kick off the agent. I added my line to the JAVA_MEM variable in ambari and that seems to work. This issue is solved for me. Thank you for taking the time to comment.

# Increase Java Min/Max Heap as needed to support your indexing / query needs
SOLR_JAVA_MEM="-Xms{{solr_min_mem}}m -Xmx{{solr_max_mem}}m \
-javaagent:/data/solr_jmx_exporter/jmx_prometheus_javaagent-0.10.jar=7500:/data/solr_jmx_exporter/solr_jmx_exporter.yml \
"

View solution in original post

2 REPLIES 2

avatar
Rising Star

In Ambari under Solr there is a box for environment stuff. I don't have Ambari in front of me right now but you should be able to add a line like so:

SOLR_OPTS="$SOLR_OPTS -javaagent...."

avatar

Hey Kevin, I have tried this syntax. It allows SOLR to load but it does not kick off the agent. I added my line to the JAVA_MEM variable in ambari and that seems to work. This issue is solved for me. Thank you for taking the time to comment.

# Increase Java Min/Max Heap as needed to support your indexing / query needs
SOLR_JAVA_MEM="-Xms{{solr_min_mem}}m -Xmx{{solr_max_mem}}m \
-javaagent:/data/solr_jmx_exporter/jmx_prometheus_javaagent-0.10.jar=7500:/data/solr_jmx_exporter/solr_jmx_exporter.yml \
"