GlassFish Server Open Source Edition 3.1

PRT Clustering Infrastructure Demo

The clustering infrastructure features available in 3.1 will be demonstrated using the following script.

Team

This demo is brought to you by the core clustering infrastructure team:

  • Jennifer Chou
  • Byron Nevins
  • Bhakti Mehta
  • Tom Mueller
  • Vijay Ramachandran
  • Bill Shannon

Setup

  • Install GlassFish Server Open Source Edition 3.1 software on 3 servers, referred to as das, node1 and node2 in these instructions. The DAS will run on node das
  • Setup SSH so that das can communicate to both node1 and node2

The demonstration consists of running a DAS with a cluster, c1, that contains two instances. The DAS runs on its own node, instance in1 runs on node1 and instance in2 runs on node 2. instance 2 and 3 will run on node2. The HTTP ports for the instances are both 28080. Since SSH is configured, all configuration can be done from the DAS node.

On the DAS node, start the DAS, create the cluster, create nodes, create instances, start the cluster, and deploy an application to the instances.

asadmin start-domain
asadmin create-cluster c1
asadmin create-node-ssh --nodehost glassfish-x86-2.sfbay.sun.com --installdir /export/home/hudson/test/glassfishv3 node1
asadmin create-node-ssh --nodehost iasengsol6.sfbay.sun.com --installdir /export/home/hudson/test/glassfishv3 node2
asadmin create-instance --cluster c1 --node node1 in1
asadmin create-instance --cluster c1 --node node2 in2
asadmin start-cluster c1
asadmin deploy --target c1 apps/helloworld.war

List the instances to see that they are running.

asadmin list-instances

Use a browser to show the following URLs on the instances:

Use a browser to show the REST interface that is available on an instance and how it differs from the DAS:

Browse through to the list of <config> and to the list of <server>

  • notice how DAS has 3 server elements – instances each have only the instance in the cluster.
  • notice that DAS has all the <config> elements while instances have just one or two.

Mention that this "idiot-proof"s instances in one respect – they can't foul-up others' config elements, only DAS can do that!

Show directory structure on node2

ls glassfish/nodeagent/node2

Show contents of domain.xml

vi glassfish/domains/domain1/config/domain.xml

Run commands with cluster target and show replication on all instances in a cluster

asadmin create-jdbc-connection-pool --datasourceclassname org.apache.derby.jdbc.ClientDataSource --restype javax.sql.XADataSource --target c1 sample_jdbc_pool
asadmin create-iiop-listener --target c1 --listeneraddress 192.168.1.100 --iiopport 1400 sample_iiop_listener
asadmin create-connector-connection-pool --target c1 --raname jmsra --connectiondefinition javax.jms.QueueConnectionFactory jms/qConnPool

Use a browser and show the following links to show how the command is automatically replicated to all instances in a cluster

  • http://host:port/management/domain/resources/jdbc-connection-pool
  • http://host:port/management/domain/configs/config/c1-config/iiop-service/iiop-listener
  • http://host:port/management/domain/resources/connector-connection-pool

Show the domain.xml file on in3 to show how it has been modified

Run command with instance target and show replication only to that instance

asadmin create-connector-connection-pool --target in2 --raname jmsra --connectiondefinition javax.jms.QueueConnectionFactory jms/instanceOnlyConnPool

Use a browser and show the following links to show how the command is automatically replicated to the instance only

  • http://host:port/management/domain/resources/jdbc-connection-pool
  • http://host:port/management/domain/configs/config/c1-config/iiop-service/iiop-listener
  • http://host:port/management/domain/resources/connector-connection-pool

Run commands and show replication

asadmin delete-jdbc-connection-pool --target c1 sample_jdbc_pool
asadmin delete-iiop-listener --target c1 sample_iiop_listener
asadmin delete-connector-connection-pool --target c1 jms/qConnPool

Use a browser and show that the delete commands' effect

  • http://host:port/management/domain/resources/jdbc-connection-pool
  • http://host:port/management/domain/configs/config/c1-config/iiop-service/iiop-listener
  • http://host:port/management/domain/resources/connector-connection-pool

Stop and delete the instances. On DAS:

asadmin stop-cluster c1
asadmin delete-instance in1
asadmin delete-instance in2
asadmin delete-cluster c1
asadmin stop-domain

Mention that the first command here stops an instance on a remote node and the delete-instance commands operate on the remote nodes via SSH.


ms1demo3.png (image/png)
PRTDemoDiagram.png (image/png)