Pages

Wednesday, September 14, 2011

Farming Service In JBoss

Share it Please

There are other options for deploying an application in JBoss application server. One such option was using a farming service. Farming service allows us to hot deploy a application (ear, war and sar e.t.c) into the application server. The application needs to be copied directly into the farm directory located in your server profile. Once the application is copied into the farm directory to a server, the other servers which are in cluster will also get the application deployed into their farm directory locations.

Some important Points:

Consider there are 2 servers in the Cluster, prod1 and prod2.

  1. Once the application is copied into the prod1/farm directory, the prod2/farm directory will also get the copy of the application since they are in cluster.
  2. If the prod1 server is running in the cluster and prod2 is shutdown, then if the application is copied into the prod1/farm location and the prod2 is started.prod2/farm will get the application into its farm directory since they are in cluster
  3. If the application is deleted from any one server/farm location, all other servers will also remove the application from their farm locations.
  4. When we copy a application into the /farm location and then start the server to be added to already running Cluster, the /farm location content will not be replicated into the other servers /farm location since the farm service is  not aware that the content in the newly joined server is a new deployment or a already existing one that has been removed while the newly joined server is offline.
  5. Currently farm service supports only achieved files, but not the exploded directories. This is because when the directories are copied, they are copied piece by piece and in mean time any other server in the cluster may try to replicate the content in /farm directory which is not completely copied.
  6. Farming is not recommended for production environment , since

It is not atomic, that is deployment, or undeployment done on one application in prod1/farm location does not mean that it will do the same on other servers in cluster.

It may cause unexpected behavior, if farm server sitting on the disk gone bad, then the application in other server/farm locations too will undeployed or deleted.

  1. Farm service is simply an extension to the URLDeploymentScanner.
  2. The options for the Farm service are available in /deploy/Cluster/farm-deployment-jboss-beans.xml                                                                                                                                   
            
That is all about farming service. Practice with farm service.
More articles to come. Happy Coding.

No comments :

Post a Comment