users@glassfish.java.net

Re: Clustring in GlassfishESB

From: Mark S White <Mark.White_at_Sun.COM>
Date: Thu, 26 Mar 2009 16:49:30 -0700
It appears you're deploying one of the GlassFish samples. You will probably get a better
response from the GlassFish users mail list (copied).

Brij Mohan Negi (India) wrote:
Here is attachment for reference.
 
Thanks
Brij


From: Brij Mohan Negi (India) [mailto:Brij.Negi@sdgc.com]
Sent: Thursday, March 26, 2009 11:02 AM
To: users@open-esb.dev.java.net
Subject: Clustring in GlassfishESB

 Hi ,

 

I am trying to achieve the following shown in the diagram using clustering . I am able to do the red part successfully but i

have some doubts in the blue part.

              I have done the clustering part for glassfish as shown below.

 

Issue:-  The session data persist for the instances of one node(Host1) but lost for the instances belong to another node (Host2) .

 

 

Kindly suggest .

 

 

 

 

 

Clustering in Glassfish Esb

 

 

 

 

Objectives

 

 

To use Cluster in Glassfish for deploying application.

 

 

 

Prerequisites

 

The profile of the Glassfish domain should be “cluster”

 

 

 

 

 

Contents

 

  1. Creating domain of type “Cluster”

 

  1. Node Agent creation

 

  1. Cluster creation.

 

4.   Deploying an application to the cluster.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(A)Creating domain of type “Cluster”

 

Step1. Start the Glassfish Esb and go to services tab.

 

Step2. Right click on the server and select add server.

           

 

Step3. Click on AddServer  and select Glassfish V2 . Enter the name of server as desired and 

           click next.

 

 

           

 

 

 

 

 

 

 

 

Step4. Click on “Register local domain” and select the profile as “cluster”. Click on next.

 

           

 

Step5. Now enter the location/path where you want to create this domain and click on next

           

 

Step6. Enter the Admin username and password and click on next. Note down the Admin port

           and click on finish. Start the server.

 

This completes the creation of adding glassfish sever with domain profile as “cluster”.

 

Note:- The default profile of Glassfish while installing Glassfishesb is “developer” and this doesn’t support cluster, hence we need to have glassfish with profile as cluster for enabling clustering.

 

 

(B) Node Agent creation

 

Step7. Go to the bin directory of Glassfish and click on asadmin.

 

 

Step9.  Now enter the following command and press enter button.

 

           

                          

 Here the port number should be one which you have noted in step6 and enter the name of nodeagent as per your

Requirement.

 

Step10. Enter the password for nodeagent and press enter button. The following message will be displayed on successful creation of nodeagent.

 

“create-node-agent executed successfully”

 

Step11. Start the node agent using following command.

 

            “start-node-agent --user admin nodeagentSESB”

 

          The following message will be displayed on successful start of the nodeagent.

 

          “start-node-agent executed successfully”

 

Note:- This completes the creation of node agent

(C) Cluster and instance creation

 

Step12. Right click on the server and select “View Admin Console”. This opens the admin

             console of glassfish , now enter the username and password.

 

Step13. Click on create cluster as shown below.

               

 

 

 

Step14.  Enter the name of cluster and click on new.

 

 

Step15. Enter the name of the instance and check whether the node agent created above is shown in drop down or not. The node agent has to be selected. In the same way create another instance with the same node agent. Click on ok  

 

 

 

Step16. The following screen gets displayed. Now click on start cluster.

 

 

 

Step 17. Once the cluster get started, note the instance which were created should be running as

              shown below.

 

 

 

 

 

(D) Deploying an application to the cluster.

 

Step18. Click on above created cluster.

 

Step19. Now click on application ->Deploy->BrowseFiles

              ->GlassFishEsb->glassfish->samples->quickstart->clusterjsp->clusterjsp.ear.

           

 

 

Step20.  The Availability option should be checked. Click on ok.

 

 

 

 

 

 

Step21. Now enter the following url in the browser and enter data in the “Name of Session  

 

            Attribute” input box and also in “Value of Session Attribute” input box and click on “add session data button”

 

                http://localhost:38080/clusterjsp/

 

 

 

 

Step22. Now we need to stop this instance in order to verify that the data is not lost if the request is served by instance_1.  Click on “stop instance” button.

 

 

Step23. Now enter the following url .

               http://localhost:38081/clusterjsp/HaJsp.jsp

             Now verify that the other instance is up and whaterver data we saved in previous case is    now available.

 

 

 

Note:- This completes the following part marked in red circle. Here we created just two instances.

 

 

 

 

Step 24.  Now in order to do the blue part just do the same activity on another Host/machine

               starting from step1 to step9 except step4. In step 4 Instead of selecting “Register Local

               Domain” now select “Register Remote Domain” as shown below.

 

Step 25. Click on next and give the host name and port number of the remote domain. Now give

 

             the admin username and password and click on finish.

 

 

Step26. Now open the admin console and click on cluster. Create another two instances but the node agent corresponding to them should be one which you have created in step 24.

 

Step27.  Deploy the application again to the cluster as we did in step 19, 20.

 

Step28. The application will be deployed to all the four instances automatically.

 

Step29. Now do the same as step 21,22. The port number should be according to the instances.

 

 

Note:- In this case the session data persist for different instances belonging to same node agent but the data is lost for different node agent.


--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@open-esb.dev.java.net For additional commands, e-mail: users-help@open-esb.dev.java.net


picture
(image/jpeg attachment: 01-part)