Configuring VisualVM with tomcat + linux

VisualVM is a tool that provides a visual interface for viewing detailed information about Java applications while they are running on a Java Virtual Machine (JVM), and for troubleshooting and profiling these applications.
Firs of all you need to configure JMX. For tomcat you need to perform this:

  1. In folder %CATALINA_HOME%/conf need to create remote.users with content: USER_1 PASSWORD_2
    USER_2 PASSWORD_2
  2. In folder %CATALINA_HOME%/conf need to create remote.acl with content: USER_1 PERMISSION_1
    USER_2 PERMISSION_2
    where permissions: readonly, readwrite 
  3. chmod 400 remote.users
  4. chmod 400 remote.acl
  5. chown tomcat:tomcat remote.users
  6. chown tomcat:tomcat remote.acl
  7. In tomcat %CATALINA_HOME%/bin/catalina.sh need to add:   CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.password.file=/opt/tomcat/conf/remote.users
    -Dcom.sun.management.jmxremote.access.file=/opt/tomcat/conf/remote.acl -Dcom.sun.management.jmxremote
    -Dcom.sun.management.jmxremote.port=7777
    -Dcom.sun.management.jmxremote.ssl=false
    -Djava.rmi.server.hostname=1.1.1.1"
    where hostname - is tomcat server ip, and port - any not used port
  8. Restart Tomcat
  9. Visual VM comes with JDK from 6u7, run it on your local machine $JAVA_HOME/bin/jvisualvm 
  10. Click File->Add JMX connection use user, password, host and port
  11. Will appear new perspective whith your server connection

Sursa
2012-07-24 15:10:00



Comenteaza





Ultimele 25 posturi adăugate

15:01:07Fără Titlu —» Путепроводные Заметки
13:50:14Fără Titlu —» Путепроводные Заметки
15:45:09Fără Titlu —» Путепроводные Заметки
05:18:00DIN COSMOGRAME —» Leo Butnaru
18:46:28Fără Titlu —» Путепроводные Заметки
17:48:06Fără Titlu —» Путепроводные Заметки
17:27:43Festivalul Internațional de Comedie FESTIS —» Biblioteca de Arte 'Tudor Arghezi'
13:37:15Fără Titlu —» Путепроводные Заметки
06:57:00ȘTIAȚI CĂ DEJA INTERNETUL ARE UN... SFÂNT PROTECTOR?... —» Leo Butnaru
04:15:41Fără Titlu —» Путепроводные Заметки
19:10:00Éxito —» Andrei LANGA. Blogul personal
19:10:00Éxito —» Andrei LANGA. Blogul personal
19:10:00Éxito —» Andrei LANGA. Blogul personal
15:04:54Fără Titlu —» Путепроводные Заметки
13:41:56Fără Titlu —» Путепроводные Заметки
06:15:00DISCUL SAU PĂTRATUL, MALEVICI SAU JAPONEZII? —» Leo Butnaru
02:31:21Fără Titlu —» Путепроводные Заметки
21:27:50Fără Titlu —» Путепроводные Заметки
20:56:34Fără Titlu —» Путепроводные Заметки
10:38:46A învins primarul în instanță —» Curaj.TV | Media alternativă
08:37:00DIN BIBLIOGRAFIA JURNALULUI —» Leo Butnaru
13:37:00Mortua est —» Andrei LANGA. Blogul personal
13:37:00Mortua est —» Andrei LANGA. Blogul personal
13:37:00Mortua est —» Andrei LANGA. Blogul personal
13:37:00Mortua est —» Andrei LANGA. Blogul personal