Monitoring JMX port in Amazon EC2 hosted server

Recently I have started work on Amazon EC2 servers. At some point I got requirement to monitor JMX port of server which was hosted on Amazon EC2. I followed the steps which was previously posted in my blog. But it did not help. I tried changing CATALINA_OPTS parameters as well as I opened all ports in Amazon "Security Group". After all I got help from Feil Figg blog. So below are steps to achieve it.

(1) First download catalina-jmx-remote.jar file as per tomcat's version and keep it in tomcat\lib folder.

(2) Now open tomcat/conf/server.xml file and add below line into it.

<Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiRegistryPortPlatform="8999" rmiServerPortPlatform="8999"/>



(3) Now open tomcat/bin/setenv.sh file and add below java parameters.



JAVA_OPTS="${JAVA_OPTS} -Djava.rmi.server.hostname=ec2-xx-xxx-x-xxx.compute-1.amazonaws.com -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

(4) Now restart tomcat. You need to open port 8999 in Amazon "Security Group".

Hope this will help.






No comments:

Post a Comment