GlassFish Server Open Source Edition 3.1 Milestone 1 - Command Replication Demo The basic command replication mechanism available with MS1 will be demonstrated using the following script. Setup:
- Install GlassFish Server Open Source Edition 3.1 software on 2 servers, referred to as node1 and node2 in these instructions. The DAS will run on node1.
- Set environment variable ENABLE_REPLICATION=true
- This is required since command replication is switched off by default till all CLIs are verified and modified, if required, to work in the cluster envurinment
- asadmin create-local-instance must use --system-properties to specify ports
- This is required because the key-value replacement in domain.xml is targeted for MS2 only
The demonstration consists of running a DAS with a cluster, c1, that contains three instances. The DAS and instance 1 will run on node1 and instance 2 and 3 will run on node2. The default HTTP port for the first two instances is 28080. Instance 3 will use 28081. On node1:
asadmin start-domain
asadmin create-cluster c1
asadmin create-local-instance --cluster c1 --systemproperties HTTP_LISTENER_PORT=18080:HTTP_SSL_LISTENER_PORT=18181:IIOP_SSL_LISTENER_PORT=13800:IIOP_LISTENER_PORT=13700:JMX_SYSTEM_CONNECTOR_PORT=17676:IIOP_SSL_MUTUALAUTH_PORT=13801:JMS_PROVIDER_PORT=18686:ASADMIN_LISTENER_PORT=14848 in1
On node2:
asadmin --host {DAS_HOST} create-local-instance --cluster c1 --systemproperties HTTP_LISTENER_PORT=18080:HTTP_SSL_LISTENER_PORT=18181:IIOP_SSL_LISTENER_PORT=13800:IIOP_LISTENER_PORT=13700:JMX_SYSTEM_CONNECTOR_PORT=17676:IIOP_SSL_MUTUALAUTH_PORT=13801:JMS_PROVIDER_PORT=18686:ASADMIN_LISTENER_PORT=14848 in2
asadmin --host {DAS_HOST} create-local-instance --cluster c1 --systemproperties HTTP_LISTENER_PORT=38080:HTTP_SSL_LISTENER_PORT=38181:IIOP_SSL_LISTENER_PORT=33800:IIOP_LISTENER_PORT=33700:JMX_SYSTEM_CONNECTOR_PORT=37676:IIOP_SSL_MUTUALAUTH_PORT=33801:JMS_PROVIDER_PORT=38686:ASADMIN_LISTENER_PORT=34848 in3
Start the instances. On node1:
asadmin start-local-instance in1
On node2:
asadmin start-local-instance in2
asadmin start-local-instance in3
List the instances to see that they are running. On node1:
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://
Unknown macro: {host}
/management/domain/resources/jdbc-connection-pool
- http://
Unknown macro: {host}
/management/domain/configs/config/c1-config/iiop-service/iiop-listener
- http://
Unknown macro: {host}
/management/domain/resources/connector-connection-pool
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://
Unknown macro: {host}
/management/domain/resources/jdbc-connection-pool
- http://
Unknown macro: {host}
/management/domain/configs/config/c1-config/iiop-service/iiop-listener
- http://
Unknown macro: {host}
/management/domain/resources/connector-connection-pool
Run commands and show replication
asadmin delete-iiop-listener --target c1 sample_iiop_listener
asadmin delete-connector-connection-pool --target c1 jms/qConnPool
Use a browser to show the REST interface that is available on an instance and how it differs from the DAS:
- http://
Unknown macro: {host}
/management/domain/resources/jdbc-connection-pool
- http://
Unknown macro: {host}
/management/domain/configs/config/c1-config/iiop-service/iiop-listener
- http://
Unknown macro: {host}
/management/domain/resources/connector-connection-pool
|