# Adding Java agent to ES?

**URL:** <https://discuss.elastic.co/t/adding-java-agent-to-es/6338>\
**Category:** Elasticsearch\
**Created:** [January 10, 2012, 7:20pm UTC](https://discuss.elastic.co/t/adding-java-agent-to-es/6338 "2012-01-10T19:20:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)\
**Post date:** [January 10, 2012, 7:20pm UTC](https://discuss.elastic.co/t/adding-java-agent-to-es/6338/1 "2012-01-10T19:20:38Z")

</div>

Hello,

I would like to add a Java agent to ES, but I'm having difficulties  
with that.  
Where should I add my Java agent params so that they apply to the JVM  
in which ES/org.elasticsearch.bootstrap.Bootstrap runs?

This is what I did:

- I added the following to bin/service/elasticsearch.conf:  
wrapper.java.additional.13=-Dcom.sun.management.jmxremote -  
javaagent:/path/to/my-agent.jar

- I restarted ES and indeed I saw my JVM params there

But my agent doesn't seem to be used.  
My suspicion is this is due to that wrapper app that seems to spawn a  
separate JVM to run ES in, and when it does that my params are somehow  
not passed through.  
(I think this is what the poster in  
[https://groups.google.com/group/elasticsearch/browse\_thread/thread/191555382c69ec8d/cfce325b47e839dd](https://groups.google.com/group/elasticsearch/browse_thread/thread/191555382c69ec8d/cfce325b47e839dd)  
was asking about)

Maybe I should add my Java agent elsewhere so they apply to the JVM in  
which ES/org.elasticsearch.bootstrap.Bootstrap runs?

This is what ES-related processes look like:

mom 12931 0.0 0.0 114476 1336 ? Sl 07:07 0:00 /usr/  
share/es/bin/service/exec/elasticsearch-linux-x86-64 /usr/share/es/bin/  
service/elasticsearch.conf wrapper.syslog.ident=elasticsearch  
wrapper.pidfile=/usr/share/es/bin/service/./elasticsearch.pid  
wrapper.name=elasticsearch wrapper.displayname=ElasticSearch  
wrapper.daemonize=TRUE wrapper.statusfile=/usr/share/es/bin/service/./  
elasticsearch.status wrapper.java.statusfile=/usr/share/es/bin/  
service/./elasticsearch.java.status wrapper.lockfile=/var/lock/subsys/  
elasticsearch

mom 12933 57.8 6.2 21743764 8317164 ? Sl 07:07 31:19 java -  
Delasticsearch-service -Des-foreground=yes -Des.path.home=/usr/share/  
es -Djline.enabled=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:  
+CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -  
XX:MaxTenuringThreshold=1 -XX:CMSInitiatingOccupancyFraction=75 -XX:  
+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -  
Dcom.sun.management.jmxremote -javaagent:/path/to/my-agent.jar -  
Xms2048m -Xmx8192m -Djava.library.path=/usr/share/es/bin/service/lib -  
classpath /usr/share/es/bin/service/lib/wrapper.jar:/usr/share/es/lib/  
elasticsearch-0.18.5.jar:/usr/share/es/lib/jline-0.9.94.jar:/usr/share/  
es/lib/jna-3.2.7.jar:/usr/share/es/lib/log4j-1.2.16.jar:/usr/share/es/  
lib/lucene-analyzers-3.5.0.jar:/usr/share/es/lib/lucene-  
core-3.5.0.jar:/usr/share/es/lib/lucene-highlighter-3.5.0.jar:/usr/  
share/es/lib/lucene-memory-3.5.0.jar:/usr/share/es/lib/lucene-  
queries-3.5.0.jar:/usr/share/es/lib/sigar/sigar-1.6.4.jar -  
Dwrapper.key=D6Sh-S2rSnlGvA6H -Dwrapper.port=32000 -  
Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -  
Dwrapper.disable\_console\_input=TRUE -Dwrapper.pid=12931 -  
Dwrapper.version=3.5.6 -Dwrapper.native\_library=wrapper -  
Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1  
org.tanukisoftware.wrapper.WrapperSimpleApp  
org.elasticsearch.bootstrap.Bootstrap

Thanks,  
Otis

---

<div class="post-metadata">

**Author:** ![plaflamme](https://avatars.discourse-cdn.com/v4/letter/p/a88e57/32.png) [@plaflamme](https://discuss.elastic.co/u/plaflamme)\
**Post date:** [January 10, 2012, 7:49pm UTC](https://discuss.elastic.co/t/adding-java-agent-to-es/6338/2 "2012-01-10T19:49:19Z")

</div>

Setting JAVA\_OPTS works fine:

# JAVA\_OPTS="-Xdebug -Xrunjdwp:transport=dt\_socket,server=y,address=8000"

./bin/elasticsearch -f

On Tue, Jan 10, 2012 at 14:20, Otis Gospodnetic  
[otis.gospodnetic@gmail.com](mailto:otis.gospodnetic@gmail.com)wrote:

> Hello,
> 
> I would like to add a Java agent to ES, but I'm having difficulties  
> with that.  
> Where should I add my Java agent params so that they apply to the JVM  
> in which ES/org.elasticsearch.bootstrap.Bootstrap runs?
> 
> This is what I did:
> 
> - I added the following to bin/service/elasticsearch.conf:  
> wrapper.java.additional.13=-Dcom.sun.management.jmxremote -  
> javaagent:/path/to/my-agent.jar
> 
> - I restarted ES and indeed I saw my JVM params there
> 
> But my agent doesn't seem to be used.  
> My suspicion is this is due to that wrapper app that seems to spawn a  
> separate JVM to run ES in, and when it does that my params are somehow  
> not passed through.  
> (I think this is what the poster in
> 
> [https://groups.google.com/group/elasticsearch/browse\_thread/thread/191555382c69ec8d/cfce325b47e839dd](https://groups.google.com/group/elasticsearch/browse_thread/thread/191555382c69ec8d/cfce325b47e839dd)  
> was asking about)
> 
> Maybe I should add my Java agent elsewhere so they apply to the JVM in  
> which ES/org.elasticsearch.bootstrap.Bootstrap runs?
> 
> This is what ES-related processes look like:
> 
> mom 12931 0.0 0.0 114476 1336 ? Sl 07:07 0:00 /usr/  
> share/es/bin/service/exec/elasticsearch-linux-x86-64 /usr/share/es/bin/  
> service/elasticsearch.conf wrapper.syslog.ident=elasticsearch  
> wrapper.pidfile=/usr/share/es/bin/service/./elasticsearch.pid  
> wrapper.name=elasticsearch wrapper.displayname=Elasticsearch  
> wrapper.daemonize=TRUE wrapper.statusfile=/usr/share/es/bin/service/./  
> elasticsearch.status wrapper.java.statusfile=/usr/share/es/bin/  
> service/./elasticsearch.java.status wrapper.lockfile=/var/lock/subsys/  
> elasticsearch
> 
> mom 12933 57.8 6.2 21743764 8317164 ? Sl 07:07 31:19 java -  
> Delasticsearch-service -Des-foreground=yes -Des.path.home=/usr/share/  
> es -Djline.enabled=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:  
> +CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -  
> XX:MaxTenuringThreshold=1 -XX:CMSInitiatingOccupancyFraction=75 -XX:  
> +UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -  
> Dcom.sun.management.jmxremote -javaagent:/path/to/my-agent.jar -  
> Xms2048m -Xmx8192m -Djava.library.path=/usr/share/es/bin/service/lib -  
> classpath /usr/share/es/bin/service/lib/wrapper.jar:/usr/share/es/lib/  
> elasticsearch-0.18.5.jar:/usr/share/es/lib/jline-0.9.94.jar:/usr/share/  
> es/lib/jna-3.2.7.jar:/usr/share/es/lib/log4j-1.2.16.jar:/usr/share/es/  
> lib/lucene-analyzers-3.5.0.jar:/usr/share/es/lib/lucene-  
> core-3.5.0.jar:/usr/share/es/lib/lucene-highlighter-3.5.0.jar:/usr/  
> share/es/lib/lucene-memory-3.5.0.jar:/usr/share/es/lib/lucene-  
> queries-3.5.0.jar:/usr/share/es/lib/sigar/sigar-1.6.4.jar -  
> Dwrapper.key=D6Sh-S2rSnlGvA6H -Dwrapper.port=32000 -  
> Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -  
> Dwrapper.disable\_console\_input=TRUE -Dwrapper.pid=12931 -  
> Dwrapper.version=3.5.6 -Dwrapper.native\_library=wrapper -  
> Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1  
> org.tanukisoftware.wrapper.WrapperSimpleApp  
> org.elasticsearch.bootstrap.Bootstrap
> 
> Thanks,  
> Otis

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [January 10, 2012, 10:04pm UTC](https://discuss.elastic.co/t/adding-java-agent-to-es/6338/3 "2012-01-10T22:04:53Z")

</div>

Yea, it might be related to the service wrapper, just use the regular  
script to start it (and ES\_JAVA\_OPTS is preferable, since then it keeps the  
regular JAVA\_OPTS as well).

On Tue, Jan 10, 2012 at 9:49 PM, Philippe Laflamme \<  
[philippe.laflamme@obiba.org](mailto:philippe.laflamme@obiba.org)\> wrote:

> Setting JAVA\_OPTS works fine:
> 
> # JAVA\_OPTS="-Xdebug -Xrunjdwp:transport=dt\_socket,server=y,address=8000"
> 
> ./bin/elasticsearch -f
> 
> On Tue, Jan 10, 2012 at 14:20, Otis Gospodnetic \<  
> [otis.gospodnetic@gmail.com](mailto:otis.gospodnetic@gmail.com)\> wrote:
> 
> > Hello,
> > 
> > I would like to add a Java agent to ES, but I'm having difficulties  
> > with that.  
> > Where should I add my Java agent params so that they apply to the JVM  
> > in which ES/org.elasticsearch.bootstrap.Bootstrap runs?
> > 
> > This is what I did:
> > 
> > - I added the following to bin/service/elasticsearch.conf:  
> > wrapper.java.additional.13=-Dcom.sun.management.jmxremote -  
> > javaagent:/path/to/my-agent.jar
> > 
> > - I restarted ES and indeed I saw my JVM params there
> > 
> > But my agent doesn't seem to be used.  
> > My suspicion is this is due to that wrapper app that seems to spawn a  
> > separate JVM to run ES in, and when it does that my params are somehow  
> > not passed through.  
> > (I think this is what the poster in
> > 
> > [https://groups.google.com/group/elasticsearch/browse\_thread/thread/191555382c69ec8d/cfce325b47e839dd](https://groups.google.com/group/elasticsearch/browse_thread/thread/191555382c69ec8d/cfce325b47e839dd)  
> > was asking about)
> > 
> > Maybe I should add my Java agent elsewhere so they apply to the JVM in  
> > which ES/org.elasticsearch.bootstrap.Bootstrap runs?
> > 
> > This is what ES-related processes look like:
> > 
> > mom 12931 0.0 0.0 114476 1336 ? Sl 07:07 0:00 /usr/  
> > share/es/bin/service/exec/elasticsearch-linux-x86-64 /usr/share/es/bin/  
> > service/elasticsearch.conf wrapper.syslog.ident=elasticsearch  
> > wrapper.pidfile=/usr/share/es/bin/service/./elasticsearch.pid  
> > wrapper.name=elasticsearch wrapper.displayname=Elasticsearch  
> > wrapper.daemonize=TRUE wrapper.statusfile=/usr/share/es/bin/service/./  
> > elasticsearch.status wrapper.java.statusfile=/usr/share/es/bin/  
> > service/./elasticsearch.java.status wrapper.lockfile=/var/lock/subsys/  
> > elasticsearch
> > 
> > mom 12933 57.8 6.2 21743764 8317164 ? Sl 07:07 31:19 java -  
> > Delasticsearch-service -Des-foreground=yes -Des.path.home=/usr/share/  
> > es -Djline.enabled=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:  
> > +CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -  
> > XX:MaxTenuringThreshold=1 -XX:CMSInitiatingOccupancyFraction=75 -XX:  
> > +UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -  
> > Dcom.sun.management.jmxremote -javaagent:/path/to/my-agent.jar -  
> > Xms2048m -Xmx8192m -Djava.library.path=/usr/share/es/bin/service/lib -  
> > classpath /usr/share/es/bin/service/lib/wrapper.jar:/usr/share/es/lib/  
> > elasticsearch-0.18.5.jar:/usr/share/es/lib/jline-0.9.94.jar:/usr/share/  
> > es/lib/jna-3.2.7.jar:/usr/share/es/lib/log4j-1.2.16.jar:/usr/share/es/  
> > lib/lucene-analyzers-3.5.0.jar:/usr/share/es/lib/lucene-  
> > core-3.5.0.jar:/usr/share/es/lib/lucene-highlighter-3.5.0.jar:/usr/  
> > share/es/lib/lucene-memory-3.5.0.jar:/usr/share/es/lib/lucene-  
> > queries-3.5.0.jar:/usr/share/es/lib/sigar/sigar-1.6.4.jar -  
> > Dwrapper.key=D6Sh-S2rSnlGvA6H -Dwrapper.port=32000 -  
> > Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -  
> > Dwrapper.disable\_console\_input=TRUE -Dwrapper.pid=12931 -  
> > Dwrapper.version=3.5.6 -Dwrapper.native\_library=wrapper -  
> > Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1  
> > org.tanukisoftware.wrapper.WrapperSimpleApp  
> > org.elasticsearch.bootstrap.Bootstrap
> > 
> > Thanks,  
> > Otis

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [March 21, 2012, 7:03pm UTC](https://discuss.elastic.co/t/adding-java-agent-to-es/6338/4 "2012-03-21T19:03:04Z")

</div>

Bringing up this old post since that I can clarify: does the wrapper  
ignore JAVA\_OPTS and ES\_JAVA\_OPTS?

## Even tried setting set.default.ES\_JAVA\_OPTS="..." but none of my changes seem to take effect.

Ivan

On Tue, Jan 10, 2012 at 2:04 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> Yea, it might be related to the service wrapper, just use the regular script  
> to start it (and ES\_JAVA\_OPTS is preferable, since then it keeps the regular  
> JAVA\_OPTS as well).
> 
> On Tue, Jan 10, 2012 at 9:49 PM, Philippe Laflamme  
> [philippe.laflamme@obiba.org](mailto:philippe.laflamme@obiba.org) wrote:
> 
> > Setting JAVA\_OPTS works fine:
> > 
> > # JAVA\_OPTS="-Xdebug -Xrunjdwp:transport=dt\_socket,server=y,address=8000"
> > 
> > ./bin/elasticsearch -f
> > 
> > On Tue, Jan 10, 2012 at 14:20, Otis Gospodnetic  
> > [otis.gospodnetic@gmail.com](mailto:otis.gospodnetic@gmail.com) wrote:
> > 
> > > Hello,
> > > 
> > > I would like to add a Java agent to ES, but I'm having difficulties  
> > > with that.  
> > > Where should I add my Java agent params so that they apply to the JVM  
> > > in which ES/org.elasticsearch.bootstrap.Bootstrap runs?
> > > 
> > > This is what I did:
> > > 
> > > - I added the following to bin/service/elasticsearch.conf:  
> > > wrapper.java.additional.13=-Dcom.sun.management.jmxremote -  
> > > javaagent:/path/to/my-agent.jar
> > > 
> > > - I restarted ES and indeed I saw my JVM params there
> > > 
> > > But my agent doesn't seem to be used.  
> > > My suspicion is this is due to that wrapper app that seems to spawn a  
> > > separate JVM to run ES in, and when it does that my params are somehow  
> > > not passed through.  
> > > (I think this is what the poster in
> > > 
> > > [https://groups.google.com/group/elasticsearch/browse\_thread/thread/191555382c69ec8d/cfce325b47e839dd](https://groups.google.com/group/elasticsearch/browse_thread/thread/191555382c69ec8d/cfce325b47e839dd)  
> > > was asking about)
> > > 
> > > Maybe I should add my Java agent elsewhere so they apply to the JVM in  
> > > which ES/org.elasticsearch.bootstrap.Bootstrap runs?
> > > 
> > > This is what ES-related processes look like:
> > > 
> > > mom 12931 0.0 0.0 114476 1336 ? Sl 07:07 0:00 /usr/  
> > > share/es/bin/service/exec/elasticsearch-linux-x86-64 /usr/share/es/bin/  
> > > service/elasticsearch.conf wrapper.syslog.ident=elasticsearch  
> > > wrapper.pidfile=/usr/share/es/bin/service/./elasticsearch.pid  
> > > wrapper.name=elasticsearch wrapper.displayname=Elasticsearch  
> > > wrapper.daemonize=TRUE wrapper.statusfile=/usr/share/es/bin/service/./  
> > > elasticsearch.status wrapper.java.statusfile=/usr/share/es/bin/  
> > > service/./elasticsearch.java.status wrapper.lockfile=/var/lock/subsys/  
> > > elasticsearch
> > > 
> > > mom 12933 57.8 6.2 21743764 8317164 ? Sl 07:07 31:19 java -  
> > > Delasticsearch-service -Des-foreground=yes -Des.path.home=/usr/share/  
> > > es -Djline.enabled=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:  
> > > +CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -  
> > > XX:MaxTenuringThreshold=1 -XX:CMSInitiatingOccupancyFraction=75 -XX:  
> > > +UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -  
> > > Dcom.sun.management.jmxremote -javaagent:/path/to/my-agent.jar -  
> > > Xms2048m -Xmx8192m -Djava.library.path=/usr/share/es/bin/service/lib -  
> > > classpath /usr/share/es/bin/service/lib/wrapper.jar:/usr/share/es/lib/  
> > > elasticsearch-0.18.5.jar:/usr/share/es/lib/jline-0.9.94.jar:/usr/share/  
> > > es/lib/jna-3.2.7.jar:/usr/share/es/lib/log4j-1.2.16.jar:/usr/share/es/  
> > > lib/lucene-analyzers-3.5.0.jar:/usr/share/es/lib/lucene-  
> > > core-3.5.0.jar:/usr/share/es/lib/lucene-highlighter-3.5.0.jar:/usr/  
> > > share/es/lib/lucene-memory-3.5.0.jar:/usr/share/es/lib/lucene-  
> > > queries-3.5.0.jar:/usr/share/es/lib/sigar/sigar-1.6.4.jar -  
> > > Dwrapper.key=D6Sh-S2rSnlGvA6H -Dwrapper.port=32000 -  
> > > Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -  
> > > Dwrapper.disable\_console\_input=TRUE -Dwrapper.pid=12931 -  
> > > Dwrapper.version=3.5.6 -Dwrapper.native\_library=wrapper -  
> > > Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1  
> > > org.tanukisoftware.wrapper.WrapperSimpleApp  
> > > org.elasticsearch.bootstrap.Bootstrap
> > > 
> > > Thanks,  
> > > Otis

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 22, 2012, 6:22pm UTC](https://discuss.elastic.co/t/adding-java-agent-to-es/6338/5 "2012-03-22T18:22:51Z")

</div>

The wrapper has its own configuration to provide options to the JVM in its  
conf file. It does not respect the env vars.

On Wed, Mar 21, 2012 at 9:03 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> Bringing up this old post since that I can clarify: does the wrapper  
> ignore JAVA\_OPTS and ES\_JAVA\_OPTS?
> 
> ## Even tried setting set.default.ES\_JAVA\_OPTS="..." but none of my changes seem to take effect.
> 
> Ivan
> 
> On Tue, Jan 10, 2012 at 2:04 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > Yea, it might be related to the service wrapper, just use the regular  
> > script  
> > to start it (and ES\_JAVA\_OPTS is preferable, since then it keeps the  
> > regular  
> > JAVA\_OPTS as well).
> > 
> > On Tue, Jan 10, 2012 at 9:49 PM, Philippe Laflamme  
> > [philippe.laflamme@obiba.org](mailto:philippe.laflamme@obiba.org) wrote:
> > 
> > > Setting JAVA\_OPTS works fine:
> > > 
> > > # JAVA\_OPTS="-Xdebug
> 
> -Xrunjdwp:transport=dt\_socket,server=y,address=8000"
> 
> > > ./bin/elasticsearch -f
> > > 
> > > On Tue, Jan 10, 2012 at 14:20, Otis Gospodnetic  
> > > [otis.gospodnetic@gmail.com](mailto:otis.gospodnetic@gmail.com) wrote:
> > > 
> > > > Hello,
> > > > 
> > > > I would like to add a Java agent to ES, but I'm having difficulties  
> > > > with that.  
> > > > Where should I add my Java agent params so that they apply to the JVM  
> > > > in which ES/org.elasticsearch.bootstrap.Bootstrap runs?
> > > > 
> > > > This is what I did:
> > > > 
> > > > - I added the following to bin/service/elasticsearch.conf:  
> > > > wrapper.java.additional.13=-Dcom.sun.management.jmxremote -  
> > > > javaagent:/path/to/my-agent.jar
> > > > 
> > > > - I restarted ES and indeed I saw my JVM params there
> > > > 
> > > > But my agent doesn't seem to be used.  
> > > > My suspicion is this is due to that wrapper app that seems to spawn a  
> > > > separate JVM to run ES in, and when it does that my params are somehow  
> > > > not passed through.  
> > > > (I think this is what the poster in
> 
> [https://groups.google.com/group/elasticsearch/browse\_thread/thread/191555382c69ec8d/cfce325b47e839dd](https://groups.google.com/group/elasticsearch/browse_thread/thread/191555382c69ec8d/cfce325b47e839dd)
> 
> > > > was asking about)
> > > > 
> > > > Maybe I should add my Java agent elsewhere so they apply to the JVM in  
> > > > which ES/org.elasticsearch.bootstrap.Bootstrap runs?
> > > > 
> > > > This is what ES-related processes look like:
> > > > 
> > > > mom 12931 0.0 0.0 114476 1336 ? Sl 07:07 0:00 /usr/  
> > > > share/es/bin/service/exec/elasticsearch-linux-x86-64 /usr/share/es/bin/  
> > > > service/elasticsearch.conf wrapper.syslog.ident=elasticsearch  
> > > > wrapper.pidfile=/usr/share/es/bin/service/./elasticsearch.pid  
> > > > wrapper.name=elasticsearch wrapper.displayname=Elasticsearch  
> > > > wrapper.daemonize=TRUE wrapper.statusfile=/usr/share/es/bin/service/./  
> > > > elasticsearch.status wrapper.java.statusfile=/usr/share/es/bin/  
> > > > service/./elasticsearch.java.status wrapper.lockfile=/var/lock/subsys/  
> > > > elasticsearch
> > > > 
> > > > mom 12933 57.8 6.2 21743764 8317164 ? Sl 07:07 31:19 java -  
> > > > Delasticsearch-service -Des-foreground=yes -Des.path.home=/usr/share/  
> > > > es -Djline.enabled=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:  
> > > > +CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -  
> > > > XX:MaxTenuringThreshold=1 -XX:CMSInitiatingOccupancyFraction=75 -XX:  
> > > > +UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -  
> > > > Dcom.sun.management.jmxremote -javaagent:/path/to/my-agent.jar -  
> > > > Xms2048m -Xmx8192m -Djava.library.path=/usr/share/es/bin/service/lib -  
> > > > classpath /usr/share/es/bin/service/lib/wrapper.jar:/usr/share/es/lib/  
> > > > elasticsearch-0.18.5.jar:/usr/share/es/lib/jline-0.9.94.jar:/usr/share/  
> > > > es/lib/jna-3.2.7.jar:/usr/share/es/lib/log4j-1.2.16.jar:/usr/share/es/  
> > > > lib/lucene-analyzers-3.5.0.jar:/usr/share/es/lib/lucene-  
> > > > core-3.5.0.jar:/usr/share/es/lib/lucene-highlighter-3.5.0.jar:/usr/  
> > > > share/es/lib/lucene-memory-3.5.0.jar:/usr/share/es/lib/lucene-  
> > > > queries-3.5.0.jar:/usr/share/es/lib/sigar/sigar-1.6.4.jar -  
> > > > Dwrapper.key=D6Sh-S2rSnlGvA6H -Dwrapper.port=32000 -  
> > > > Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -  
> > > > Dwrapper.disable\_console\_input=TRUE -Dwrapper.pid=12931 -  
> > > > Dwrapper.version=3.5.6 -Dwrapper.native\_library=wrapper -  
> > > > Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1  
> > > > org.tanukisoftware.wrapper.WrapperSimpleApp  
> > > > org.elasticsearch.bootstrap.Bootstrap
> > > > 
> > > > Thanks,  
> > > > Otis

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [March 22, 2012, 11:03pm UTC](https://discuss.elastic.co/t/adding-java-agent-to-es/6338/6 "2012-03-22T23:03:01Z")

</div>

That is what I assumed. Are the vars defined in  
bin/service/elasticsearch.conf whitelisted, or will any line prefixed  
with set.default.\* be "converted" to a variable?

eg.:  
If set.default.ES\_MIN\_MEM sets the ES\_MIN\_MEM variable, does  
set.default.ES\_JAVA\_OPTS accomplish the same?

It appears that the vars defined on top of the file are only used in  
context of that file. Does the wrapper even call bin/elasticsearch? If  
env vars are not respected, then probably not.

What is the best way to add an agent using a wrapper?

Cheers,

Ivan

On Thu, Mar 22, 2012 at 11:22 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> The wrapper has its own configuration to provide options to the JVM in its  
> conf file. It does not respect the env vars.
> 
> On Wed, Mar 21, 2012 at 9:03 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> 
> > Bringing up this old post since that I can clarify: does the wrapper  
> > ignore JAVA\_OPTS and ES\_JAVA\_OPTS?
> > 
> > ## Even tried setting set.default.ES\_JAVA\_OPTS="..." but none of my changes seem to take effect.
> > 
> > Ivan
> > 
> > On Tue, Jan 10, 2012 at 2:04 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > 
> > > Yea, it might be related to the service wrapper, just use the regular  
> > > script  
> > > to start it (and ES\_JAVA\_OPTS is preferable, since then it keeps the  
> > > regular  
> > > JAVA\_OPTS as well).
> > > 
> > > On Tue, Jan 10, 2012 at 9:49 PM, Philippe Laflamme  
> > > [philippe.laflamme@obiba.org](mailto:philippe.laflamme@obiba.org) wrote:
> > > 
> > > > Setting JAVA\_OPTS works fine:
> > > > 
> > > > # JAVA\_OPTS="-Xdebug
> > > > 
> > > > -Xrunjdwp:transport=dt\_socket,server=y,address=8000"  
> > > > ./bin/elasticsearch -f
> > > > 
> > > > On Tue, Jan 10, 2012 at 14:20, Otis Gospodnetic  
> > > > [otis.gospodnetic@gmail.com](mailto:otis.gospodnetic@gmail.com) wrote:
> > > > 
> > > > > Hello,
> > > > > 
> > > > > I would like to add a Java agent to ES, but I'm having difficulties  
> > > > > with that.  
> > > > > Where should I add my Java agent params so that they apply to the JVM  
> > > > > in which ES/org.elasticsearch.bootstrap.Bootstrap runs?
> > > > > 
> > > > > This is what I did:
> > > > > 
> > > > > - I added the following to bin/service/elasticsearch.conf:  
> > > > > wrapper.java.additional.13=-Dcom.sun.management.jmxremote -  
> > > > > javaagent:/path/to/my-agent.jar
> > > > > 
> > > > > - I restarted ES and indeed I saw my JVM params there
> > > > > 
> > > > > But my agent doesn't seem to be used.  
> > > > > My suspicion is this is due to that wrapper app that seems to spawn a  
> > > > > separate JVM to run ES in, and when it does that my params are somehow  
> > > > > not passed through.  
> > > > > (I think this is what the poster in
> > > > > 
> > > > > [https://groups.google.com/group/elasticsearch/browse\_thread/thread/191555382c69ec8d/cfce325b47e839dd](https://groups.google.com/group/elasticsearch/browse_thread/thread/191555382c69ec8d/cfce325b47e839dd)  
> > > > > was asking about)
> > > > > 
> > > > > Maybe I should add my Java agent elsewhere so they apply to the JVM in  
> > > > > which ES/org.elasticsearch.bootstrap.Bootstrap runs?
> > > > > 
> > > > > This is what ES-related processes look like:
> > > > > 
> > > > > mom 12931 0.0 0.0 114476 1336 ? Sl 07:07 0:00 /usr/  
> > > > > share/es/bin/service/exec/elasticsearch-linux-x86-64  
> > > > > /usr/share/es/bin/  
> > > > > service/elasticsearch.conf wrapper.syslog.ident=elasticsearch  
> > > > > wrapper.pidfile=/usr/share/es/bin/service/./elasticsearch.pid  
> > > > > wrapper.name=elasticsearch wrapper.displayname=Elasticsearch  
> > > > > wrapper.daemonize=TRUE wrapper.statusfile=/usr/share/es/bin/service/./  
> > > > > elasticsearch.status wrapper.java.statusfile=/usr/share/es/bin/  
> > > > > service/./elasticsearch.java.status wrapper.lockfile=/var/lock/subsys/  
> > > > > elasticsearch
> > > > > 
> > > > > mom 12933 57.8 6.2 21743764 8317164 ? Sl 07:07 31:19 java -  
> > > > > Delasticsearch-service -Des-foreground=yes -Des.path.home=/usr/share/  
> > > > > es -Djline.enabled=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:  
> > > > > +CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -  
> > > > > XX:MaxTenuringThreshold=1 -XX:CMSInitiatingOccupancyFraction=75 -XX:  
> > > > > +UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -  
> > > > > Dcom.sun.management.jmxremote -javaagent:/path/to/my-agent.jar -  
> > > > > Xms2048m -Xmx8192m -Djava.library.path=/usr/share/es/bin/service/lib -  
> > > > > classpath /usr/share/es/bin/service/lib/wrapper.jar:/usr/share/es/lib/
> > > > > 
> > > > > elasticsearch-0.18.5.jar:/usr/share/es/lib/jline-0.9.94.jar:/usr/share/  
> > > > > es/lib/jna-3.2.7.jar:/usr/share/es/lib/log4j-1.2.16.jar:/usr/share/es/  
> > > > > lib/lucene-analyzers-3.5.0.jar:/usr/share/es/lib/lucene-  
> > > > > core-3.5.0.jar:/usr/share/es/lib/lucene-highlighter-3.5.0.jar:/usr/  
> > > > > share/es/lib/lucene-memory-3.5.0.jar:/usr/share/es/lib/lucene-  
> > > > > queries-3.5.0.jar:/usr/share/es/lib/sigar/sigar-1.6.4.jar -  
> > > > > Dwrapper.key=D6Sh-S2rSnlGvA6H -Dwrapper.port=32000 -  
> > > > > Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -  
> > > > > Dwrapper.disable\_console\_input=TRUE -Dwrapper.pid=12931 -  
> > > > > Dwrapper.version=3.5.6 -Dwrapper.native\_library=wrapper -  
> > > > > Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1  
> > > > > org.tanukisoftware.wrapper.WrapperSimpleApp  
> > > > > org.elasticsearch.bootstrap.Bootstrap
> > > > > 
> > > > > Thanks,  
> > > > > Otis

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 25, 2012, 11:41am UTC](https://discuss.elastic.co/t/adding-java-agent-to-es/6338/7 "2012-03-25T11:41:18Z")

</div>

The only place where you can inject custom JVM parameters are here:  
[https://github.com/elasticsearch/elasticsearch-servicewrapper/blob/master/service/elasticsearch.conf#L41](https://github.com/elasticsearch/elasticsearch-servicewrapper/blob/master/service/elasticsearch.conf#L41).  
You can't do it with env vars...

On Fri, Mar 23, 2012 at 1:03 AM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> That is what I assumed. Are the vars defined in  
> bin/service/elasticsearch.conf whitelisted, or will any line prefixed  
> with set.default.\* be "converted" to a variable?
> 
> eg.:  
> If set.default.ES\_MIN\_MEM sets the ES\_MIN\_MEM variable, does  
> set.default.ES\_JAVA\_OPTS accomplish the same?
> 
> It appears that the vars defined on top of the file are only used in  
> context of that file. Does the wrapper even call bin/elasticsearch? If  
> env vars are not respected, then probably not.
> 
> What is the best way to add an agent using a wrapper?
> 
> Cheers,
> 
> Ivan
> 
> On Thu, Mar 22, 2012 at 11:22 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > The wrapper has its own configuration to provide options to the JVM in  
> > its  
> > conf file. It does not respect the env vars.
> > 
> > On Wed, Mar 21, 2012 at 9:03 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> > 
> > > Bringing up this old post since that I can clarify: does the wrapper  
> > > ignore JAVA\_OPTS and ES\_JAVA\_OPTS?
> > > 
> > > ## Even tried setting set.default.ES\_JAVA\_OPTS="..." but none of my changes seem to take effect.
> > > 
> > > Ivan
> > > 
> > > On Tue, Jan 10, 2012 at 2:04 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > > 
> > > > Yea, it might be related to the service wrapper, just use the regular  
> > > > script  
> > > > to start it (and ES\_JAVA\_OPTS is preferable, since then it keeps the  
> > > > regular  
> > > > JAVA\_OPTS as well).
> > > > 
> > > > On Tue, Jan 10, 2012 at 9:49 PM, Philippe Laflamme  
> > > > [philippe.laflamme@obiba.org](mailto:philippe.laflamme@obiba.org) wrote:
> > > > 
> > > > > Setting JAVA\_OPTS works fine:
> > > > > 
> > > > > # JAVA\_OPTS="-Xdebug
> > > > > 
> > > > > -Xrunjdwp:transport=dt\_socket,server=y,address=8000"  
> > > > > ./bin/elasticsearch -f
> > > > > 
> > > > > On Tue, Jan 10, 2012 at 14:20, Otis Gospodnetic  
> > > > > [otis.gospodnetic@gmail.com](mailto:otis.gospodnetic@gmail.com) wrote:
> > > > > 
> > > > > > Hello,
> > > > > > 
> > > > > > I would like to add a Java agent to ES, but I'm having difficulties  
> > > > > > with that.  
> > > > > > Where should I add my Java agent params so that they apply to the  
> > > > > > JVM  
> > > > > > in which ES/org.elasticsearch.bootstrap.Bootstrap runs?
> > > > > > 
> > > > > > This is what I did:
> > > > > > 
> > > > > > - I added the following to bin/service/elasticsearch.conf:  
> > > > > > wrapper.java.additional.13=-Dcom.sun.management.jmxremote -  
> > > > > > javaagent:/path/to/my-agent.jar
> > > > > > 
> > > > > > - I restarted ES and indeed I saw my JVM params there
> > > > > > 
> > > > > > But my agent doesn't seem to be used.  
> > > > > > My suspicion is this is due to that wrapper app that seems to spawn  
> > > > > > a  
> > > > > > separate JVM to run ES in, and when it does that my params are  
> > > > > > somehow  
> > > > > > not passed through.  
> > > > > > (I think this is what the poster in
> 
> [https://groups.google.com/group/elasticsearch/browse\_thread/thread/191555382c69ec8d/cfce325b47e839dd](https://groups.google.com/group/elasticsearch/browse_thread/thread/191555382c69ec8d/cfce325b47e839dd)
> 
> > > > > > was asking about)
> > > > > > 
> > > > > > Maybe I should add my Java agent elsewhere so they apply to the JVM  
> > > > > > in  
> > > > > > which ES/org.elasticsearch.bootstrap.Bootstrap runs?
> > > > > > 
> > > > > > This is what ES-related processes look like:
> > > > > > 
> > > > > > mom 12931 0.0 0.0 114476 1336 ? Sl 07:07 0:00  
> > > > > > /usr/  
> > > > > > share/es/bin/service/exec/elasticsearch-linux-x86-64  
> > > > > > /usr/share/es/bin/  
> > > > > > service/elasticsearch.conf wrapper.syslog.ident=elasticsearch  
> > > > > > wrapper.pidfile=/usr/share/es/bin/service/./elasticsearch.pid  
> > > > > > wrapper.name=elasticsearch wrapper.displayname=Elasticsearch  
> > > > > > wrapper.daemonize=TRUE  
> > > > > > wrapper.statusfile=/usr/share/es/bin/service/./  
> > > > > > elasticsearch.status wrapper.java.statusfile=/usr/share/es/bin/  
> > > > > > service/./elasticsearch.java.status  
> > > > > > wrapper.lockfile=/var/lock/subsys/  
> > > > > > elasticsearch
> > > > > > 
> > > > > > mom 12933 57.8 6.2 21743764 8317164 ? Sl 07:07 31:19  
> > > > > > java -  
> > > > > > Delasticsearch-service -Des-foreground=yes  
> > > > > > -Des.path.home=/usr/share/  
> > > > > > es -Djline.enabled=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC  
> > > > > > -XX:  
> > > > > > +CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -  
> > > > > > XX:MaxTenuringThreshold=1 -XX:CMSInitiatingOccupancyFraction=75 -XX:  
> > > > > > +UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -  
> > > > > > Dcom.sun.management.jmxremote -javaagent:/path/to/my-agent.jar -  
> > > > > > Xms2048m -Xmx8192m  
> > > > > > -Djava.library.path=/usr/share/es/bin/service/lib -  
> > > > > > classpath  
> > > > > > /usr/share/es/bin/service/lib/wrapper.jar:/usr/share/es/lib/
> 
> elasticsearch-0.18.5.jar:/usr/share/es/lib/jline-0.9.94.jar:/usr/share/
> 
> > > > > >
> 
> es/lib/jna-3.2.7.jar:/usr/share/es/lib/log4j-1.2.16.jar:/usr/share/es/
> 
> > > > > > lib/lucene-analyzers-3.5.0.jar:/usr/share/es/lib/lucene-  
> > > > > > core-3.5.0.jar:/usr/share/es/lib/lucene-highlighter-3.5.0.jar:/usr/  
> > > > > > share/es/lib/lucene-memory-3.5.0.jar:/usr/share/es/lib/lucene-  
> > > > > > queries-3.5.0.jar:/usr/share/es/lib/sigar/sigar-1.6.4.jar -  
> > > > > > Dwrapper.key=D6Sh-S2rSnlGvA6H -Dwrapper.port=32000 -  
> > > > > > Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -  
> > > > > > Dwrapper.disable\_console\_input=TRUE -Dwrapper.pid=12931 -  
> > > > > > Dwrapper.version=3.5.6 -Dwrapper.native\_library=wrapper -  
> > > > > > Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1  
> > > > > > org.tanukisoftware.wrapper.WrapperSimpleApp  
> > > > > > org.elasticsearch.bootstrap.Bootstrap
> > > > > > 
> > > > > > Thanks,  
> > > > > > Otis

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [March 26, 2012, 4:40pm UTC](https://discuss.elastic.co/t/adding-java-agent-to-es/6338/8 "2012-03-26T16:40:28Z")

</div>

Thanks. Missed that very important section!

--  
Ivan

On Sun, Mar 25, 2012 at 4:41 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> The only place where you can inject custom JVM parameters are  
> here: [https://github.com/elasticsearch/elasticsearch-servicewrapper/blob/master/service/elasticsearch.conf#L41](https://github.com/elasticsearch/elasticsearch-servicewrapper/blob/master/service/elasticsearch.conf#L41).  
> You can't do it with env vars...
> 
> On Fri, Mar 23, 2012 at 1:03 AM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> 
> > That is what I assumed. Are the vars defined in  
> > bin/service/elasticsearch.conf whitelisted, or will any line prefixed  
> > with set.default.\* be "converted" to a variable?
> > 
> > eg.:  
> > If set.default.ES\_MIN\_MEM sets the ES\_MIN\_MEM variable, does  
> > set.default.ES\_JAVA\_OPTS accomplish the same?
> > 
> > It appears that the vars defined on top of the file are only used in  
> > context of that file. Does the wrapper even call bin/elasticsearch? If  
> > env vars are not respected, then probably not.
> > 
> > What is the best way to add an agent using a wrapper?
> > 
> > Cheers,
> > 
> > Ivan
> > 
> > On Thu, Mar 22, 2012 at 11:22 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > 
> > > The wrapper has its own configuration to provide options to the JVM in  
> > > its  
> > > conf file. It does not respect the env vars.
> > > 
> > > On Wed, Mar 21, 2012 at 9:03 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> > > 
> > > > Bringing up this old post since that I can clarify: does the wrapper  
> > > > ignore JAVA\_OPTS and ES\_JAVA\_OPTS?
> > > > 
> > > > ## Even tried setting set.default.ES\_JAVA\_OPTS="..." but none of my changes seem to take effect.
> > > > 
> > > > Ivan
> > > > 
> > > > On Tue, Jan 10, 2012 at 2:04 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > > > 
> > > > > Yea, it might be related to the service wrapper, just use the regular  
> > > > > script  
> > > > > to start it (and ES\_JAVA\_OPTS is preferable, since then it keeps the  
> > > > > regular  
> > > > > JAVA\_OPTS as well).
> > > > > 
> > > > > On Tue, Jan 10, 2012 at 9:49 PM, Philippe Laflamme  
> > > > > [philippe.laflamme@obiba.org](mailto:philippe.laflamme@obiba.org) wrote:
> > > > > 
> > > > > > Setting JAVA\_OPTS works fine:
> > > > > > 
> > > > > > # JAVA\_OPTS="-Xdebug
> > > > > > 
> > > > > > -Xrunjdwp:transport=dt\_socket,server=y,address=8000"  
> > > > > > ./bin/elasticsearch -f
> > > > > > 
> > > > > > On Tue, Jan 10, 2012 at 14:20, Otis Gospodnetic  
> > > > > > [otis.gospodnetic@gmail.com](mailto:otis.gospodnetic@gmail.com) wrote:
> > > > > > 
> > > > > > > Hello,
> > > > > > > 
> > > > > > > I would like to add a Java agent to ES, but I'm having difficulties  
> > > > > > > with that.  
> > > > > > > Where should I add my Java agent params so that they apply to the  
> > > > > > > JVM  
> > > > > > > in which ES/org.elasticsearch.bootstrap.Bootstrap runs?
> > > > > > > 
> > > > > > > This is what I did:
> > > > > > > 
> > > > > > > - I added the following to bin/service/elasticsearch.conf:  
> > > > > > > wrapper.java.additional.13=-Dcom.sun.management.jmxremote -  
> > > > > > > javaagent:/path/to/my-agent.jar
> > > > > > > 
> > > > > > > - I restarted ES and indeed I saw my JVM params there
> > > > > > > 
> > > > > > > But my agent doesn't seem to be used.  
> > > > > > > My suspicion is this is due to that wrapper app that seems to spawn  
> > > > > > > a  
> > > > > > > separate JVM to run ES in, and when it does that my params are  
> > > > > > > somehow  
> > > > > > > not passed through.  
> > > > > > > (I think this is what the poster in
> > > > > > > 
> > > > > > > [https://groups.google.com/group/elasticsearch/browse\_thread/thread/191555382c69ec8d/cfce325b47e839dd](https://groups.google.com/group/elasticsearch/browse_thread/thread/191555382c69ec8d/cfce325b47e839dd)  
> > > > > > > was asking about)
> > > > > > > 
> > > > > > > Maybe I should add my Java agent elsewhere so they apply to the JVM  
> > > > > > > in  
> > > > > > > which ES/org.elasticsearch.bootstrap.Bootstrap runs?
> > > > > > > 
> > > > > > > This is what ES-related processes look like:
> > > > > > > 
> > > > > > > mom 12931 0.0 0.0 114476 1336 ? Sl 07:07 0:00  
> > > > > > > /usr/  
> > > > > > > share/es/bin/service/exec/elasticsearch-linux-x86-64  
> > > > > > > /usr/share/es/bin/  
> > > > > > > service/elasticsearch.conf wrapper.syslog.ident=elasticsearch  
> > > > > > > wrapper.pidfile=/usr/share/es/bin/service/./elasticsearch.pid  
> > > > > > > wrapper.name=elasticsearch wrapper.displayname=Elasticsearch  
> > > > > > > wrapper.daemonize=TRUE  
> > > > > > > wrapper.statusfile=/usr/share/es/bin/service/./  
> > > > > > > elasticsearch.status wrapper.java.statusfile=/usr/share/es/bin/  
> > > > > > > service/./elasticsearch.java.status  
> > > > > > > wrapper.lockfile=/var/lock/subsys/  
> > > > > > > elasticsearch
> > > > > > > 
> > > > > > > mom 12933 57.8 6.2 21743764 8317164 ? Sl 07:07 31:19  
> > > > > > > java -  
> > > > > > > Delasticsearch-service -Des-foreground=yes  
> > > > > > > -Des.path.home=/usr/share/  
> > > > > > > es -Djline.enabled=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC  
> > > > > > > -XX:  
> > > > > > > +CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -  
> > > > > > > XX:MaxTenuringThreshold=1 -XX:CMSInitiatingOccupancyFraction=75  
> > > > > > > -XX:  
> > > > > > > +UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -  
> > > > > > > Dcom.sun.management.jmxremote -javaagent:/path/to/my-agent.jar -  
> > > > > > > Xms2048m -Xmx8192m  
> > > > > > > -Djava.library.path=/usr/share/es/bin/service/lib -  
> > > > > > > classpath  
> > > > > > > /usr/share/es/bin/service/lib/wrapper.jar:/usr/share/es/lib/
> > > > > > > 
> > > > > > > elasticsearch-0.18.5.jar:/usr/share/es/lib/jline-0.9.94.jar:/usr/share/
> > > > > > > 
> > > > > > > es/lib/jna-3.2.7.jar:/usr/share/es/lib/log4j-1.2.16.jar:/usr/share/es/  
> > > > > > > lib/lucene-analyzers-3.5.0.jar:/usr/share/es/lib/lucene-  
> > > > > > > core-3.5.0.jar:/usr/share/es/lib/lucene-highlighter-3.5.0.jar:/usr/  
> > > > > > > share/es/lib/lucene-memory-3.5.0.jar:/usr/share/es/lib/lucene-  
> > > > > > > queries-3.5.0.jar:/usr/share/es/lib/sigar/sigar-1.6.4.jar -  
> > > > > > > Dwrapper.key=D6Sh-S2rSnlGvA6H -Dwrapper.port=32000 -  
> > > > > > > Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -  
> > > > > > > Dwrapper.disable\_console\_input=TRUE -Dwrapper.pid=12931 -  
> > > > > > > Dwrapper.version=3.5.6 -Dwrapper.native\_library=wrapper -  
> > > > > > > Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1  
> > > > > > > org.tanukisoftware.wrapper.WrapperSimpleApp  
> > > > > > > org.elasticsearch.bootstrap.Bootstrap
> > > > > > > 
> > > > > > > Thanks,  
> > > > > > > Otis

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:34am UTC](https://discuss.elastic.co/t/adding-java-agent-to-es/6338/9 "2017-07-06T03:34:44Z")

</div>


