Remote JMX Access + rd-jobs

430 views
Skip to first unread message

David Petzel

unread,
Jun 10, 2013, 1:22:29 PM6/10/13
to rundeck...@googlegroups.com
I wanted to be able to access my rundeck jvm remote via JMX, so I added the following to /etc/rundeck/profile

````
# Enable JMX
JMX_OPTIONS="-Dcom.sun.management.jmxremote.port=9999 \
        -Dcom.sun.management.jmxremote.authenticate=false \
        -Dcom.sun.management.jmxremote.ssl=false"
export RDECK_JVM="$RDECK_JVM $JMX_OPTIONS"
````

This worked fine, the service starts and I am able to connect via jconsole remotely.

The problem comes into play when I attempt to import a job definition (which worked fine before enabling JMX). Here is the error I get:
````
[rundeck@rundeckserver ~]$ rd-jobs load --file /tmp/MyJobFile.job -F yaml
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 9999; nested exception is:
        java.net.BindException: Address already in use
````

If I disable JMX, the import works again. 

Is there a different way I should be enabling remote JMX functionality for Rundeck? Is it expected that rd-jobs would need to bind on the JMX port?





Greg Schueler

unread,
Jun 10, 2013, 1:26:59 PM6/10/13
to rundeck...@googlegroups.com

Hi David,


the /etc/rundeck/profile is used by both the server and the commandline tools currently, so I think your JMX config is then also being applied to the rd-jobs command.


You could perhaps modify /etc/rundeck/profile to have two separate RDECK_JVM settings, and modify the rd-jobs bash script to use the other one.


--
Greg Schueler
--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

David Petzel

unread,
Jun 10, 2013, 1:31:07 PM6/10/13
to rundeck...@googlegroups.com
Thanks Greg,
I'm wondering if it makes sense to update http://rundeck.org/docs/administration/scaling-rundeck.html#jmx-instrumentation based on this discussion? I was originally looking to hack this directly into the init script, until I found that doc which mentioned doing it in the profile file. 

Thanks

David Petzel

unread,
Jun 10, 2013, 1:43:28 PM6/10/13
to rundeck...@googlegroups.com
So just to confirm, moving the jmx logic directly into the init script does work.

Greg Schueler

unread,
Jun 10, 2013, 1:48:45 PM6/10/13
to rundeck...@googlegroups.com

Ok, sounds like the docs, or preferably the init-script should be updated.  We should allow JVM settings for the server only.


do you mind filing this as an issue?


--
Greg Schueler

David Petzel

unread,
Jun 10, 2013, 1:58:11 PM6/10/13
to rundeck...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages