Whether you’re in development or testing, you’re deploying a production instance, or you need an instance to work with for development, you’ll want to deploy the New Relic infrastructure monitoring agent.
The great news is that deploying the New Relic infrastructure agent on an Amazon EC2 Amazon Linux instance is a quick. How quick? That depends on how fast you click. (Watch the video in the next section to see me deploy 9 instances in 23 seconds.)
Amazon Linux, provided by Amazon Web Services (AWS), is an environment for applications running on Amazon EC2.
To jump in and try out installing the New Relic infrastructure agent on just one instance, you can follow this quickstart:
But the best news is that once you’ve launched your instances, you’ll start seeing data in New Relic within just 60 seconds.
3 … 2 … 1 … launch!
There are several ways to deploy the New Relic infrastructure agent. One is to launch an Amazon EC2 instance, SSH into it, and manually deploy the agent. Or you can use AWS CloudFormation to take care of everything. Or, you can even use automation tools.
Regardless of your path, nothing beats the sheer speed of kicking off EC2 instances yourself and deploying the latest version of the New Relic infrastructure agent simultaneously. Here’s how to do it.
First, some ground rules
- If you don’t already have one, you’ll need a New Relic account.
- Get your New Relic ingest-license key from API keys. Find your API keys by clicking your account name (in the lower left). Use the three dots on the right side to copy your key.
- You’ll also need an AWS account. If you don’t have one, get one at aws.amazon.com.
- For this demo, I’ll be using Amazon Linux 2. You’ll need to substitute the proper code if you are using other versions of Linux.
There are 5 basic steps to installing the infrastructure agent on AWS:
1. Launch an instance from the AWS Amazon EC2 console and give it a name.
2. Select Amazon Linux 2 AMI.
3. Select your options for:
- key pair
- network (Select a security group that allows HTTP traffic.)
4. Open Advanced details. (This is where the magic happens.)
5. Select Launch instance to complete the process.
The magic in step 4
In step 4, where you configure the advanced details, look for a section at the bottom labeled User data. Copy and paste this short script in the User data field (don’t select base64). Then replace [YOUR_KEY] with your license key.
Syntax counts! Copy/paste may modify the quote marks or dashes. If you are experiencing issues with your copy/paste, double-check your single and double quotation marks and double-dashes.
Here’s an example with a license key of 12345:
Feel free to share this with anyone who needs to know how fast and easy it is to deploy the New Relic infrastructure monitoring agent to an Amazon EC2 instance.
If you’re not already using New Relic, get started with New Relic today.