Valtira Blog
Tomcat Failover
by Morgan Catlin - 25 Mar 2011, 10:30:05
Just a quick note: when you are configuring your load balancing settings with Apache2, JK and Tomcat, remember to plan for failover. The default settings WILL NOT failover like you expect!
Here are some quick settings that illustrate my point.
workers.properties file:
worker.jkstatus.type=status
worker.a1420.type=lb
worker.a1420-1.host=10.114.247.55
worker.a1420-1.port=15000
worker.a1420-1.type=ajp13
worker.a1420-1.lbfactor=1
worker.a1420-1.socket_timeout=2
worker.a1420-1.connect_timeout=500
worker.a1420-2.host=10.118.9.82
worker.a1420-2.port=15000
worker.a1420-2.type=ajp13
worker.a1420-2.lbfactor=1
worker.a1420-2.socket_timeout=2
worker.a1420-2.connect_timeout=500
worker.a1420.balance_workers=a1420-1,a1420-2
I highlighted socket_timeout and connect_timeout because these settings cause JK to actually check its connections to the Tomcat servers it is load balancing. It seems like a matter of course that JK should do this automatically, but it won't! So, socket_timeout is set to 2 seconds here for the case where JK is having problems getting a network connection. connect_timeout is where the magic happens, I've set that to 500 milliseoonds which tells JK to wait that long before getting back a CPONG response to its CPING before issuing the actual request to the chosen Tomcat server. When a Tomcat server doesn't respond within the timeout window, JK uses another Tomcat server to send the request to and marks the original Tomcat server as ERR. It'll check that original Tomcat server again after its maintenance window expires. All this stuff is explained in Tomcat's timeout article.
I learned this the hard way - where I have some mis-behaving EC2 instances which freeze up now and then (working on fixing that). In the short term, I modified my JK settings to enabled failover. I've also used the jkstatus/jkmanager to monitor the situation, extremely handy!
Comments? Suggestions? Feedback?
Cloud Applications Presentation
by Morgan Catlin - 16 Nov 2011, 21:10:33
I've submitted my MN IT Symposium presentation, "Architecting and Deploying Scalable, Resilient, and Cost-Effective Cloud Applications", which discusses how to bring about an affective Cloud-based application.
It discusses my experiences using PaaS and rolling my own architecture. I go over what worked and some common misconceptions about using PaaS and RYO.
I think the most interesting part is showing an ideal distributed architecture for the common Java Pet Store application. I talk about how to use AWS' services to achieve high reliability and scalability.
Can't wait to meet all you great attendees!
Categories
- 3d (1)
- ad revenue (1)
- apps (6)
- aws (5)
- branding (1)
- cloud (10)
- cloud computing (1)
- commoditized workloads (1)
- css3 (1)
- development (4)
- ec2 (9)
- handlersocket (1)
- html5 (1)
- innocent bystander syndrome (1)
- integration solutions (1)
- ios (1)
- java (5)
- landing pages (1)
- lead scoring (1)
- marketing (2)
- mn it symposium (1)
- mysql (3)
- nosql (1)
- personalization (1)
- roku (3)
- s3 (2)
- saas (4)
- salesforce (6)
- sociable company (1)
- social (1)
- social business transformation (1)
- social media (1)
- tomcat (2)
- tools (1)
- video (3)
- wowza (3)
Archives By Month
- April 2013 (1)
- March 2013 (1)
- February 2013 (1)
- January 2013 (2)
- October 2012 (1)
- May 2012 (2)
- April 2012 (1)
- January 2012 (1)
- November 2011 (4)
- August 2011 (1)
- July 2011 (1)
- March 2011 (2)
- February 2011 (2)
- January 2011 (1)
- December 2010 (1)
- November 2010 (1)
- October 2010 (2)
- September 2010 (1)
About Us
Valtira's team includes many bright people with useful opinions on the latest web technologies like HTML5 and cloud computing.
