Running OpenNMS with a Dedicated Tomcat Server
Subscribe

From OpenNMS

Jump to: navigation, search
⚠
This page is obsolete. Please see Jetty instead.

Jetty has replaced Tomcat as the default servlet container for OpenNMS including situations where you run the web UI in a separate JVM. Using OpenNMS with Tomcat is no longer supported.

The OpenNMS system consists of three main (& independent) components. The core OpenNMS poller / data collector, the Postgresql database and the Tomcat web server.

In most cases, all three components are run on the same server hardware.

In cases of large numbers of monitored devices or services, it is often advantageous to move the Postgresql database to another server to improve performance. Recently the option has been added to also install Tomcat on a dedicated server to further improve the performance of the WebUI and reduce the overhead on the core OpenNMS server.

Here is the procedure for configuring a remote Tomcat server for OpenNMS

This procedure assumes that suitable hardware has been identified and properly loaded with a base Linux / Solaris operating system that is compatible with OpenNMS / Tomcat. Also, the distributed Tomcat feature is only available in the latest (unreleased) 1.2.9 stable version and the latest 1.3.x unstable version. You will need to check out, build and install whichever version you wish to use this feature.

1. Build & install OpenNMS for your operating system.

*OpenNMS will not be run on this server so make sure to disable any startup scripts for OpenNMS

2. Install Tomcat (version 4.1.31 for stable or 5.5 for stable or unstable)

3. Install the SUN Java JDK (version 1.4.2 for unstable or 1.5.0 for stable or unstable)

4. Configure the OpenNMS webapps

4.a. Set you JAVA_HOME variable for the Java JDK

*Example: #export JAVA_HOME=/usr/jdk1.5.0_06

4.b. Run (as root or sudo root) $OPENNMS_HOME/bin/runjava –s.

*This will tell OpenNMS where your JDK is installed.

4.c. Run (as root or sudo root) $OPENNMS_HOME/bin/install –y –w $CATALINA_HOME/conf/Catalina/localhost

*$CATALINA_HOME is the location of where you installed Tomcat. For instance if you installed tomcat in /usr/local/tomcat5,and your OpenNMS is installed
in /usr/local/OpenNMS, the command would be (as root or sudo root) #/usr/local/OpenNMS/bin/install –y –w /usr/local/tomcat5/conf/Catalina/localhost

5. Start Tomcat (make sure you have your $JAVA_HOME set)

*Test your Tomcat installation by pointing your browser to http://<your new server>:8080 You should get the default Tomcat page. If not, make sure you
followed all the steps.

6. Now you have to modify a couple of OpenNMS configuration files to tell Tomcat where your OpenNMS and Postgres are installed.

  • Edit the following file: $OPENNMS_HOME/webapps/opennms/WEB-INF/web.xml. (Be sure to make a copy of the old file before editing)
*This section tells Tomcat where to find the postgres server:
 <context-param>
   <param-name>opennms.db.poolman</param-name>
   <param-value>org.opennms.core.resource.db.SimpleDbConnectionFactory</param-value>
 </context-param>
 <context-param>
   <param-name>opennms.db.driver</param-name>
   <param-value>org.postgresql.Driver</param-value>
 </context-param>
 <context-param>
   <param-name>opennms.db.url</param-name>
   <param-value>jdbc:postgresql://localhost:5432/opennms?compatible=7.1</param-value>
 </context-param>
 <context-param>
   <param-name>opennms.db.user</param-name>
   <param-value>opennms</param-value>
 </context-param>
 <context-param>
   <param-name>opennms.db.password</param-name>
   <param-value>opennms</param-value>
 </context-param>

In the line that reads jdbc:postgresql://localhost:5432/opennms…..

Change localhost to the (resolvable) name of your postgres server:5432

Depending on the vintage of your OpenNMS installation, this setting might instead be in the file configuration.properties in the same directory


*This section tells Tomcat where to find the OpenNMS server and identifies the new Tomcat server to OpenNMS.
 <context-param>
   <param-name>opennms.rtc-client.http-post.username</param-name>
   <param-value>rtc</param-value>
   <description>The username the RTC uses when authenticating itself in an HTTP POST.</description>
 </context-param>
 <context-param>
   <param-name>opennms.rtc-client.http-post.password</param-name>
   <param-value>rtc</param-value>
   <description>The password the RTC uses when authenticating itself in an HTTP POST.</description>
 </context-param>
 <context-param>
   <param-name>opennms.rtc.event.proxy.host</param-name>
   <param-value>127.0.0.1</param-value>
   <description>The hostname/IP address of the RTCd host for sending subscribe event.</description>
 </context-param>
 <context-param>
   <param-name>opennms.rtc.event.proxy.port</param-name>
   <param-value>5817</param-value>
   <description>The port of the RTCd host for sending subscribe event (Requires host to be configured).</description>
 </context-param>
 <context-param>
   <param-name>opennms.rtc-client.http-post.base-url</param-name>
   <param-value>http://localhost:8080/opennms/rtc/post</param-value>
   <description>
     The base of a URL that RTC clients use when creating a RTC subscription URL.
     IMPORTANT: This URL must NOT contain a slash at the end.
   </description>
 </context-param>

In the line that reads <param-value>127.0.0.1</param-value>

Change the 127.0.0.1 to the resolvable name of your opennms server.

In the line that reads <param-value>http://localhost:8080/opennms/rtc/post</param-value>

Change localhost to the resolvable name of the server you are on (your new tomcat server)

Save and exit the file.

8. Copy your $OPENNMS_HOME/etc directory from your OpenNMS server to your new Tomcat server. That way any custom settings applicable to the webapp are carried over to the new Tomcat server.

*The other option is to share (via NFS or other..) the $OPENNMS_HOME/etc directory from the OpenNMS server to the new Tomcat server.  Or create a shared area on a common server for both OpenNMS and Tomcat to access.

9. You will also need to share your rrd directory structure with your remote Tomcat Server. So if your rrd files are local to your OpenNMS Server, you will need to set up a NFS (or other..) share so your Tomcat server can access the files.

*The other option is to put your $OPENNMS_HOME/share/rrd/ directory structure on a shared disk array or a common server.

10. Restart tomcat and try to access OpenNMS from your new Tomcat server.

*Point your web browser to http://<your new server>:8080/opennms and you should get prompted for a login.
    • That’s it! Good luck and have fun.