Deploying to Amazon EC2 in Mulesoft

Deploying to Amazon EC2

The EC2 plugin allows you to create Amazon machine instances (AMIs) of your existing Tomcat instances and deploy them to EC2 via the Tcat Server console. This page describes how to install the plug-in, create the AMI, and deploy it. If you want to use an existing, fully configured cloud implementation of Tomcat instead of creating and deploying your own instance, see Using Cloudcat with Amazon EC2 instead.

Installing the Plug-in

To install the EC2 plug-in, simply download it from the Tcat Server download page and copy it to your TCAT_HOME/webapps/console/WEB-INF/plugins directory. This directory must be owned and have the same permissions as TOMCAT_USER. When you run the administration console, the Amazon EC2 tab will appear.

If you are using Mule iBeans, you must delete the mule-ibeans/lib/modules/deployed/ibeans-module-spring-1.0-beta-9-full.jar to enable iBeans and the EC2 plugin to work in the same instance of Tcat Server.

Creating an Amazon EC2 Account

Before you can get started, you must create an Amazon EC2 account. Note your access key ID and secret key. If you have an existing account, you can find them by logging into the EC2 website, clicking Your Account, and selecting Security Credentials.

You also need to create a key pair if you do not already have one. To do this, log into the EC2 Console, click Key-Pairs on the left, click the Create Key Pair button, and then enter a key pair name. For more info Mulesoft Online Training

Opening Ports

By default, Amazon creates a firewall that prevents any communication from happening between the outside world and your EC2 instances. To change this, you must download the EC2 tools so you can open ports. You then issue the following commands:

$ ec2-authorize -p 8080 default
$ ec2-authorize -p 51433 default

This opens up ports 8080 and 51433 by default.

Amazon Machine Images

Amazon Machine Images (AMIs) are images that get provisioned to each EC2 instance. You should familiarize yourself with the AMI concepts in the EC2 documentation before proceeding.

You want to create your own AMI with a Tcat Server instance on it. For testing purposes, we provide an image with Tcat Server and Ubuntu 9.04 from Alestic. On startup, this image starts Tcat Server and makes it available on port 8080. Note that we provide this image on an unsupported basis solely for testing, and the image ID and details of this image may change in the future. The test image ID is: ami-f7d8389e

Using the Plugin

The Amazon EC2 tab in the Tcat Server administration console allows you to manage your EC2 accounts and instances. The first step is to create the account, and then you create your instances.

To create the account:

1. On the Amazon EC2 tab, click New Account.

2. Enter a name for the account, your Amazon access key ID, your secret key, and the name of the key pair you created.

3. Click OK.

To create an instance:

1. On the Amazon EC2 tab, click New Instance.

2. Select the Amazon account you created.

3. Enter the number of EC2 instances you want to create.

4. Enter the name of the server (instance). If you are creating multiple instances, you can use the {host} variable to insert the name of the host into the instance name, such as MyHost-{host}.

5. Enter the ID of the AMI you created, or use the test AMI ID Specify the instance type (size). This affects how much your Amazon account is charged.

6. Enter the name of the key pair to use with these servers.

7. If you want to automatically register these instances with your Tcat Server administration console, so that you can manage these Tcat Server instances, select the Auto Register Server check box.

8. Enter the URL path where you want the Tcat Server agent WAR to reside. By default, set this to /agent.

9. Enter the port to use for the Tcat Server agent.

10. Select any server groups you want to add these new servers to.

11. Click Add.

After the plug-in issues a new instance request, it takes a while for Amazon to provision the image. The instances list displays "pending" until the image is created, at which point it displays "running". Your new Tcat Server instance is then available on the Servers tab if you opted to automatically register it.

Creating a Tcat Server AMI

If you are deploying Tcat Server to a production environment, typically you create your own AMI with Tcat Server on it.

Configuring Tcat Server for Automatic Startup on Your AMI

To ensure that you can automatically register your new Tcat Server instance, you should configure the Tcat Server instance on your AMI to start automatically on server startup. On Linux, you can do this through an init script.

1. Install Tcat Server (or Tomcat and the Tcat Server agent WAR) into your /usr/local/tcat directory.

2. Download this init script to /etc/init.d/tomcat.

3. Execute chmod +x /etc/init.d/tomcat.

4. Execute chmod +x /usr/local/tcat/conf/

5. Execute the update-rc.d tomcat defaults command. This configures Ubuntu to run the init script on startup.

6. If you install Tcat Server in a different location, edit the /etc/init.d/tomcat script APP_ENV variable to reflect where Tcat Server is installed.

To get in-depth knowledge, enroll for live free demo on Mulesoft Training




1 篇文章1 人订阅


0 条评论
登录 后参与评论







JavaScript 和 jQuery 跳转页面的方法有很多种,下面整理了几个:





IT兄弟连 HTML5教程 CSS3揭秘 CSS3属性3

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 ...






下面分享一个 jQuery 实时统计输入框输入字数及限制输入字数的方法,代码如下:





热点图 页面缩放不改变位置

jQuery下载地址: CSS下载地址:



1.将json对象转化为json字符串,再判断该字符串是否为"{}" var data = {}; var b = (JSON.stringify(data) ...


最好用的 Python 命令行库:click

在本系列前面几篇文章中,我们分别介绍了 argparse 和 docopt 的主要功能和用法。它们各具特色,都能出色地完成命令行任务。argparse 是面向过...




年度创作总结 领取年终奖励