Error connecting jmx to the product

For some reason, I cannot connect java pid on the production server using VisualVM.

I pass the jvm parameter in setenv.sh file:

export JAVA_OPTS="-Dcom.sun.management.jmxremote=true \ 
            -Dcom.sun.management.jmxremote.port=9999\ 
             -Dcom.sun.management.jmxremote.authenticate=false\ 
             -Dcom.sun.management.jmxremote.ssl=false \ 
            -Djava.rmi.server.hostname=192.168.1.2" 

and put this file in the $ / usr / share / tomcat7 / bin / directory. and for authentication, both jmxremote.password and jmxremote.access are placed in the directory "/ var / lib / tomcat7 / conf /".

File permissions :

**$sudo chown tomcat7:tomcat7 /var/lib/tomcat7/conf/jmxremote.*** is ensuring that both file owned by tomcat7

**$ sudo chmod 0600 /var/lib/tomcat7/conf/jmxremote.*** //  access right for tomcat7

$ sudo cat jmxremote.password

admin alonegk

$ sudo cat jmxremote.access

admin readwrite

The same thing works fine while I did this on the dev server, as well as on my localhost.

Thanks pending.

+4
source share
1 answer

Try with the following:

export JAVA_OPTS="-Dcom.sun.management.jmxremote \ 
            -Dcom.sun.management.jmxremote.port=9999\ 
             -Dcom.sun.management.jmxremote.authenticate=false\ 
             -Dcom.sun.management.jmxremote.ssl=false \ 
            -Djava.rmi.server.hostname=192.168.1.2" 

Since authentication is set to false, the username and password do not matter here.

, :

-Dcom.sun.management.jmxremote.password.file=<PATH>/jmxremote.password
-Dcom.sun.management.jmxremote.access.file=<PATH>/jmxremote.access
+1

Source: https://habr.com/ru/post/1620317/


All Articles