Running GlassFish v3 in the Cloud RightScale Sun and RightScale have teamed up to bring developers and sysadmins an easier way to deploy GlassFish in Infrastructure-as-a-Serice (IaaS) environments. RightScale, the leading provider of cloud management solutions, enables you to design, deploy, manage, and automate business-critical applications on the cloud. RightScale's management platform can be accessed from anywhere via web browser. RightScale does not provide servers, it provides software to manage them. RightScale provides cloud-agnostic ServerTemplates that are pre-packaged solutions for common application scenarios and incorporate best practice design architectures. A ServerTemplate for Sun GlassFish Enterprise Server v3 is available in the "Partners" tab of RightScale dashboard (design -> server templates -> view library - > partners tab). Anyone can sing up for the free Developer Edition of RightScale and set up a GlassFish server using this ServerTemplate. The only requirement is that you associate your new RightScale account with an existing cloud account (for example, from EC2). The GlassFish ServerTemplate runs on the Ubuntu OS and perform the following tasks when launched:
- Launches a new virtual server with a clean install of Ubuntu
- Installs the Sun GlassFish Enterprise Server v3 into it
- Detects if there is a database in the Deployment (explained below)
- Installs MySQL Connector/J driver
- Creates a JDBC connection pool and a resource for connecting to the database
- Install JRuby/Rails based upon user choice (default yes)
- Install 3 samples - The last two samples get installed only if a database is configured in the deployment.
- A simple Java EE 6 sample demonstrating Servlet 3.0 + EJB 3.1
- A simple Java EE 6 sample using JSF 2.0 + JPA 2.0 + EJB 3.1 and paginating through the records in the sample database
- A simple Rails 2.3.x application paginating through the records in the sample database
A deployment in RightScale is a container with one or more servers that can be managed as a single unit. Grouping the server together, allows for system level administration, in other words, managing many servers as one. For example, if you have load balancers, app servers and databases that are all part of the same application, you can place them in a deployment together to make it easier to launch, configure and operate them. By being in the same deployment, the newly launched GlassFish server can detect weather there is a database running in it, and if so, connect to it. Sun GlassFish Enterprise Server is also taking advantage of RightScale's macro technology. A macro in RightScale is a way to encode all the steps taken to build a deployment; what servers are a part of it and their exact configuration. That means that running a macro can build a very sophisticated environments in seconds. Macros can take parameters from the user before they run so that they can be customized each time. Two RightScale Macros (design -> macros -> view library -> partners) are available that create GlassFish deployments that include other servers. The macro names along with their explanation are given below. 1. Sun GlassFish Enterprise Server v3 Demo : This macro is targeted at RightScale users who would like to quickly spin a GlassFish instance and connect to a MySQL database. A RightScale user with a free developer account can invoke this macro. Running this macro launches two server instances:
- 1 GlassFish v3 server
- 1 MySQL database instance.
The MySQL server instance is populated with "sakila" sample database, a JDBC connection pool and resource that connects to this sample database is created in the GlassFish server. This allows applications deployed on GlassFish to access the sample database in MySQL. 2. Sun GlassFish Enterprise Server v3 High Availability Deployment - This macro is targeted at RightScale users who would like to run GlassFish v3 in a High Availability environment. A RightScale premium account is required to run this macro. It also requires setting up input values such as DNS entries and database configuration. There is a screen prompt for these items as the macro executes. Running this macro launches six servers:
- 1 GlassFish v3 server
- 1 MySQL Master database
- 1 MySQL Slave database
- 2 Load Balancers
- 1 HTTP Perf server
Cannot resolve external resource into attachment. The above macro also creates a server array (see the yellow box in the diagram) that dynamically expands and shrinks based upon monitored conditions. In RightScale, arrays of servers are used in conjunction with alerts and escalations to define the policies for when to auto provision or de-provision servers. In this case, there is an alert (trigger points to scale up/down) that is configured to add a new server if the CPU usage of 51% or more of all servers in the deployment >75% for 1 min. In other words, if a majority of all the servers in the array CPU load has been greater than 25% for more than one minute, add one more server to the load balanced array. Similarly, there is a counter-rule to shrink the array by one server if the the CPU load <75% for 1 min. The array has been configured to have a minimum size of 0, and a maximum size of 5. MySQL Master/Slave are configured with periodic snapshots to EBS. The two Load Balancers, using Apache + ha_proxy, operate in a round-robin fashion and provides redundancy. Additionally, it also creates an HTTP Perf server that allows to generate load on the server. TBD
- Add a link to rightscale.com docs about Demo macro instructions
- Add a link to rightscale.com docs about High Availability macro instructions
- Add a link to rightscale.com docs about screen
|