Monday, November 16, 2009

WLS: Monitoring Oracle JRockit JVM with JRockit Mission Control remotely

Status: resolved
JRockit Mission Control: 3.1.2
WebLogic: 10.3.2

Use case

You have the need to remotely monitor and profile the JRockit JVM(s) of Oracle WebLogic Server.


Solution

  1. Install JRockit Mission Control on the client
  2. Configure WebLogic Server Domain with JRockit JVM
  3. Configure JRockit Management Server

Components/Products

 Product
Download
 Oracle® WebLogic Server
Download from OTN
 Oracle® JRockit Mission Control 
Download from OTN 

How to

Bereich
Beschreibung
  
Putty 
Login as oracle
on telde.local
[oracle@telde ~]$ cd middleware/user_projects/domains/base_domain/ [oracle@telde base_domain]$ vi startWebLogic.sh
Putty/viAdd the following java Options before starting the WLS instance:

JAVA_OPTIONS="-Xmanagement:ssl=false,authenticate=false,port=7091"
export JAVA_OPTIONS

${DOMAIN_HOME}/bin/startWebLogic.sh $*

Save file and Close vi.
PuttyStart WLS

[oracle@telde base_domain]$ ./startWebLogic.sh
….
Notice the starting of the management server

[JRockit] Management server started on port 7091, ssl=false, authenticate=false.

ClientStart JRockit Mission Control
JRMCCreate a new connection
image
Enter Host
Enter Port
image
Click: Test connection
=> Status keeps “Unable to connect”
Click: Finish

Starting the console on the newly created connection you might receive the following exception:

Could not open Management Console for telde.local.
  com.jrockit.mc.rjmx.ConnectionException: Connection refused to host: 127.0.0.1; nested exception is:
    java.net.ConnectException: Connection refused: connect
    com.jrockit.mc.rjmx.ConnectionException: Connection refused to host: 127.0.0.1; nested exception is:
        java.net.ConnectException: Connection refused: connect
        at com.jrockit.mc.rjmx.ConnectionManager.connect(ConnectionManager.java:63)
        at com.jrockit.mc.console.ui.actions.StartConsole$1.preConnect…

So how to fix?
 

PuttyStop WLS
 Edit startWebLogic.sh
Add -Djava.rmi.server.hostname=<remotehost> to the java options so that it looks like
Putty/vi

..

JAVA_OPTIONS="-Djava.rmi.server.hostname=telde.local -Xmanagement:ssl=false,authenticate=false,port=7091"
export JAVA_OPTIONS

${DOMAIN_HOME}/bin/startWebLogic.sh $*

Save file and exit vi.

PuttyStart WLS once again

[oracle@telde base_domain]$ ./startWebLogic.sh
JRMCNow try to test connection again.
Result should be
image
JRMCStart the console and monitor CPU, Mem, seak for memory leaks, etc.
image

Resources

java.rmi.server.hostname (1.1 and later)

The value of this property represents the host name string that should be associated with remote stubs for locally created remote objects, in order to allow clients to invoke methods on the remote object. In 1.1.7 and later, the default value of this property is the IP address of the local host, in "dotted-quad" format.

17 comments:

  1. Do you know of any easy way to set up remote monitoring when there is a firewall in place?

    Thanks,
    KaJun

    ReplyDelete
  2. p.s. - the text body of the blog posting is getting cut off on it's right side - it seems the CSS style is set too narrow... if I change the width in main-wrapper to something larger, the text will appear...

    #main-wrapper {
    width: 664px;
    }

    ReplyDelete
  3. Hello KaJun,

    I will fix/improve the layout issue soon. Thanks.

    Monitoring through a firewall depends on network configuration and your possibilities to place potentially needed extra stuff on customers server. So it is not easy to answer....

    Regards,
    Andreas.

    ReplyDelete
  4. work!!!! the parameter -Djava.rmi.server.hostname=telde.local isn't in mission control page documentation

    tks!!

    ReplyDelete
  5. Great to hear this post could help you ;)

    Regards,
    Andreas

    ReplyDelete
  6. -Djava.rmi.server.hostname parameter rescued my life.

    ReplyDelete
  7. You re welcome! I am happy to rescue lifes ;)

    ReplyDelete
  8. Andreas ... Nice post! Is it possible to, time to time, automatically export/log JVM performance and latelly import in console to view the results ?

    Cheers! :)

    ReplyDelete
    Replies
    1. Hi, to be honest I am not sure. Maybe jrcmd (command line tool for jrockit) is able to do this. http://docs.oracle.com/cd/E15289_01/doc.40/e15061/ctrlbreakhndlr.htm#i1001717

      You need to check out yourself ;)

      Delete
    2. Thanks for your fast reply.
      I was there, exploring jrcmd - at least i'm not completely lost! :)

      If i get any more results, i'll let you know!

      Thanks once again!

      Cheers! ;)

      Delete
    3. I was wondering that it would be possible to parse some argument when launching specific JVM ?

      Something like :
      "-Xverboselog:${LOGDIR}/gc.log"" ???

      Perhaps a stupid question! :)

      Delete
  9. Fuck shit! this saved my day. I spend all day with this problem with single and easy solution.

    Thank you very much

    ReplyDelete
  10. hello andreas... i am novice at this and so my questioni might sound trivial to you..
    here it is:
    i have multiple weblogic instances built on 1 box which needs to be monitored. I believe i need to spin up 1 port for every instance. However there would only be 1 script to start all instances.. how do i pass different port number each time to start different instances..

    ReplyDelete
  11. Well, it depends how you start you managed servers. At least this is definetly possible because every server has a dedicated jvm process.

    If using Nodemanager you are able to set "server start" arguments by using the WLS Admin Console for each server. If you are using the startManagedServer.sh scripts then you are free to parametrize the script.

    Hope, that helps!

    ReplyDelete
  12. Hi Andreas,

    I am using Tomcat Server. Where do I have to add the following line?

    JAVA_OPTIONS="-Xmanagement:ssl=false,authenticate=false,port=7091"
    export JAVA_OPTIONS

    Regards,
    Suman

    ReplyDelete
  13. Hi Hecticmind,

    you should set it in the JAVA_OPTS variable in $TOMCAT_HOME/bin/catalina.sh or catalina.bat

    Hope that helps,
    Andreas

    ReplyDelete