Uptime monitoring using Elastic Heartbeat

blog-image
June 25, 2021

Please request your license key here and proceed with the steps below once you have the key.

Follow the steps mentioned below for one-click provisioning of an EC2 instance running heartbeat

Click on this link below and follow the steps below

Three fields for your VPC, license-key and ssh key-pair are to be filled by the user

The EC2 instance with the heartbeat will be up and running in 5 mins

A t2.micro (1 GB RAM) server is created with 20 GB storage

Monthly bill of 10$ is expected if the server is stood up in ap-south-1(mumbai)

The following ports are open by default (22). It is advised to restrict them to your static IPs and close these ports as soon as the stack is provisioned

Assign an elastic IP to the EC2 instance

ssh to the newly created EC2 instance using your ssh key and append the following three lines to /etc/environment file (replace 1.1.1.1 with IP of your elastic instance and replace yourpassword with your elastic password)

ELASTICSEARCH_HOSTS=1.1.1.1
ELASTICSEARCH_USERNAME=elastic
ELASTICSEARCH_PASSWORD="yourpassword"

Note : Make sure elastic server has traffic open on port 9200,80,443 from this newly created server

exit from the server and ssh again for variables to take effect (this step is to be improved)

change the URLs that you want to monitor in ~/monitoring-and-analytics-one-click/heartbeat/heartbeat.yml

Note : Make sure the URLs that you listed in previous step are accessible from this newly created EC2 instance

start the docker container using commands below

cd ~/monitoring-and-analytics-one-click/heartbeat

docker-compose up -d

If you don't have an ELK stack running, follow this article to stand it up in one click

Back to all posts