Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
You've written a Web application that runs happily in production on Tomcat, probably on port 80. Some early problems might include complaints from your security team because your server runs as a root facing the outside world and excessive traffic—traffic beyond what a single server can deal with.
A far more likely problem, however, is that you will need to issue new releases of your application. You may even need to upgrade your version of Tomcat or the operating system. These tasks will require you to restart Tomcat. And whenever you do that, your site will become unavailable.
To prevent such an outcome, you move your main server to port 8081, set up a secondary server identical to the primary one on 8082, and some form of dispatcher on port 80. The dispatcher directs traffic to the secondary server while you upgrade the primary one.
Options for the dispatcher are:
iptables -t nat -A PREROUTING -p tcp -d lo --dport 80 -j DNAT --to 127.0.0.1:8081
This option is only possible on a Linux system with iptables compiled into the kernel.
apache2.conf) and ask Apache to reload it. This is a good solution if you only need to switch servers. A potential downside is the difficulty inherent in automating the switching, since only the root user can ask Apache to reload its configuration file.
Note: For more details on iptables and mod_proxy, see Resources.
If you don't already have Tomcat 5.0.x, download a recent copy and unpack it twice. I put mine in
server.xml file (
/usr/local/tomcat2/conf/server.xml) on each Tomcat by changing the non-SSL (Secure Socket Layer) Coyote HTTP/1.1 Connector element for the first server to:
<Connector port="8081" ... />
and the second server to:
<Connector port="8082" ... />
Also on the second server, change the port in the server entry at the top. For example:
<Server port="8006" ...>
Start both servers and check if you can get the default homepage. Download and install Apache 2 and make sure it runs.
A binary build or packaged build of mod_jk2 is available for many platforms. A binary or packaged build is the easiest way to install mod_jk2—if you have one of these, skip to the next section ("Apache mod_jk2 Configuration"). Otherwise, you need to build mod_jk2 from source, which is still quite easy.
|Forum migration complete By Athen|
|Forum migration update By Athen|
|Tangosol Coherence By Cameron|
|High availability Tomcat By JavaWorld|
|How to test session affinity in this case ? By Anonymous|
|Session Replication in Tomcat5.5 By|
|Eliminating single point of failure? By redcoat|
|JK2 is deprecated By Funkman|
|Update - use mod_jk By Graham King|
|Disable output buffering (Apache+mod_jk+Tomcat) By Anonymous|
|..or Borland Enterprise Server By Anonymous|
|JK2 is no longer developed. By thatwaltguy|