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.
Comments:

Post a Comment:
Comments are closed for this entry.
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