Tuesday, October 8, 2024

Prometheus Introduction

October 08, 2024 0

 



Prometheus:

Prometheus is an open-source toolkit written in Go that is designed to be a fully featured solution for monitoring and alerting.

Prometheus is responsible for collecting metrics data and storing it in an efficient time series database, while user is able to query that time-series data and configure alerting for real-time updates.

It actually will use the built-in database within it. We can transfer the data into external storage or keep within it.

It uses a multidimensional data model that accommodates time-series data. This data is associated with the timestamp and options key-value pairs.

Prometheus uses a HTTP pull model to retrieve stored time-series data.

Prometheus Components:

Prometheus server is a responsible for collecting a data from exporter or scraping a data from targeting machines and storing this data into time-series database.

Various client libraries are supported for programming languages including Rust, Python, Java, Ruby and Go. These libraries aid in instrumenting application mode.  Special exporters are also supported for exposing metrics from systems that cannot directly use Prometheus metrics such as Graphite, StatsD and other third parity software.

Alertmanager is used to handling alert within Prometheus.

Service discovery mechanisms such as Kubernetes native service discovery, DNS and file_sd are supported and discover  and begin monitoring new targets automatically.

The Push gateway is a separate component which used to collect metrics from short live which cannot be capurate by usual monitoring methods.

PromQL is an addition component used to provide a built-in expressive query language for querying and aggregating time-series data within Prometheus.

Prometheus pull a data from specfic targets through collecting metrics from http end points.  The main configuration file is prometheus.yml.  We can setup Prometheus to collect metrics on itself or pull a data and monitor own health.

PromQL expression are entered in the promethus expression browser [http://localhost:9090/graph]. We can enter any expression in order to render the result in a table or graph the result over time.

Exports are tools that help export metrics from third-parity system into Prometheus for consumption and aggregation.

Alert manager is efficient tool for collecting a alerts and manage it. It can able to redirect the notification to slack, PagerDuty, OpsGenie, Telegram, Microsoft Teams, WebEx, Discord and other receivers.






Thursday, September 26, 2024

AWS - Auto Scaling

September 26, 2024 0

 


We can scale up or scale down the resources through Auto scaling in AWS.

Auto scaling is classified as 3 parts:

* Auto Scaling group
* Launch Configuration/Template
* Scaling Policies 

Auto Scaling group : We can define a minimum and maximum require resources through Auto scaling group.

Launch Configuration/Template - Defined a AMI and other require resource parameter for the EC2 instance.

Scaling Polices: It is classified as 3 types:

* Manual - We can update the minimum and maximum resource requirement by manually or through CLI,
* Scheduling : We an schedule the desire resource requirement through crontab.
* Dynamic - It will increase the resource based on metrics.




Wednesday, September 25, 2024

AWS - Load Balancer

September 25, 2024 0

 


Load balance is a method of distributing the network traffic equally across the connection/network pool that support an application.

AWS is provided a load balancing called ELB [Elastic Load balancer]

ELB is classified as below:

* Network Load balancer
* Application Load balancer
* Classic Load balancer 
* Gateway Load balancer

Network Load balancer is routing the traffic through TCP/IP [Layer 4] & Application Load balancer is routing the traffic through https/http [Layer 7]

* ELB should have a minimum 1 listener is in active state, so that it will listen the traffic and routing into target group.


Tuesday, September 24, 2024

AWS - VPC

September 24, 2024 0

 


Basic Networks:

IPv4 is connectless protocol that use multi packet routing to break data into smaller blocks to send across the internet.  IPv4 is a series of of four eight-bit-binary numbers separated by a decimal point. 

IPv4 has a different type of classes:

Class A - Address range [1 to 126] - Subnetmasking [255.0.0.0] - Used for large number of hosts
Class B - Address range [128 to 191] - Subnetmasking [255.255.0.0] - Used for medium size network
Class C - Address range [192 to 223] - Subnetmasking [255.255.255.0] - Used for local area network
Class D - Address range [224 to 239] - NA - Reserve for multi tasking
Class E - Address range [240 to 254] - NA - This is class is reserved for research and development purpose. 

The RFC1918 address is an IP address that is assigned by an enterprise organization to an Internal host, these IP address are used in private networks which is not available or reachable from internet.

10.0.0.0 - 10.255.255.255 [10/8 prefix]
172.16.0.0 - 172.31.255.255 [172.16/12 prefix]
192.168.0.0 - 192.168.255.255 [192.168/16 prefix]

We cannot use of first four ip address and last IP address in the network segments. It will be reserve to use for it.

Example:

Network segment of 172.31.0.0

172.31.0.1 - Reserved by AWS for the VPC router.
172.31.0.2 - Reserved by AWS for DNS server
172.31.0.3 - Reserved for the future use.
172.31.0.255 - Network broadcast address. We don't support the broadcast in a VPC, therefore we reserve this address.

Creating the VPC network:

Login into AWS console and navigate into VPC.

1)      Select the VPC only option.



