Вы находитесь на странице: 1из 26

Resin, Deployment, Cloud, Clustering and EC2 (How To) Part 1

Session Replication, App Deployment and Clustering on EC2

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved. caucho , resin and quercus are registered trademarks of Caucho Technology, Inc.

Thursday, April 5, 12

Overview

Tutorial covers basics of using Resin Java Application Server on EC2 and EC2 like environments Setting up Resin Doing a cloud deploy Setting up Resin Pro license Deploying to EC2 box Eclipse to create a simple war le and then deploy it to Amazon EC2

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Resin works well with EC2 and IaaS solu8ons

Many Steps in tutorial same for other IaaS solutions Eucalyptus, CloudStack with CloudBridge, RightScale myCloud or even OpenNebula this guide should help you along as they all support the Amazon EC2 REST APIs. Any IaaS cloud computing environment (private or public, on premises or hosted) very similar steps Xen Server, Xen Cloud or VMWare vSphere etc. should be similar Servers not only as a Resin on EC2 environment tutorial but just a general Resin deployment tutorial

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Development boxes

Local dev box is Ubuntu (could be Linux, Windows, Mac OSX, but choose Ubuntu)

Remote EC2 box is Amazon Linux Amazon Linux like CentOS CentOS like RedHat In a way it is a good Resin Linux tutorial that covers Debian like, and Red Hat like instances (Resin runs on Solaris, Linux, Windows, Berkeley and Mac OSX).

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Familiar with Amazon EC2?

If not, start here: http://docs.amazonwebservices.com/AWSEC2/ latest/GettingStartedGuide/Welcome.html (then come back) Learn how to start/stop instances, etc.

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Amazon WS Console to launch instance

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Start up new instance then install Resin

Fire up an Amazon Instance using Amazon Linux (basically CentOS 5.4)

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Make sure Resin is running

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Install Resin on local dev box (Ubuntu)

Add Caucho's Debian repository to system's repositories edit /etc/apt/sources.list Add this line

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Test Resin setup on local dev box

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Use Eclipse to create test war le

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Create a simple servlet

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Export war le

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Deploy and test locally

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Create an Elas8c IP for your AMI Instance

Amazon EC2 instances are assigned two IP addresses 1 public, and 1 private The public address is mapped via Network Address Translation (NAT) Every time you start or restart an instance, it gets new public and private addresses This makes it hard to congure a static cluster topology

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Create an Elas8c IP for your AMI Instance

Amazon EC2 provides a service called Elastic IP addresses Elastic IP addresses are static IP addresses. Elastic IP addresses are associated with your account, not a specic instances. You can associate an Elastic IP address with an instance. It is good to associate your instance with an IP address so you can direct your calls to that instance when deploying an application Also you need to know some address to congure the Triad (Resin only communicates with private addresses, but uses public addresses and a secure handshake to exchange private addresses)

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Create an Elas8c IP for your AMI Instance

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Elas8c IP address

It has to be reassign every time the server starts up It has to be assigned to an AMI instance in order to be used

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Password and User name

You cant execute commands remotely without a username and password To do a remote deploy on Amazon EC2 from your dev box, you need a user name and password

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Create password for your Amazon Cloud instance

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Put user-data with creden8als in AMI instance

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Create ec2.xml le and install it in Amazon AMI

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Make sure right ports are open

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Deploy from command line

From development box, deploy test hello.war

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Conclusion

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Related links

Part 1 Resin Java EE Application Server clustering and deployment to EC2 (this in WIKI form) Part 2 Resin clustering and deployment to EC2, session replication, Amazon Load Balancer Resin Java EE Application Servers Cloud Support and Clustering Support Resin White Paper on Java EE Cloud Computing

Caucho Home | Contact Us | Caucho Blog | Wiki | Application Server / Web Server Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
Thursday, April 5, 12

Вам также может понравиться