
This tutorial will walk through how to install Gremlin on Amazon Linux and perform a Chaos Engineering experiment using a Gremlin CPU attack.
Before you begin this tutorial, you'll need the following:
First open AWS console, click to launch an instance and select Amazon Linux 2 as your AMI. When your instance starts click on “Connect” to identify how to connect via SSH to your new instance.
Your connection string will look similar to the following, paste this string into terminal and connect to your instance:
1ssh -i "chaoseu.pem" ec2-user@ec2-34-240-182-168.eu-west-1.compute.amazonaws.com
When using Amazon Linux 2 you will first need to install iproute-tc, Amazon Linux 1 comes pre-installed with iproute-tc:
1sudo yum install -y iproute-tc
Next, add the Gremlin repository:
1sudo curl https://rpm.gremlin.com/gremlin.repo -o /etc/yum.repos.d/gremlin.repo
Then install the Gremlin daemon and CLI:
1sudo yum install -y gremlin gremlind
After you have created your Gremlin account you will need to find your Gremlin Daemon credentials. Login to the Gremlin App using your Company name and sign-on credentials. These were emailed to you when you signed up to start using Gremlin.
Navigate to Team Settings and click on your Team. Make a note of your Gremlin Secret and Gremlin Team ID.
Then initialize Gremlin and follow the prompts:
1sudo gremlin init
You are now ready to create attacks using the Gremlin App.
You can use the Gremlin App, Gremlin CLI or the Gremlin API to trigger Gremlin attacks.
Using your Gremlin login credentials (which were emailed to you when you created your account), log in to the Gremlin App. Then click Create Attack.
First, choose your target by selecting the host you registered with Gremlin. Next, we will use the Gremlin App to create a CPU Attack. Choose the Resource Category and Select the CPU Attack. Click Unleash Gremlin and the Gremlin CPU Attack will consume CPU resources on your host.
You can now view the Gremlin CPU Attack in Datadog:
Your attack will begin to run, you will be able to view its progress via Gremlin Attacks in the Gremlin App.
On your server, run top to check the impact of the Gremlin Attack. When your attack is complete it will move to Completed Attacks.
You can stop a Gremlin Attack at anytime using the Gremlin App. Simply click on the halt button for a specific attack or click Halt All Attacks.
You've installed Gremlin on an instance running Amazon Linux 2 and validated that Gremlin works by running the Hello World of Chaos Engineering, the CPU Resource attack. Next, we recommend running different types of Gremlin Attacks, including attacks that impact State and Network.
Share your results and swap best practices with 5,000+ engineers practicing Chaos Engineering in the Chaos Engineering Slack.
Gremlin empowers you to proactively root out failure before it causes downtime. See how you can harness chaos to build resilient systems by requesting a demo of Gremlin.
Get started