We will get a more network option while selecting the VPC and more option. It will display the availability zone along with network CIDR.

2)      Select the IPv4 CIDR manual input in the IPv4 CIDR block section.



If there is an Amazon VPC IP address Manager (IPAM) address pool available in this region, you can get a CIDR from an IPAM pool. If you select an IPAM pool, the size of CIDR is limited by the allocation rules on the IPAM pool. The same will be applicable for IPv6 as well.

3)      Select a default zone, we can specific a different Tenant as well.



4)      Create a tag for grouping purpose and click on create VPC button.



We need to create a sub netmask according your requirement and mapped into VPC.

Click on subnet from the VPC dashboard.


Click on create subnet button and select the VPC which you want to create a sub netmask.



Define a subnet name and availability zone as per your requirement.



I can able to get 11 number of IP address as per my sub netmask and 5 IP address goes for reservation.


We need to create a internet gateway incase of access this machine from your system or outside world.

Creating an Internet Gateway:

Navigate into Internet gateway from left hand side of the VPC dashboard and clicked create Internet gateway button.





Sunday, September 8, 2024

AWS - Introduction

September 08, 2024 0

 


Amazon Web Services is a subsidiary of Amazon that provides on-demand cloud computing platform and API's to Individuals, Companies and Governments on a metered Pay-as-You-go basis.

AWS Global Infrastructure as of 2024:

The AWS Cloud has 108 Availability Zones and 34 launched Regions across the world.  They will plan to extend another 18 more Availability Zones and Six more Regions in Mexico, New Zealand,  the kingdom of Saudi Arabia, Thailand, Taiwan and the AWS European Sovereign Cloud.



Amazon cloud computing resources are hosted in multiple location across world wide.  These location are composed of AWS Regions, Availability Zones and local Zones.  

AWS Regions: Region is a logical name which represent some of the Geographic location.  Each AWS Region has multiple, isolated location knows as Availability Zones.

Local Zones: We can place resources such as compute & storage in multiple locations closer to end user. Local zones are designed to bring core services closer  to end users.

AWS has a multiple resource components for various purpose, we will walk through one by one now.

EC2 - Elastic compute cloud

EC2 provides scalable compute capacity in the AWS cloud. We can create a multiple virtual machines through EC2.  We can scale up or down the resources easily through EC2.

EC2 Instance Purchasing Options:

On-Demand:

* It is very expensive and very flexible purchase options

* We are charged only when instance is running (billed by hour)

* We can terminate or provision at any time.

Reserved:

* Allows us to purchase an instance for a specific time period.

* We can get a special discounts while purchasing it.

Spot:

* Amazon will sell the unused resources with lower price.  

* We can bid on an instances type and get those instance if bid match with our price or go below to our bid price.

* Spot price will be fluctuate based on supply and demand in the market.

The price of EC2 instance will vary based on Instance type, Region, EBS and storage resources.

Amazon Machine Image:

* A preconfigured a package image (ex. ISO) along with necessary software's which require to launch an EC2 instance.

AMI comes with 3 categories as below:

1) Community AMI
2) AWS Market place AMI
3) My AMI [User created image]

EC2 instance Family:

General purpose: It is combination of CPU and memory with common purpose depends upon the request[family type is t2, m4, m3]. Example of common websites, web application, micro service and code repos.

