Spring Faces

October 28, 2008

This is a very interesting article about Spring Faces and the new Spring Web Flow. I don’t know if this is now or if this will be in spring v.3. I guess we will keep watching.

Intro To Spring Faces Part 1


JDBC Driver Types

October 28, 2008

Here’s a post I came across that is good about explaining the different JDBC driver types.

JDBC Drivers Overview


Set Up Easier ssh

October 25, 2008

I found this blog entry to be useful. If you link back to it, you will find a comment I made about how to save your authorized_keys to a flash drive so you don’t have to fiddle with username/password at work but to take your laptop home, you may want to disable that “auto logon” feature of using a public/private key and use username/password instead.

Have a look:

Easy SSH Setup

And if you have any questions about how to use a flash drive to store your ssh keys, leave me a post and I’ll post the detailed instructions in the comments.


Load Balance/Cluster Your Tomcat (or any) Server

October 9, 2008

I began my adventure with the need to ensure a lot of uptime for a particular web service that was running on a tomcat server. I investigated a lot of different avenues and, eventually, ended up on a colleagues blog.

Most of the information on the web about clustering tomcat servers tells you that you need to use the mod_jk apache module. This is not true and, in some cases, not what you really want. One such page is the following:

http://www.easywayserver.com/implementation-tomcat-clustering.htm

Which is not a bad way to go. I started doing that and then a colleague of mine directed me to one of his blog entries:

http://www.manorrock.com/documents/glassfish/loadbalancer.html

His article is mainly geared toward clustering glassfish servers but the concept and the process for configuring Apache is the same.

There are a couple of things that he left out, however.

1. You must make sure that you load the proxy load balancer. For instance, in your httpd.conf file there is a section where the apache modules are loaded. Make sure you have a LoadModule for the load balancer:

LoadModule proxy_balancer_module <file path to your apache server>/modules/mod_proxy_balancer.so

2. When you are configuring your cluster as in Manfred’s article, consider where you are putting these rules. They have to be included in the startup. So, either in the httpd.conf or maybe a rewrite rules file.

3. The <Proxy> and <Location> configurations in Manfred’s article contain a couple of mistakes (sorry Manfred). The “Order” parameter does not allow spaces after the comma. So, the <Proxy> and <Location> configuration becomes:

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

<Location /clusterjsp>
Order allow,deny
Allow from all
</Location>

4. Pay attention to what you have put in your <Location> tag. This is the context you will use to access the load balancer management console. More on that later….

5. The balancer defined in the <Proxy> tag. This is referenced in the ProxyPass parameter. Also in the ProxyPass parameter is the context of the application that needs to be load balanced. In Manfred’s example, /clusterjsp is the context of the application that is to be load balanced. There is a bunch of information about how to do different configurations for load balancer. A decent place to start for more information is here:

http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html

6. You define the nodes in your cluster in the <Proxy> section. The nodes are defined by the BalancerMember entries. These directives take the same parameters as the ProxyPass directive. So you can assign the route for your nodes to take. For instance:

BalancerMember http://localhost:8080 route=myroute1
BalancerMember http://localhost:8081 route=myroute2
BalancerMember http://localhost:8082 route=myroute3

7. Once you have this all set up and working (you have restarted your apache server), the next thing to do is to take a look at the load balancer console. If you have set this up on your local machine, and we are still working from Manfred’s example, the URL to this console would be this:

http://localhost/balancer-manager

This will load a page where you can enable/disable nodes in the cluster and set the failover node for a particular node. Click the link for one of the nodes. A new section of the page opens to allow you to enter information about the load factor (how much load should that node get), the route (can be anything you want), and the route redirect (which node to go to if this node becomes unavailable). The route redirect is the name of the node. So, if you call your first node “node1″, then the other nodes can refer to this node as “node1″ in the redirect route box.

Also on this page are statistics about errors, usage, status of a particular node. Some useful information about the health of your cluster.

Finally, if you want to disable a particular node (for some maintenance) you can do so from the load balancer console.

There is lots more stuff that you can do with load balancer. If you are the least bit interested, make sure you read the Apache documentation.

http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

Enjoy!


Color Your Tail!

October 9, 2008

This sweet script is by the scripting genius plainkeyman.

Nice job, man! This will definitely come in handy!

http://plainkeyman.blogspot.com/2008/09/console-highlighter.html


Welcome!

October 9, 2008

I started blogging on this topic on engineering.com but realized that not all of my posts were being previewed in some blog readers. I guess that some blog sites want you to actually go to their site so they can claim hits. Whatever….

Anyway, I have another blog on wordpress called americansoccer (americansoccer.wordpress.com) and I enjoyed the tools that wordpress offers and you can see the whole blog entry in blog readers (like google reader). So…here I am!

Anyway, this blog will be about technology. I am primarily a java developer and I primarily develop applications for the web. But, my job entails a whole lot more than just banging out code now and then. So, I decided to start blogging about my more interesting experiences that I have figured out. Mainly so that I can refer back to my own work but also so that someone else may benefit from it. I’ll try to stay on topic but…no promises. Sometimes these issues get pretty nasty!  ;)