专栏首页EducationDeploying to Amazon EC2 in Mulesoft

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/tomcat-env.sh.

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

原文链接:https://docs.mulesoft.com

我来说两句

0 条评论
登录 后参与评论

相关文章

  • Face_Recognition_v3a

    In this assignment, you will build a face recognition system. Many of the ideas ...

    列夫托尔斯昊
  • Protocol Buffer Basics: Java(一)

    This tutorial provides a basic Java programmer's introduction to working with pr...

    阿泽
  • How to Accelerate Your Python Deep Learning with Cloud GPU?

    This afternoon, I trained a 3-layers neural network as a regression model to pre...

    王树义
  • Kotlin 编码规约

    如需根据本风格指南配置 IntelliJ 格式化程序,请安装 Kotlin 插件1.2.20 或更高版本,转到“Settings | Editor | Code...

    一个会写诗的程序员
  • HDU - 6187 (最大生成树) 最小生成树

    Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 132768/132768 K (Java/Ot...

    风骨散人Chiam
  • SAP UI5应用如果遇到数据绑定问题时,应该如何自己定位问题?

    I will use the field “ClosingDate” to demonstrate my favorite approach to troubl...

    Jerry Wang
  • From High Ceph Latency to Kernel Patch with eBPF/BCC

    There are a lot of tools for debugging kernel and userspace programs in Linux. M...

    Linux阅码场
  • 语义分割--Global Deconvolutional Networks for Semantic Segmentation

    语义分割 Global Deconvolutional Networks for Semantic Segmentation BMVC 2016 ...

    用户1148525
  • 基于光谱动力学的想象语音和视觉图像的功能连通性(CS)

    头脑与计算机接口技术的最新进展显示了想象的语音和可视图像作为直观的头脑与计算机接口通信的强大范例的潜力。然而,这两种范式的内在动力及其内在特征尚未揭示。在这篇论...

    用户8078865
  • Assembly - Registers

    Processor operations mostly involve processing data. This data can be stored in ...

    RainMark

扫码关注云+社区

领取腾讯云代金券