Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Solr, Adding a Javaagent

avatar
Contributor

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
Contributor

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
Contributor

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 \
"