Friday, December 11, 2020

Prometheus Installation in RHEL 8 - Mithun Technologies - 9980923226

Mithun Technologies            +91-9980923226              devopstrainingblr@gmail.com

                                                       http://mithuntechnologies.com/
                                                       http://mithuntechnologies.co.in/ 
Prometheus  Installation

#Login as a root user
sudo su -
yum install wget -y

Create a new User called prometheus.

useradd -m -s /bin/bash prometheus

Switch to the prometheus user and download the Prometheus software.

su - prometheus
wget https://github.com/prometheus/prometheus/releases/download/v2.19.2/prometheus-2.19.2.linux-amd64.tar.gz

Extract the prometheus-2.19.2.linux-amd64.tar.gz file and rename the directory to 'prometheus'.

tar -xvf prometheus-2.19.2.linux-amd64.tar.gz
mv prometheus-2.19.2.linux-amd64/ prometheus/

Create a new 'data' directory that will be used as a 'tsdb' storage.

mkdir -p ~/prometheus/data

Configure Prometheus As a Systemd Service

Create new service file 'prometheus.service' using vi editor in 
'/etc/systemd/system/' directory

vi /etc/systemd/system/prometheus.service

Paste the prometheus service configuration below.

[Unit]
Description=Prometheus Server
Documentation=https://prometheus.io/docs/introduction/overview/
After=network-online.target

[Service]
User=prometheus
Restart=on-failure

#Change this line if you download the
#Prometheus on different path user
ExecStart=/home/prometheus/prometheus/prometheus \
  --config.file=/home/prometheus/prometheus/prometheus.yml \
  --storage.tsdb.path=/home/prometheus/prometheus/data

[Install]
WantedBy=multi-user.target


Now reload the systemd system using the systemctl command below.

 systemctl daemon-reload

Start the prometheus service and enable it to launch everytime at system startup.

systemctl enable prometheus
sudo systemctl start prometheus


systemctl status prometheus

systemctl status prometheus

http://10.5.5.15:9090/graph

ELK Stack Installation - Mithun Technologies - 9980923226

Mithun Technologies            +91-9980923226              devopstrainingblr@gmail.com

                                                       http://mithuntechnologies.com/
                                                       http://mithuntechnologies.co.in/ 
ELK  Stack Installation

#Login as a root user
sudo su -

Install Elastic Search
---------------------------


#rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch

Create a file called elasticsearch.repo in the /etc/yum.repos.d/ directory for RedHat based distributions and Added below lines

#vi /etc/yum.repos.d/elasticsearch.repo

[elasticsearch]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=0
autorefresh=1
type=rpm-md

Install the Elasticsearch package

#yum install --enablerepo=elasticsearch elasticsearch -y

To configure Elasticsearch to start automatically when the system boots up, run the following commands:

#/bin/systemctl daemon-reload

#/bin/systemctl enable elasticsearch.service

Start the Elasticsearch service as follows.

#systemctl start elasticsearch.service


Directory Structure for Elastic Search

https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html


Kibana
-----

rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch

vi /etc/yum.repos.d/kibana.repo


[kibana-7.x]
name=Kibana repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md



yum install kibana -y


systemctl enable kibana.service

https://www.elastic.co/guide/en/kibana/7.8/rpm.html#rpm-repo


Logstash
---------
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch

vi /etc/yum.repos.d/logstash.repo

[logstash-7.x]
name=Elastic repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md


 yum install logstash -y


systemctl enable logstash.service

systemctl start logstash.service



AWS CLI Commands - Mithun Technologies - 99809 23226

 

Mithun Technologies            +91-9980923226              devopstrainingblr@gmail.com


                                                       http://mithuntechnologies.com/
                                                       http://mithuntechnologies.co.in/ 

                                                      AWS CLI Commands

The AWS CLI is an open-source  tool which we can use to connect to AWS account , manage your AWS resources and services from command line interface.

 

Using AWS CLI we can automate manual AWS tasks through pragmatically.

 

Note: Installing AWS CLI we need to install Python (Python 2 version 2.6.5+ or Python 3 version 3.3+) first.

 

#aws -version: It will display the AWS CLI version which you have installed.

 

#aws configure: Using this command we can configure AWS Access Key ID, AWS Secret Access Key, region and output format.
 

An AWS CLI command has the following structure:

 

#aws <command> <subcommand> [options and parameters]

---------------------------------------------------------------------------------------------------------------------

Elastic Cloud Compute (EC2)

 

#aws ec2 describe-instances: It will display all the ec2 instances.

 


 

#aws ec2 describe-instances --filters "Name=instance-type, Values=t2.micro”: It will display all the ec2 instances which are having the instance type is t2.micro.

 

# aws ec2 describe-instances --filters "Name=tag:Name, Values=RedHat Server": It will display all the ec2 instances which are having the Tag name is "RedHat Server".

 

#aws ec2 terminate-instances --instance-ids i-0cf83a9889a47e9e8: It will delete the instance ids which you specified.

 

See Below output after running above command.

 

i-0cf83a9889a47e9e8 à ec2 instance id.

 


 

Below screenshot from AWS admin console.

 


 

 

#aws ec2 describe-instances --filters Name=instance-state-name,Values=stopped --region ap-south-1 --output table : It will display all instances that are currently stopped.

#aws ec2 describe-instances --filters Name=instance-state-name,Values=stopped --region ap-south-1 --output table : It will display all instances that are currently stopped.

------------------------------------------------------------------------------------------------------

Identity and access management (IAM)

 

#aws iam list-users --output table: It will display users in a table format.


 Here

  • ARN: It is the Amazon resource name to identify the user
  • Create Date: It is the user creation date in ISO 8601 date-time format
  • User ID: It is a unique id of each IAM user
  • User Name: It is a friendly user name that we specify while creating the IAM user.

#aws iam create-user --user-name ruthvik: It will create an IAM user.

 


 

---------------------------------------------------------------------------------------------------------------------

Simple Storage Service (S3)

 

 

#aws s3 ls: It will display all the S3 buckets.

 

---------------------------------------------------------------------------------------------------------------------

Virtual Private Cloud (VPC)

 

 

---------------------------------------------------------------------------------------------------------------------

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

References

https://docs.aws.amazon.com/cli/latest/index.html

 

 


 


Ansible Installation in Amazon Linux - Mithun Technologies - 9980923226

  Mithun Technologies            +91-9980923226              devopstrainingblr@gmail.com                                                 ...