- 2 Minutes to read
- Print
- DarkLight
- PDF
Windows AWS EC2Config Service
- 2 Minutes to read
- Print
- DarkLight
- PDF
If you are installing Retrace in AWS on EC2 Windows instances that are dynamic, it's easy to leverage the silent installation method of adding Stackify to ensure that your new EC2 instances always have the latest and greatest Retrace agent. Just follow the steps below to get started.
Launch an Instance
In the most common example, you will want to prep a new instance to serve as a baseline for future instances. First, launch a new instance to use as your baseline.
Choose Windows AMI
You will need to start out with a Windows AMI - you can choose any, but for this example we will choose the Windows Server 2012 R2 Base AMI that's available at the time of this writing from the quick start list.
Choose Instance Type and Configure Instance Details
Choose whatever the appropriate instance type is for your purposes, but be sure to click "Next: Configure Instance Details".
Configure Instance Details With Stackify Installation Script
Drop the following script into the 'User data' section under 'Advanced Details' so that EC2Config can download the latest agent and execute the installation command in an unattended (silent) mode.
<powershell>
$webclient = New-Object System.Net.WebClient
$url = "http://s1.stackify.com/Account/AgentDownload"
$file = "C:\\StackifyInstall.exe"
$webclient.DownloadFile($url,$file)
& $file /s /v"ACTIVATIONKEY=YOUR_KEY ENVIRONMENT=\`"YOUR_ENVIRONMENT\`" ENABLEPROFILER=1 RESTARTIIS=1 ATTACHALL=0 /qn /l*v C:\StackifyInstallLog.txt"
</powershell>
Just replace YOUR_KEY with your activation key, and YOUR_ENVIRONMENT with the appropriate environment name for the server you are deploying. If you don't want to enable the APM+ profiler, you can change ENABLEPROFILER=1 to ENABLEPROFILER=0 instead.
Validate the New Server Shows Up
After the EC2 instance is done starting, within a few minutes you should see it listed within Retrace in the Server list. Here you can see a couple of EC2 instances that have appeared after startup using the automated installation approach.
Next Steps
Once you have a base image that you know installs Retrace successfully, you can then create your own AMI from it and use it for subsequent EC2 instance launches. Done correctly, each new EC2 instance that is created from the base AMI with the Retrace installation script will install a new Retrace monitoring agent and start reporting data with no additional effort on your part.
Note: It's important to note that you will need to ensure that you follow Amazon's guidance on how to ensure that subsequent launches will execute the user script you have saved. You can find more about EC2Config here.