How to Setup Tomcat Discovery on Your Turbonomic Instance

Document created by Anson McCook Expert on Jun 4, 2015Last modified by Anson McCook Expert on Jan 4, 2017
Version 10Show Document
  • View in full screen mode

***The following setup is only applicable to users with the Application Control Module or Application Edition running on 5.2 or higher***

 

If you do not have the Application Control Module or Application Edition, please contact your Customer Experience representative or your Account Executive for licensing.

 

Ensure your appliance is running 5.2 or higher. Follow these instructions to update:

VMTurbo Latest Update Links & How To Perform an Operations Manager "Offline Update"

 

 

In this document we’ll review how to setup discovery of the Tomcat service running within your Turbonomic instance. The high-level steps look something like this:

 

1) Turn on Remote Management by enabling JMX

2) Open up the Firewall to specified JXM port

For ease of setup, we’ll cover these additional steps.

a. Install Yast Firewall

b. Install Telnet

 

 

Turn on Remote Management by Enabling JMX

 

1) Open up a console or Putty session to your Turbonomic instance.

 

2) Go to the following directory:

 

cd /etc/tomcat

 

3) Create a backup of the tomcat.conf file and server.xml file:

 

cp tomcat.conf tomcat.conf.original

cp server.xml server.xml.original

 

4) Open the text editor for tomcat.conf

 

vi tomcat.conf

 

5) Toward the bottom you’ll find the line:

 

# CATALINA_OPTS="-Djava.security.debug=all"

 

6) Beneath that line, add the following text. See Before and After screenshots as reference.

Press “a” to append in the editor and add the following lines:

 

CATALINA_OPTS="-Djava.awt.headless=true -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"

 

 

Before:

After:

 

7) Press “esc” to stop appending

 

8) Write the file and quit

 

:wq

 

9) Open the text editor for tomcat.conf

 

vi server.xml

 

10) In the section that begins with:

<!-- Security listener. Documentation at /docs/config/listeners.html

  <Listener className="org.apache.catalina.security.SecurityListener" />

  -->

 

Locate the last <Listener.../>  line, which is:

 

<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

 

11) Beneath that line, add the following text. See Before and After screenshots as reference.

Press “a” to append in the editor and add the following lines:

 

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

 

Before:

After:

 

12) Press “esc” to stop appending

 

13) Write the file and quit

 

:wq

 

14) Run the following commands to accept communication for the JMX ports:

 

iptables -I INPUT 4 -p tcp --dport 7050 -j ACCEPT

 

iptables -I INPUT 4 -p tcp --dport 7051 -j ACCEPT

 

15) Download the JMX Remote Lifecycle Listener jar file, available from the link below and attached to this post at the bottom.

 

catalina-jmx-remote.jar

http://mirror.catn.com/pub/apache/tomcat/tomcat-7/v7.0.73/bin/extras/catalina-jmx-remote.jar

 

(Available from the Apache Tomcat site: Apache Tomcat - Apache Tomcat 7 Downloads)

 

16) Using an SCP-client, place the catalina-jmx-remote.jar file in the following directory:

 

/usr/share/java/tomcat

 

17) Restart the tomcat service

 

service tomcat restart

 

18) Confirm tomcat started:

 

service tomcat status

 

If the service is inactive and not running, try using the catalina-jmx-remote.jar file attached at the bottom of this post (instead of the latest catalina-jmx-remote.jar off the Tomcat website).

 

How to Open up the Firewall to specified JXM port

 

To make things a bit easier for setup and testing we’ll be installing Yast Firewall and Telnet.

 

1) Run yast

 

yast

 

2) Open Software Management

tomcat3.png

 

3) If you are prompted to the following error, “Cannot access installation media” simply select “Skip.” This prompt may come up multiple times. Select “Skip” each time.

tomcat4.png

Select “OK” to any Warnings that appear

tomcat5.png

 

4) Search for Telnet in the “Search Phrase” box. Select “telnet” and press Enter. Then tab down to “Accept”

tomcat6.png

 

5) Repeat Step 2

 

6) Now search for “Firewall”. Scroll down to “yast2-firewall” and press Enter. Then select “Accept”

tomcat7.png

 

7) We now need to exit yast for the new options to be available. Quit Yast.

 

8) Run yast again:

 

yast

 

9) Under “Security and Users” select “Firewall”

tomcat8.png

 

10) Navigate to "Interfaces" and set the network Interface to be configured in "External Zone"

 

11) Under “Custom Rules”, set the Firewall Zone to “External Zone”. Select “Add” and press Enter.

tomcat9.png

 

12) Input the following:

Source Network: 0/0

Protocol: TCP

Destination Port: 7050

 

Select “Add”

tomcat10.png

 

13) Repeat step 12 with the following input:

Source Network: 0/0

Prodocol: TCP

Destination Port: 7051

 

14) Select “Next” and “Finish”

tomcat12.png

 

15) Quit Yast.

 

 

Optional: Testing the connection

You can test that you have opened the connection by using another appliance to run:

 

telnet insertIPaddressofVMT 7050

 

While that is running, go back to your Turbonomic instance and run:

 

netstat –a | grep 7050

 

You should see an ESTABLISHED connection from the other appliance.

 

 

 

Adding the Tomcat target to Turbonomic:

 

1) Go to the Admin Tab > Workflows > Target Configuration > Application Server > Tomcat

 

2) Enter in the following information:

Scope/Address: The IP address/FQDN of the single Tomcat instance OR create a custom group in the Policy tab to set the scope to a group of Tomcat applications

Port Number: 7050

Username: admin

Password: admin

 

4) Select “Add", "Apply", and then “Rediscover”

 

5) You will eventually be able to see your Tomcat application discovered in the Inventory tab. From here, you will be able to see decisions based on the demand of the application from the virtual machine. Metrics collected include:

- Heap

- Thread Count

- Transactions

- Garbage Collection

- Response Time

 

tomcat14.png

1 person found this helpful

Attachments

Outcomes