Compute Optimized: It will provide more compute power to host. It will require for high end customers [family type is c3, c4, cc2]. For example of web servers, batch processing and analytics.

Storage Optimized: It will provide a more IOPS while access the data from the storage[family type is d2, i2 and i3]. For example data warehousing and NoSQL

Memory Optimized: It will give a more random memory while access the application [family type is r3 and r4]. It is mainly used for Hadoop and SAP Hanna application.

Allocation the IP address to EC2 Instance:

Private IP : By default every EC2 instance will be provided with a private IP address.
Public IP: EC2 instance can be launched with or without public IP address.  It will allow the instance to communicate from Network.
Elastic IP: Static public IP address for the instance. It is chargeable.

Storage service:

EBS - Elastic block store - The data will access in block level. we can able to read or write concurrently.
EFS - Elastic File store - The data will access a serial level.
S3  - Simple storage service - The data will save as object. We can get a unique ID and endpoint after uploaded the data.

EC2 and EBS should be in same availability zone.

 

Saturday, September 7, 2024

Cloud - Introduction

September 07, 2024 0

 


Cloud Service : Any infrastructure service which is make available for user based request via internet.

Cloud Computing: Cloud computing is the delivery of computing services such Server, Storage, Databases, Networking and Software/Analytics over the internet hosted at a remote data center managed by a cloud service provider. 

Instead of buying, owning and maintaining physical data centers and servers, you can access technology services such as computing power, storage and database on an as-need basis from a cloud provider with pay-as-you-go model.

Cloud Service Provider: The company who is providing the cloud computing services to the end  users such as AWS, Azure, GCP, Oracle cloud, Rackspace, DigitalOcean, Saleforce cloud and Alibaba cloud.

Benefits of Cloud:

  • Cost
  • scalability & Elasticity - We can provision a require amount resources through cloud. We can increase the resources depends requirement basis without downtime via scale out and scale in.
  • High Availability & Reliability
  • Speed
  • Deploy across the global
Type of cloud Computing:
  • Public cloud, Private cloud, Hybrid cloud and Multicloud




Different types of AI models

September 07, 2024 0


AI - System or machines that mimic human intelligence to perform tasks and can iteratively improve themselves based on the information they collect.  Artificial Intelligence capable of generating text, images, videos or other data using generative models often in response to prompts.   Generative AI models learn the patterns and structure of their input training data and then generate new data that has similar characteristics.

AGI - Artificial General Intelligence is a type of AI that can understand, learn and apply knowledge across broad range of tasks similar to human cognitive abilities.   

Example of Cloud Machine Learning:



Different AI Types:

Machine Learning:

Simple Input -> Simple output -> Single topic

Deep Learning:

Complex input -> Simple output -> Single topic

Foundation Model:

Complex inputs -> Complex ouputs -> multiple topics

Foundation Model:

A foundation model is a type of large scale artificial intelligence model that is trained on a broad range of data at massive scale, allowing to develop a wide understanding of many topics and tasks.  These models can be adapted or fine-tuned for various specific applications, demonstrating flexibility and efficiency across different domains. 

 Parameters of foundation models:

  • Embedding Vectors : The foundation model dealing with categorical variable (like words or user ID in recommendation systems), embedding vectors are a form of parameter represent a categories in a continuous vector space and capturing semantic similarities among categories. 
  • Weights:  This is a numerous parameters in neural network.  Weights are used in various layers of a neural network to scale the input data in a meaningful ways.  For example in a convolutional layer commonly used in image processing, weights determine the importance of neighboring pixel values for feature detection. 
  • Biases: Bias parameters are added to the output of weighted inputs to shift the activation function curve up or down.  This is crucial for models to accurately represent patterns in data that do not pass through the origin of the coordinate system. 
  • Attention Scores: Attention mechanisms use parameters to weigh the significance of different parts of the input data differently.  For instance, in language models attention scores determine how much emphasis the model places on different words when generating a response or translating text.
LLM [Large Language Module]

LLM - It is highly specialized for tasks involving human language.  They are optimized for understanding and generating text which makes them more efficient for language specific tasks like conversation, translation or content generation.