Oct. 30, 2017
NOTE: This article will assume you are familiar with AWS and EC2. If not, check the AWS EC2 documentation before continuing.
At the end of this article, you will have an AWS EC2 instance started with TrackIt installed, and you will be able to monitor and optimize your cloud yourself.
TIP: You can use TrackIt without any installation by using our infrastructure. Check our website on https://trackit.io.
In this section you will set up and start an instance on AWS EC2. This instance will have the recommended requirement for TrackIt. I recommend you check the EC2 pricing on the AWS website before launching an instance.
First, you need to know which region is the best for you by comparing the pricing and the latency of each one.
Once you have chosen your designated region, let’s go on the EC2 console and let’s click on Launch Instance.
Once you click on Launch Instance, it will display a panel as below.
We recommend using Ubuntu 16.04 LTS, you can search for it in the AWS Marketplace (on the left side). Once you have found it, click on the Select button.
WARNING: A panel should open with the pricing per hour. We are going to use a t2.medium instance. Take note on the price that it will cost per month.
Select the instance type as above and click on Next.
It’s recommended to leave the default fields.
TIP: Select Protect against accidental termination if you want avoid an accidental complete remove of your instance and its data.
The SSD Storage is highly recommended. The size is fully proportional to your bills and your AWS consumption since TrackIt will download, process, and store your billing files.
Set the size to a minimum of 32GB. We calculated that an account spending $300,000 a month in AWS takes around 50GB more. If you want to be serene, set the size to 64GB as above.
As any AWS resource, you can add tags to your instance. You should use the tag functionality, however it’s not mandatory.
TIP: TrackIt actively uses the tag functionality to monitor the costs.
As shown in the picture, you have to open the SSH (22) and HTTP (80) protocol to use TrackIt.
1. Select Create a new security group
2. Change its name and its description
3. Click on Add Rule
4. Select HTTP in the type field
5. Click on Next
You should see a summary of all the settings applied before. Compare it to the picture above to make sure everything is correct.
If it is, click on Launch Instance.
If you aren’t familiar with the key pairs of AWS, follow exactly the instructions below.
1. Select Create a new key pair
2. Type a name, for example trackit-ec2-key-pair
3. Download it by clicking on Download Key Pair and save it somewhere safe
4. Click on Launch Instances
In this section you will install the requirements for TrackIt directly from the instance with SSH. Afterwards, you will be able to properly install TrackIt.
The key pairs you previously created are essential for this step. Indeed, we are going to connect to the EC2 instance. You have to get its Public DNS in the EC2 Console (see above).
$> ssh ubuntu@[public dns] -i [key pair]
Which gives you
$> ssh firstname.lastname@example.org -i ~/Downloads/trackit-ec2-key-pair.pem
TIP: The key pair must be with the 400 permission. To set it, just type
$> chmod 400 [key pair]
Docker is absolutely essential to make TrackIt work.
Follow the instructions to install Docker-CE (https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/) then Docker-Compose (https://docs.docker.com/compose/install/)
After this, run the command below to gain the permissions to use Docker.
$> sudo usermod -a -G docker ubuntu
First, clone the TrackIt repository by typing:
$> git clone https://github.com/trackit/trackit.git $> cd trackit
Since you are on a headless machine, you have to set the environment variable TRACKIT_HOST indicating what IP TrackIt should use to run.
$> export TRACKIT_HOST=[ip]
Which gives you:
$> export TRACKIT_HOST=126.96.36.199
IP is shown in the EC2 Console beside Public DNS.
To start TrackIt, just execute the run.sh script in the repository.
It will pull the images of TrackIt from Docker Hub to run it afterward.
If you go on http://[ip], for example http://188.8.131.52, it will display the login page. The default credentials are:
username: admin password admin
The login page will redirect you to the page where you will be able to add a new key to TrackIt.
Let’s fill the information as below.
And click on Submit. If you don’t know to what information corresponds to the fields, you should check here https://trackit.io/#/app/setupguide
Here we go! TrackIt is successfully installed in your EC2 instance! Once a key is added, it will be red during the time TrackIt loads it.
The key is loaded after a few seconds, you can use TrackIt!
TIP: I highly recommend you to check https://blog.trackit.io/how-to-leverage-trackit-to-get-better-understanding-of-your-cloud-deployment/, which allows you to get better understanding of TrackIt and your cloud!