APEX power! Alan Arentsen brought to you by GlassFish
@alanarentsen alanarentsen.blogspot.com
Application Express Architecture
Supported J2EE Web Servers Application Servers
Supported Application Servers
Miaauw! Virtually everything designed to work on Tomcat works on GlassFish. The GlassFish logo is definitely more attractive than the brown kitty. …
Supported Application Servers GlassFish is a full Java 2 Enterprise Environment (J2EE) environment. GlassFish has a comprehensive administration GUI. Glassfish has a bigger knowledge base because it’s supported much longer than Tomcat.
GlassFish Server Database Application Server Load
Database GlassFish Server Connection Pool HTTP / HTTPS Application Server Load
Database GlassFish Server Connection Pool Application Server Load
hardware overload Connection Pool Application Server Load HTTP / HTTPS
Connection Pool Application Server Load HTTP / HTTPS hardware failure
? redundancy Application Server Load
Load balancer redundancy Application Server Load
Administrative Nightmare
redundancy GlassFish Clustering Node 1 Node 2 Node 3Node 4
redundancy GlassFish Clustering Node 1 Node 2 Node 3Node 4 Cluster 1 Cluster 2
GlassFish Clustering Domain DAS Repository Applications Resources Configuration
Domain Administration Server (DAS) Cluster Site02 Cluster Site01 GlassFish Clustering Node001 Node002 Node003 Instance Node 001 Instance Node 003
GlassFish Clustering Domain DAS Repository Applications Resources Configuration Cluster Site01 Node001 Node002 Node003 Cluster Site02 Instance Node 001 Instance Node 003
GlassFish Clustering Domain DAS Repository Applications Resources Configuration Nodes
GlassFish Clustering Domain DAS Repository Applications Resources Configuration Nodes S1_InstanceN01 Repsitory Cache S2_InstanceN01 Repsitory Cache
GlassFish Clustering Domain DAS Repository Applications Resources Configuration Nodes S1_InstanceN01 Repsitory Cache S2_InstanceN01 Repsitory Cache S2_InstanceN03 Repsitory Cache
GlassFish Clustering Nodes S1_InstanceN01 Repsitory Cache S2_InstanceN01 Repsitory Cache S2_InstanceN03 Repsitory Cache
GlassFish Clustering Nodes S1_InstanceN01 Repsitory Cache S2_InstanceN01 Repsitory Cache S2_InstanceN03 Repsitory Cache ?
Application Express Architecture
Apache HTTP server
Apache Load Balancer
Apache HTTP server Apache Load Balancer httpd.conf VirtualHost: site02.ordina.nl BalancerMember S1_InstanceN01 Repsitory Cache S2_InstanceN01 Repsitory Cache S2_InstanceN03 Repsitory Cache
Apache Load Balancer Application Express Architecture DAS Domain Connection Pool firewall APEX power!
Administration Tools Administration Console asadmin Utility REST Interfaces
Administration Tools Administration Console Pros / Cons: Very nice and complete interface A lot of work to configure Use it for: Minor configuration changes Overview and searching in configurations
Administration Tools asadmin Utility Pros / Cons: Not user friendly GUI Fast configuring server Use it for: Installation scripts Fast configuring multiple servers
Administration Tools REST Interfaces Pros / Cons: Not user friendly GUI Fast configuring server Use it for: Installation scripts Configuring from other applications
Administration Tools Administration Console asadmin Utility REST Interfaces
Live Demo asadmin --user admin --passwordfile ~/passwords --port host localhost
Live Demo asadmin --user admin --passwordfile ~/passwords --port host localhost
Live Demo asadmin --user admin --passwordfile ~/passwords --port host localhost
Live Demo asadmin --user admin --passwordfile ~/passwords --port host localhost
Live Demo asadmin --user admin --passwordfile ~/passwords --port host localhost
Live Demo create-domain --portbase= savemasterpassword=true --savelogin=true DAS_02
Live Demo create-domain --portbase= savemasterpassword=true --savelogin=true DAS_02
Live Demo create-domain --portbase= savemasterpassword=true --savelogin=true DAS_02
Live Demo create-domain --portbase= savemasterpassword=true --savelogin=true DAS_02
Live Demo create-domain --portbase= savemasterpassword=true --savelogin=true DAS_02
Live Demo start-domain DAS_02
Live Demo start-domain DAS_02 stop-domain DAS_02
Live Demo start-domain DAS_02 stop-domain DAS_02 restart-domain DAS_02
Live Demo enable-secure-admin
Live Demo enable-secure-admin restart-domain DAS_02
Live Demo
Live Demo create-node-ssh --nodehost sshuser glassfish --installdir /u00 das02_node001
Live Demo create-node-ssh --nodehost sshuser glassfish --installdir /u00 das02_node001
Live Demo create-node-ssh --nodehost sshuser glassfish --installdir /u00 das02_node001
Live Demo create-node-ssh --nodehost sshuser glassfish --installdir /u00 das02_node001
Live Demo create-node-ssh --nodehost sshuser glassfish --installdir /u00 das02_node001
Live Demo create-node-ssh --nodehost sshuser glassfish --installdir /u00 das02_node001 create-node-ssh --nodehost sshuser glassfish --installdir /u00 das02_node002
Live Demo create-cluster site02
Live Demo create-instance --portbase= cluster site02 --node das02_node001 instance01
Live Demo create-instance --portbase= cluster site02 --node das02_node001 instance01
Live Demo create-instance --portbase= cluster site02 --node das02_node001 instance01
Live Demo create-instance --portbase= cluster site02 --node das02_node001 instance01
Live Demo create-instance --portbase= cluster site02 --node das02_node001 instance01
Live Demo create-instance --portbase= cluster site02 --node das02_node001 instance01 create-instance --portbase= cluster site02 --node das02_node002 instance02
Live Demo scp /root/glassfish3/glassfish/domains/DAS_02/master-password
Live Demo scp /root/glassfish3/glassfish/domains/DAS_02/master-password
Live Demo scp /root/glassfish3/glassfish/domains/DAS_02/master-password
Live Demo scp /root/glassfish3/glassfish/domains/DAS_02/master-password
Live Demo scp /root/glassfish3/glassfish/domains/DAS_02/master-password scp /root/glassfish3/glassfish/domains/DAS_02/master-password
Live Demo start-cluster site02
Live Demo
Live Demo stop-instance instance01
Live Demo stop-instance instance01 start-instance --sync full instance01
Live Demo stop-instance instance01 start-instance --sync full instance01
Live Demo stop-instance instance02 start-instance --sync full instance02
Live Demo deploy --force --target site02 ords.war
Live Demo deploy --force --target site02 ords.war
Live Demo deploy --force --target site02 ords.war
Live Demo deploy --force --target site02 ords.war
Live Demo deploy --force --target site02 ords.war deploy --force --target site02 i.war
Live Demo
Live Demo ServerName site02.local BalancerMember BalancerMember ProxyPass / balancer://glassfish_node_servers/ stickysession=JSESSIONID ProxyPassReverse / balancer://glassfish_node_servers/ ProxyPreserveHost on Order deny,allow Allow from all SetHandler balancer-manager Order Deny,Allow Deny from all # Only allow from internal network Allow from Allow from /24 # Custom log file locations ErrorLog "D:\Apache\Apache2.2.GlassFish\logs\site02-error.log" CustomLog "D:\Apache\Apache2.2.GlassFish\logs\site02-access.log" combined
Live Demo ServerName site02.local BalancerMember BalancerMember ProxyPass / balancer://glassfish_node_servers/ stickysession=JSESSIONID ProxyPassReverse / balancer://glassfish_node_servers/ ProxyPreserveHost on Order deny,allow Allow from all SetHandler balancer-manager Order Deny,Allow Deny from all # Only allow from internal network Allow from Allow from /24 # Custom log file locations ErrorLog "D:\Apache\Apache2.2.GlassFish\logs\site02-error.log" CustomLog "D:\Apache\Apache2.2.GlassFish\logs\site02-access.log" combined BalancerMember BalancerMember
Live Demo ServerName site02.local BalancerMember BalancerMember ProxyPass / balancer://glassfish_node_servers/ stickysession=JSESSIONID ProxyPassReverse / balancer://glassfish_node_servers/ ProxyPreserveHost on Order deny,allow Allow from all SetHandler balancer-manager Order Deny,Allow Deny from all # Only allow from internal network Allow from Allow from /24 # Custom log file locations ErrorLog "D:\Apache\Apache2.2.GlassFish\logs\site02-error.log" CustomLog "D:\Apache\Apache2.2.GlassFish\logs\site02-access.log" combined BalancerMember BalancerMember
Live Demo ServerName site02.local BalancerMember BalancerMember ProxyPass / balancer://glassfish_node_servers/ stickysession=JSESSIONID ProxyPassReverse / balancer://glassfish_node_servers/ ProxyPreserveHost on Order deny,allow Allow from all SetHandler balancer-manager Order Deny,Allow Deny from all # Only allow from internal network Allow from Allow from /24 # Custom log file locations ErrorLog "D:\Apache\Apache2.2.GlassFish\logs\site02-error.log" CustomLog "D:\Apache\Apache2.2.GlassFish\logs\site02-access.log" combined BalancerMember BalancerMember
Live Demo ServerName site02.local BalancerMember BalancerMember ProxyPass / balancer://glassfish_node_servers/ stickysession=JSESSIONID ProxyPassReverse / balancer://glassfish_node_servers/ ProxyPreserveHost on Order deny,allow Allow from all SetHandler balancer-manager Order Deny,Allow Deny from all # Only allow from internal network Allow from Allow from /24 # Custom log file locations ErrorLog "D:\Apache\Apache2.2.GlassFish\logs\site02-error.log" CustomLog "D:\Apache\Apache2.2.GlassFish\logs\site02-access.log" combined BalancerMember BalancerMember
Live Demo ServerName site02.local BalancerMember BalancerMember ProxyPass / balancer://glassfish_node_servers/ stickysession=JSESSIONID ProxyPassReverse / balancer://glassfish_node_servers/ ProxyPreserveHost on Order deny,allow Allow from all SetHandler balancer-manager Order Deny,Allow Deny from all # Only allow from internal network Allow from Allow from /24 # Custom log file locations ErrorLog "D:\Apache\Apache2.2.GlassFish\logs\site02-error.log" CustomLog "D:\Apache\Apache2.2.GlassFish\logs\site02-access.log" combined ProxyPass / balancer://glassfish_node_servers/ stickysession=JSESSIONID
Live Demo
Live Demo
Load Monitoring
GlassFish Performance Tuning
Alan Arentsen alanarentsen.blogspot.com