Tuesday Apr 17, 2007

A recipe to create clusters with GlassFish V2 ...

I have been seeing several questions about clustering on GlassFish Users alias. Here is a simple recipe, very crude, but the one that works.

Questions? Shoot.

  • Domain Spans machines, usually. One of the machines is designated as DAS.
  • The DAS is the admin server and it manages the servers in the same domain. The servers can be clustered if administrator wants them so. The administrator has benefits of management when instances are clustered. Now, on the other machine, all you need is "bits".
  • Consider the scenario: You have "m1" and "m2" as two machines.
  • Let's say you want to create a cluster "c1" with instances "s1" and "s2" with node-agents "na1" on "m1" and "na2" on "m2".
  • Your DAS is on "m1".
  • Let's call the domain where all this "logically" resides as "domain1". You do the following:
    • 1- Download the glassfish.jar on both "m1" and "m2".
    • 2- On "m1", run "ant -f setup-cluster.xml". This creates the domain, domain1 that is capable of handling clusters.
    • 3- On "m1", you start domain, domain1.
    • 4- On "m1", /asadmin create-node-agent na1
    • 5- On "m2", run ant -f setup-cluster.xml on glassfish.jar you downloaded (after of course, java -jar ...) This creates a domain on that machine as well, but you don't need it. I will file an RFE in this regard.
    • 6- On "m2" you create a node-agent \*pointing to domain1 on "m1"\* as: /asadmin create-node-agent --host m1 --user admin-user na2
    • 7- On "m1", /asadmin start-node-agent na1 On "m2", /asadmin start-node-agent na2 Now, your topology is created and ready to go. You have a domain domain1, this spans "m1" and "m2". Node-agent "na1" is on "m1". It will control instances on "m1". Node-agent "na2" is on "m2". It will control instances on "m2". From this point on, forget you had machine "m2". The entire configuration can be done just from machine "m1". This is the beauty of the process, IMO.
    • 8- On "m1", just try: /asadmin create-cluster c1
    • 9- On "m1", /asadmin create-instance --cluster c1 --nodeagent na1 s1 This puts "s1" in cluster "c1". Note that this instance is controlled by Node Agent "na1". This instance uses "physical resources" from "m1".
    • 10- On "m1", (not "m2"!) /asadmin create-instance --cluster c1 --nodeagent na2 s2 11- On "m1", /asadmin start-cluster "c1". This is where it culminates. All you do is "start cluster". It starts instance "s1" on "m1" and "s2" on "m2". The instances have homogeneous configuration.

Thursday Apr 05, 2007

Sun Application Server Builds and Clustering ...

I think there is some confusion in this regard. I think I must clarify certain things here. This post is about which distributions of Sun's application server have clustering support "out-of-the-box".

Simple answer: ALL .

Long Answer:

Following distributions of application server all have clustering support built into them:

The reason this is possible is because the core application server code base is exactly the same in all the distributions. It is the various other 3PP (third party products) that differ. For example, the SDK bundle (it has different official name, check out http://java.sun.com/javaee for details) has other software like access manager and portal server support, whereas the EE bundle has HADB to store the state and has NSS and Load-balancer plugin among other things.

The features that enable this (amazing, IMO) feat are:

  • In-memory replication of conversational state.
  • Usage Profiles.
  • IIOP failover.
So, next time you need clustering support, don't look for EE, PE, SDK and GlassFish builds do the job. I will post more in this regard soon ...
About

Welcome to my blog where mostly my work related thoughts are expressed.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today