Create a cluster with two instances

asadmin start-domain

asadmin create-cluster cluster1

asadmin create-local-instance --cluster cluster1 --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 instance1

asadmin create-local-instance --cluster cluster1 --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 instance2

asadmin start-local-instance instance1

asadmin start-local-instance instance2

demo the domain target

asadmin deploy --target cluster1 webapps-simple.war

asadmin create-application-ref --target server webapps-simple

asadmin disable --target domain webapps-simple

#go to browser: http://localhost:8080/webapps-simple

#go to browser: http://localhost:18080/webapps-simple

asadmin enable --target domain webapps-simple

#go to browser: http://localhost:8080/webapps-simple

#go to browser: http://localhost:18080/webapps-simple

asadmin redeploy --target domain --name webapps-simple --contextroot foo webapps-simple.war

#go to browser: http://localhost:8080/foo

#go to browser: http://localhost:18080/foo

asadmin list-components domain

asadmin undeploy --target domain webapps-simple

asadmin list-components domain

#go to browser: http://localhost:8080/foo

#go to browser: http://localhost:18080/foo

demo the dotted set command

asadmin deploy --target cluster1 webapps-simple.war

asadmin set clusters.cluster.cluster1.application-ref.webapps-simple.enabled=false

#go to browser: http://localhost:18080/webapps-simple

asadmin set clusters.cluster.cluster1.application-ref.webapps-simple.enabled=true

#go to browser: http://localhost:18080/webapps-simple

demo the rolling upgrade

asadmin deploy --target cluster1 --name=foo:BETA-1.0 foo_BETA-1.0/target/foo_BETA-1.0.war

#go to browser: http://localhost:18080/foo

#go to browser: http://localhost:38080/foo

asadmin deploy --target cluster1 --name=foo:BETA-1.1 --enabled=false foo_BETA-1.1/target/foo_BETA-1.1.war

#go to browser: http://localhost:18080/foo

#go to browser: http://localhost:38080/foo

#in the full rolling upgrade scenario, the load balancer will take instance1 off service here

asadmin enable --target instance1 foo:BETA-1.1

#go to browser: http://localhost:18080/foo

#go to browser: http://localhost:38080/foo

#in the full rolling upgrade scenario, the load balancer will put instance1 back in service and take instance2 off service here

asadmin enable --target instance2 foo:BETA-1.1

#go to browser: http://localhost:18080/foo

#go to browser: http://locahost:38080/foo

#in the full rolling upgrade scenario, the load balancer will put instance2 back in service

demo the versioning

asadmin list-application-refs --verbose cluster1

asadmin create-application-ref --enabled=false --target server foo:BETA*

asadmin list-application-refs --verbose

#go to browser: http://localhost:8080/foo

asadmin enable --target server foo:BETA-1.1

#go to browser: http://localhost:8080/foo

asadmin delete-application-ref --target server foo:BETA*

asadmin list-application-refs --verbose

asadmin undeploy --target cluster1 foo:BETA*

asadmin list-components cluster1