Deployment in AWS with Auto Scaling (DRAFT): Difference between revisions

From Grooper Wiki
Line 93: Line 93:
<tab name="System Specs" style="margin:20px">
<tab name="System Specs" style="margin:20px">
=== System Specs ===
=== System Specs ===
Next, you will choose the virtual machines system specifications.  There is some flexibility in your choices.  However, there are some requirements and best practice suggestions you'll need to keep in mind.  You will configure the following:


{|cellpadding=10 cellspacing=5
{|cellpadding=10 cellspacing=5
|valign=top style="width:40%"|
|valign=top style="width:40%"|
<br>
<br>
Next, you will choose the virtual machines system specifications.  There is some flexibility in your choices.  However, there are some requirements and best practice suggestions you'll need to keep in mind.  You will configure the following:
# '''Application and OS Image'''
# '''Application and OS Image'''
#* '''Windows Server 2012''' or later or '''Windows 10''' or later is required.
#* '''Windows Server 2012''' or later or '''Windows 10''' or later is required.
Line 118: Line 118:
[[File:2021-aws-how-to-04.png]]
[[File:2021-aws-how-to-04.png]]
|}
|}
</tab>
</tab>
<tab name="Network Settings and Login Info" style="margin:20px">
<tab name="Network Settings and Login Info" style="margin:20px">
=== Network Settings and Login Info ===
{|cellpadding=10 cellspacing=5
|valign=top style="width:40%:"|
=== Network Settings ===
 
Generally speaking, every organization will have their own network security requirements.  Your IT department will need to configure the EC2 instance's '''Network Settings''' panel according to your needs.
* For more information on networking, visit the Amazon documentation [here].
* For more information on security, visit the Amazon documentation [here].
 
For the purposes of this demo, we will use the default '''Network Settings'''.  However, for all deployments we will need to configure port access using a '''Security Group'''.
 
# To create a new '''Security Group''', select the "Create security group" option.
# If you have an existing '''Security Group''' you can use, select the "Select existing security group" option and select the '''Security Group'''.
 
We will create a new '''Security Group''' in this demonstration.
|valign=top|
[[File:2021-aws-how-to-05.png]]
|-
|valign=top|
=== Login Info ===
 
Amazon ''strongly'' recommends you log into EC2 instances using a key pair.  If you plan on connecting to your virtual machines using RDP (which we will in this tutorial), you ''must'' specify a key pair.
* For more information on key pairs, please visit the Amazon documentation [https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-key-pairs.html here].
 
# You may specify an existing key pair using the dropdown menu.
# You may create a new key pair by following this link.


We have already generated a key pair and selected it.
|valign=top|
[[File:2021-aws-how-to-06.png]]
|}
===
</tab>
</tab>
<tab name="Grooper Installation" style="margin:20px">
<tab name="Grooper Installation" style="margin:20px">

Revision as of 13:55, 20 June 2022

WIP This article is a work-in-progress or created as a placeholder for testing purposes. This article is subject to change and/or expansion. It may be incomplete, inaccurate, or stop abruptly.

This tag will be removed upon draft completion.

Easily scale your Grooper processing with cloud-based computing using Amazon Web Services and Auto Scaling.

About AWS

Imagine you normally process a hundred documents a day. Then, out of nowhere, you start getting a thousand documents a day. Maybe its a busy time of year for you. Maybe you landed a huge client and need to process their paperwork. Great news! But how do you account for the increase in computing demands? How do you both scale up your IT infrastructure to meet the new demand and scale it down once the demand has subsided?

One answer lies in cloud-based computing. Spinning up a pool of virtual machines to process the additional workload is, generally speaking, quicker and more cost effective than purchasing and deploying physical computers. Furthermore, what are you going to do once you're done processing all that extra work? With a cloud-based IT infrastructure, you can quickly deactivate those machines and re-activate them as needed on-demand. With a physical infrastructure, you're stuck holding a lot of additional hardware until you need it again.

Amazon Web Services (AWS) is one of the most popular on-demand cloud computing providers. Their Elastic Compute Cloud (EC2) gives users a pay-as-you-go model to create, launch and terminate virtual computers, as needed. These virtual machines (which Amazon calls "instances") can be built to mirror physical computer specifications, including operating system, CPU, RAM and storage options. EC2 encourages scalability with web services that allow you to take a snapshot of a server's configuration (an Amazon Machine Image or "AMI") and boot a virtual machine with whatever software you need already loaded.

Furthermore, the process of spinning up and spinning down virtual machines can be automated with AWS Auto Scaling. This allows users to set automatic scaling parameters, defining when to launch new EC2 instances to meet surges in processing demand. The virtual machines are then terminated as soon as demand dies down. With a pay-for-use model, you only pay for the machines while they're running. Ultimately, this saves you time scaling your IT infrastructure up and down and saves you money only paying for what you need when you need it.

In this article, we will show you how to set up a scalable Grooper deployment using Amazon Web Services (AWS), Elastic Compute Cloud (EC2) instances and Auto Scaling.

The General Process

The general steps to complete this deployment setup are as follows:

  1. Launch the "Main" EC2 instance.
    • This is the virtual machine that hosts the Grooper Repository's database and file store and the Grooper license for the "Worker" machines.
  2. Setup the Security Group.
    • In AWS, Security Groups are a set of firewall rules, restricting inbound and outbound traffic based on protocols and port numbers.
  3. Launch the "Worker" EC2 instance.
    • This is the virtual machine performing automated processing tasks.
    • Grooper will need to be installed. Grooper will need to be licensed using the Main instance's hosted licensing. The Worker instance will need to be able to connect to the Main instance's Grooper Repository.
  4. Create an Amazon Machine Image (AMI) of the Worker instance.
    • This image will be a snapshot of the Worker machine, with Grooper installed and ready for document processing.
    • This is used to create new Worker instances automatically according to the Auto Scaling setup.
  5. Create a Launch Template.
    • Essentially, a Launch Template is a set of instructions to launch a new EC2 instance programmatically (rather than manually, as done in step 3).
    • Auto Scaling will use the Launch Template to create new Worker instances, using the AMI created in step 5, and assign the right Security Group.
  6. Configure the Auto Scaling policies.
    • This defines the minimum and maximum number of virtual machines to be added as well as the scaling rules, what conditions should be met to spin up and down new EC2 instances.

How To

Launch the "Main" EC2 Instance

First, you must launch and configure the "Main" EC2 instance. This virtual machine will be the server hosting the Grooper Repository environment as well as the Grooper Licensing service supplying licenses to the "Worker" machines. As such the following must be installed on the Main instance after launching it:

  • SQL must be installed.
  • Grooper must be installed.
  • The Grooper Licensing service must be installed (and running) from Grooper Config.

Getting Started


To launch a new EC2 instance, log into the AWS Management Console at console.aws.amazon.com

  1. In the search bar, search for "EC2".
  2. Under Services, select EC2.
    • This will take you to the EC2 Dashboard.


  1. In the EC2 Dashboard, select Launch Instance.
  2. Then, select Launch Instance.
    • FYI: We will create the Main instance "from scratch". Launch Templates (the other option) allow users to save launch configurations. We will actually make a Launch Template later in order to set up AWS Auto Scaling.


  1. This will take you to the Launch an Instance configuration panel.
  2. Name your virtual machine.
    • We've simply named this machine "Main"
    • Use whatever naming convention works for your organization. Just be sure to make a distinction between this machine, which is the host server for the Grooper Repository and licensing, and the "Worker" machines we will create later, which will be our scalable machines used purely to process work in Grooper.

System Specs


Next, you will choose the virtual machines system specifications. There is some flexibility in your choices. However, there are some requirements and best practice suggestions you'll need to keep in mind. You will configure the following:

  1. Application and OS Image
    • Windows Server 2012 or later or Windows 10 or later is required.
    • The machine will need to host the Grooper database as well. SQL Server 2012 or later must be installed (or accessible from a hosted server).
    • For the purposes of this tutorial, we selected Microsoft Windows Server 2019 with SQL Server 2012 Standard. This takes care of both these requirements.
    • For more information on instances and AMIs, visit Amazon's documentation here.
  2. Instance Type
    • These settings define the CPU and RAM for the virtual machine.
    • Server RAM should be 16GB or more.
    • The CPU should consist of 4 or more cores.
    • We selected the "m6i.xlarge" instance type, which meets these requirements. There are, however, other instance types that also meet these requirements. For example, the "t3.xlarge" has the same number of cores and RAM, but is cheaper and performs slower.
    • For more information on instance types, visit Amazon's documentation here.
  3. Storage
    • The storage will need to accommodate the Grooper database and file store.
    • AWS has a variety of storage options for you to choose from, including SSD and HDD options. There are also scalable storage options, allowing you to dynamically increase the instance's storage, as needed.
    • We selected 30 GiB of "gp2" memory because we don't need a large amount of storage for this demo.
    • For more information on storage options, visit Amazon's documentation here

Network Settings

Generally speaking, every organization will have their own network security requirements. Your IT department will need to configure the EC2 instance's Network Settings panel according to your needs.

  • For more information on networking, visit the Amazon documentation [here].
  • For more information on security, visit the Amazon documentation [here].

For the purposes of this demo, we will use the default Network Settings. However, for all deployments we will need to configure port access using a Security Group.

  1. To create a new Security Group, select the "Create security group" option.
  2. If you have an existing Security Group you can use, select the "Select existing security group" option and select the Security Group.

We will create a new Security Group in this demonstration.

Login Info

Amazon strongly recommends you log into EC2 instances using a key pair. If you plan on connecting to your virtual machines using RDP (which we will in this tutorial), you must specify a key pair.

  • For more information on key pairs, please visit the Amazon documentation here.
  1. You may specify an existing key pair using the dropdown menu.
  2. You may create a new key pair by following this link.

We have already generated a key pair and selected it.

=

Grooper Installation

Setup the Security Group

Launch the "Worker" EC2 Instance

Create an Amazon Machine Image (AMI) of the Worker Instance

Create a Launch Template

Configure the Auto Scaling Policies