Skip to main content

Posts

Showing posts from September, 2020

AWS EC2 AMI Back up Script

Goal: If you looking for an ready made working script to complete back your ec2 servers then these article is there to help you out with working shell script code. Steps: Install aws cli. (I am adding commands for Linux/macOS system, for other env please follow through link share in each steps) $ python -m pip install awscli Detailed steps for various env can be found here . To check version after installation run  $ aws --version Setup Credentials on your machine using below command and try to follow steps. $ aws configure More details can be found here .  Once Everything has been setup. you can copy code from below gist. It takes few input.  Elastic ip of server How long you want to keep your old ami Server name, that's nothing but what initial name you want to keep for your backup ami. Hope this article helped you, Lemme know if you find any difficulty using it will try to help it out ASAP.

Prometheus Installation

Goal : This blog will help you with prometheus installation. Installation Steps. Create user without a home directory. sudo useradd --no-create-home --shell /bin/false prometheus Create directories to copy prometheus config and library files and give permission to user that you crated. sudo mkdir /etc/prometheus sudo mkdir /var/lib/prometheus sudo chown prometheus:prometheus /etc/prometheus sudo chown prometheus:prometheus /var/lib/prometheus Download and unzip prometheus from github. curl -LO https://github.com/prometheus/prometheus/releases/download/v2.3.2/prometheus-2.3.2.linux-amd64.tar.gz   tar -xvf prometheus-2.3.2.linux-amd64.tar.gz mv prometheus-2.3.2.linux-amd64 prometheus-files Copy prometheus binary files to bin directory and give permission. sudo cp prometheus-files/prometheus /usr/local/bin/ sudo cp prometheus-files/promtool /usr/local/bin/ sudo chown prometheus:prometheus /usr/l