AWS Autoscaling and Amazon Auto Scaling Group

AWS auto Scaling Group

Most of the company is migrating to the cloud because of Scalability, Fault Tolerance, High Availability of resource. AWS Auto scaling Group is one of the most important feature of AWS cloud. 

Scalability or Autoscaling have the same mean. In terms of Cloud Scalability or AWS Autoscaling means based on the requirement scaling the server resource up and down to meet the users request requirement without fault Tolerance and with high availability of resource .

  • AWS Autoscaling is region Specific Amazon services.
  • Auto scaling is a process of scaling (Scale Out[Increase] or Scale In[Decrease]) your EC2 Instance up or down based on the set of condition. 
  • Amazon Autoscaling is Horizontal Scaling of EC2 Resource. This Horizontal scaling ensure that you must have the right number of server to handle the Request.
  • Auto Scaling help in the cost Management. In cost management Auto scaling don't have extra charge for creating instance in AWS ASG.
  • Instance Running only you can include in Autoscaling Group. Terminated or Stopped Instance can't be included in ASG Group. 
  • EC2 instance can be the part of only one Auto scaling Group. It can't be the part of Multiple auto scaling Group. You can have multiple AWS ASG but we can't attach single EC2 Instance in multiple ASG.
  • When you want to delete the AWS Auto scaling group first you have to detach the Existing EC2 of that particular ASG and then you can delete it.  If you delete the ASG without detaching the EC2 instance then it will delete the EC2 Instance also.
  • We can attache multiple Elastic Load balancer with auto scaling group. 
  • Whenever you apply Scale-Out Policy you must apply Scale-in Policy also. Other wise your cost will come high.
  • If you are creating AWS ASG using CLI then the basic monitoring will be 60 second. But if you are using console then the basic monitoring time will be 300 second (5 min). Through CLI by default it will be detailed monitoring will be created which is chargeable. Basic Monitoring is free of cost.
  • Merging of AWS ASG is possible only through CLI(Command Line Interface).

Component of AWS Autoscaling


Launch Configuration : In launch Configuration we define the type of instance, Key pair, AMI, Security Group. Once the Launch configuration is created after that you can't edit it. You can only delete it or Copy it.

Auto Scaling Group : Here we define the AWS ASG name, group Size, Group Subnet , vpc etc.

Scaling Policy : Metric Type, Target Value

Autoscaling Group always try to balance the EC2 Instance distribution across Region AZ's. Because if it is not balanced then in case of any failure of AZ's the load will come to the other AZ's for short time. To avoid that AWS Autoscaling Group distribute instance equally in multiple AZ's in that region itself (Autoscaling is Region Specific.). Below is the image as a example.


SNS (Simple Notification Services) in Auto Scaling Group sends email in four condition  which is below for your reference. SNS is chargeable services.

  • An Instance Is Launched
  • An Instance is terminated
  • An Instance is fail to launch
  • An Instance is fail to terminate 

Amazon Auto Scaling Policy

  • Manual AWS Auto Scaling Policy ( In this scaling Policy the Min and Max Number of server will be same in all the condition.)
  • Dynamic AWS Auto Scaling policy ( In this scaling Policy the Min and Max Number of server will not be same and based on the condition it increase within the min and max range)
    • Target Tracking Policy : In this policy we define the target. To maintain that target AWS ASG will increase or decrease the EC2 Instance. Like we are setting the target that one EC2 instance can have 70% of traffic. If that traffic will cross 70% automatically new EC2 instance will be launched. Target Tracking Policy always maintain the level of 70%. If it traffic decreases across all the Instance then it will terminate the EC2 instance and bring down the instance. In this we define or set the CPU Utilization. Below is the Image where target Tracking Policy we set.
      AWS ASG Target Tracking Policy
       
    • Simple Scaling Policy :
    • Step Scaling Policy :  We have to set Increase and decrease group Size as well as we have to the alarm before applying this scaling policy.
    • Predictive Scaling / Schedule Scaling / Cyclic Scaling : Predictive scaling will check the traffic history and based on the history it will scale up and down. Or we can decide like Scale Out on Saturday and Sunday. It uses machine learning Help and help in Scaling Out and In

AWS Route 53 DNS and Amazon Route53 Hosted zone

AWS Route 53 and DNS Management

AWS Route 53 is mainly for 

A) DNS Management
B) Traffic Management
C) Availability Management (Server Health Check)
D) Domain Registration

DNS (Domain Name Server) it's like a phone-book. It actually translate the Domain name in to IP address. Whatever the Device is connected with the internet have the Unique IP which we cant remember easily. So that's why Name came in picture. DNS will translate that name to IP Address.

For Example :

website: www.example.com have the Unique IP 111.111.1.11. Whenever any request comes using the www.example.com DNS will translate it into the respective IP.

Port Number is used to identify the specific process or request comes via internet or network and it forward to the server for further processing. Port 53 sets a communications protocol for the Internet network layer, transport layer, and session layer. Name server basically route the traffic to the server.

Route 53 name server function


Why Named Amazon Route53?


Route53 which manages our DNS runs on port number 53. Any request comes to Route 53 it will translate the Web address to specific IP address for further communication with the server. 

We can perform all sort of task using Route53 Hosted Zone such as DNS Management, Domain name Registration, Domain transfer, Server health check and traffic management etc.

Points to Remember about Amazon Route53:

  • Route53 is Global Services like IAM.
  • Route 53 supports IPV6 also. AWS Provide two type of domain one is Generic Top level domain(.com, .net, .org etc) and second one is Geographic Top level domain(.in, .uk, .us etc)
  • Multiple Hosted zones can be created with the same name but the name server inside the hosted zone will be different. 
  • Route 53 assign four name server to hosted zone which will be different and unique.
  • SOA (Start of Authority) will contain the information about the hosted zone what you create.
  • Transfer of Domain is possible between two AWS account for that you must contact The AWS Support.
  • When you migrate domain name from one AWS Account to other AWS Account in that case only domain get transferred not Route53 hosted zone.

AWS Route53 Function request handling  


AWS Route 53 dns resolver


There is two type of hosted Zone, Public and Private Hosted Zone. Whenever we create or register a  domain using Route 53 at that time Four  name server and one SOA(Start of Authority) is created automatically.

Supported Route 53 DNS Record Type


A Record(IPV4): It map the Domain name to IP Address (IPV4 which is 32 bit).

AAAA Record(IPV6):  It map the Domain name to IPV6 Address (IPV6 Which is 128 bit)

CNAME Record (Canonical Name Record) : It  will point the different URL format to the registered URL.You cant create the CNAME for the top domain (Main Domain).

Example:  example.com, www.example.com, http://example.com all are same this all canonical name must point to single domain what you wish among the list. 

amazon route53 hosted zone









NS Record :  Which point to your server or name server or Domain name server is same.

SOA (Start of Authority) : SOA contain all the information about the Domain owner, changes made in the hosted zone. It contain the authoritative server detail.

MX Record: MX Record maintain the record of mail created using the mail. example info@example.com

Route 53 Hosted Zone Policy

  • Simple Routing(By Default) : Simple Routing is very simple routing policy. At the time of creating record set if we don't select routing policy by default it will be assigned.  
  • Failover Routing : In this Failover Routing Policy we create two server one as a primary server and second as a standby server. Initially all the request will be sent to the primary server in case of primary server failure the standby server will be activated and the request will be serve by standby server.  
  • Geolocation Routing : This Routing we apply when we have server in various location. Like if we have server in India and HTTP requests are coming from the India. In that case the traffic will be redirected to that particular geo location Instead of redirecting the traffic to other location. This routing policy will work if we have server in multiple location and you want to serve the local content.  
  • Multivalue Answer Routing: Multiple IP will be assigned to handle the request.
  • Latency Based Routing : Latency based routing will serve the request wherever it can get the faster response. Again it is similar to Geolocation routing but latency based routing is not location specific. if your request is getting response faster from USA then routing will serve your request from there. 
  • Weighted Routing : Here we defined the traffic weight-age. Means you will decide that how much % traffic will go to which server. 
  • Geo Proximity:

The average of 11 numbers is 30. If the average of first six

  1. The average of 11 numbers is 30. If the average of first six


  2. The average of 11 numbers is 30. If the | Solutions


  3. The average of 11 numbers is 30. If the average of first six numbers is 17.5 and that of last six is 42.5, then what is the sixth number?
  1. A. 30           ðŸ‘ˆCorrect Answer
  2. B. 36
  3. C. 45
  4. D. 50
  1. Answer & Explanation:
    Sum of 11 Number is 11 x 30 = 330

    Given : 

     [ Avg of first 6 numbers is 17.5, so Sum of first Six Number is 6 x 17.5 ]

     [ Avg of Last 6 numbers is 42.5, so Sum of last Six Number is 6 x 42.5 ]

    6th Number :  ( Sum of first Six Number + Sum of last Six Number ) - 330

    Hence the 6th Number is 30

  1. Related Question on The Average of:

  1. The average marks scored by Ganesh in English, Science, Mathematics and History is less than 15 from that scored by him in English, History, Geography and Mathematics. What is the difference of marks in Science and Geography secured by him?
  1. A. 40
  2. B. 50
  3. C. 60
  4. D. Data inadequate
  1. Answer : C ( 60 )

  1. The average weight of three men A, B and C is 84 kg. D joins them and the average weight of the four becomes 80 kg. If E, whose weight is 3 kg more than that of D, replaces A, the average weight of B, C, D and E becomes 79 kg. The weight of A is
  1. A. 65 kg
  2. B. 70 kg
  3. C. 75 kg
  4. D. 80 kg
  1. Answer : C ( 75 kg )

  1. In a class of 100 students the average marks obtained by a student in Maths is 44. If we remove the highest and the lowest the average of the class becomes 43.92. A total of three students get either highest or lowest. What is the average of these three students?
  1. A. 73.33
  2. B. 46.66
  3. C. 59.99
  4. D. cannot be determined
  1. Answer : B ( 46.66 )

  1. Find the average of first 20 natural numbers ?
  1. A. 6
  2. B. 7.5
  3. C. 10.5
  4. D. 12
  1. Answer : C ( 10.5 )

  1. The average of 8 men is increased by 2 years when 2 of them whose ages are 21 and 23 years as replaced by two new men. The average age of two new men is 
  1. A. 22 years
  2. B. 24 years
  3. C. 28 years
  4. D. 30 years
  1. Answer : D ( 30 years )

  1. The average age of a class is 15.8 years. The average age of the boys in the class is 16.4 years and that of the girls is 15.4 years. What is the ratio of boys to girls in the class ?
  1. A. 2 : 3
  2. B. 2 : 4
  3. C. 3 : 4
  4. D. 3 : 5
  1. Answer : A ( 2 : 3 )

  1. The average weight of 8 men is increased by 1.5 Kg when one of the men who weights 65 Kg is replaced by a new man. The weight of the new man is
  1. A. 65 Kg
  2. B. 77 Kg
  3. C. 82 Kg
  4. D. 90 Kg
  1. Answer : B ( 77 Kg )

  1. A hiker walked for two days. On the second day, the hiker walked 2 hrs. longer and at an average speed of 1 km per hour faster than he walked on the first day. If during the two days he walked a total of 64 km and spent a total of 18 hrs. walking, what was his average speed on the first day?
  1. A. 2 km/h
  2. B. 3 km/h
  3. C. 4 km/h
  4. D. 5 km/h
  1. Answer : B ( 3 km/h )

  1. The average age of 8 persons in a committee is increased by 2 years when two men aged 35 years and 45 years are substituted by two women. The average age of these two women is
  1. A. 41 years
  2. B. 45 years
  3. C. 48 years
  4. D. 53 years
  1. Answer : C ( 48 years )

  1. Of the four numbers whose average is 60, the first is one-fourth of the sum of the last three. The first number is
  1. A. 15
  2. B. 45
  3. C. 48
  4. D. 25

  1. Answer : C ( 48 )

MongoDB Drop, Truncate and Delete Collection

Delete, Drop and Truncate collections in MongoDB
We will perform all the mongoDB Aggregation Operator on studentInfo DB. Create studentInfo Database in MongoDB server. Use the below code for creating the DB.

  

In the above studentInfo Mongo Database we will create many collection and we will perform mongoDB Delete Collection.

Use command db.createCollection("collectionName")  , this query we will use and create collection in the studentInfo DB.

Below is the video reference for dropping and deleting the Collection in Mongo.




Create Collection In studentInfo DB, below is the query to create the collection.

db.createCollection("studentPersonal") 

db.createCollection("studentMarks")

studentPersonal, studentMarks Collection will be created using above two Mongo Query.

Mongodb Drop Collection Query


Now we will use db.collectionName.drop()  for dropping collection in MongoDB. So as we created the collection named with studentPersonal and studentMarks. MongoDB delete and Drop collection will perform in these two collection.
db.studentPersonal.drop()
db.studentMarks.drop()
This above two query will delete the studentPersonal and studentMarks collection from MongoDB.

Note : If there will not be a single collection in the mongoDB then the studentInfo DB will not be visible.

Mongodb Truncate Collection Query

Sometime you want to truncate the Collection in MongoDB instead of Dropping or Deleting the Collection. In that case you must use remove() method on the collection which you want to truncate.


Syntax for MongoDB Collection Truncate 

db.collection.remove(<query>,<justOne>)
So if we want to truncate the collection we must have to use remove() method. <justOne > is optional here which limits the deletion of document.

We will Truncate the teacherInfo Collection using below command.
db.teacherInfo.remove({})
This above query will truncate the collection in MongoDB.

Maharashtra GK Question and Marathi General Knowledge

Maharashtra gk questions and mcq quiz





  1. In which year, Bombay city has been officially renamed as Mumbai
    1. A. 1992     
    2. B. 1995        Correct Answer
    3. C. 2000      
    4. D. 2003      
  2.  

    Which fort is the birthplace of Chhatrapati Shivaji Maharaj
    1. A. Raigad     
    2. B. Daulatabad      
    3. C. Shivneri        Correct Answer
    4. D. Sinhgad      
  3.  

    Which one is the highest point in Maharashtra
    1. A. Kalsubai       Correct Answer
    2. B. Raigad      
    3. C. Lohagad      
    4. D. Mahabaleshwar      
  4.  

    Who is known as the Political Guru of Mahatma Gandhi
    1. A. Ravindra Kelekar     
    2. B. Bal Gangadhar Tilak      
    3. C. Gopal Krishna Gokhale        Correct Answer
    4. D. None of the Above      
  5.  

    Who was the first Chief Minister of Maharashtra
    1. A. Yashwantrao Chavan       Correct Answer
    2. B. P. K. Sawant      
    3. C. Vasantrao Naik      
    4. D. Shankarrao Chavan      
  6.  

    Which day is celebrated as the Maharashtra Day
    1. A. 3rd June     
    2. B. 1st May        Correct Answer
    3. C. 16th August      
    4. D. 3rd September      
  7.  

    In which year the Bombay High Court was established
    1. A. 1856     
    2. B. 1862        Correct Answer
    3. C. 1896      
    4. D. 1906      
  8.  

    Approximately how many forts are there in Maharashtra
    1. A. 150     
    2. B. 200      
    3. C. 270      
    4. D. 350        Correct Answer
  9.  

    Total number of Districts in Maharashtra
    1. A. 23     
    2. B. 32      
    3. C. 36        Correct Answer
    4. D. 42      
  10.  

    Which marathi newspaper was published by Bal Gangadhar Tilak
    1. A. Sakal     
    2. B. Kesari        Correct Answer
    3. C. Darpan      
    4. D. Poona Vaibhav      
  11.  

    When the third battle of Panipat was fought between Maratha and Afghan army
    1. A. 1761       Correct Answer
    2. B. 1769      
    3. C. 1792      
    4. D. 1806      
  12.  

    In which year, Elephanta Caves designated as a UNESCO World Heritage Site
    1. A. 1972     
    2. B. 1978      
    3. C. 1982      
    4. D. 1987        Correct Answer
  13.  

    Which one is the longest river in Maharashtra
    1. A. Krishna River     
    2. B. Tapti River      
    3. C. Bhima River      
    4. D. Godavari River        Correct Answer
  14.  

    The Maharashtra State was formed by the Bombay Reorganisation Act in the year
    1. A. 1956     
    2. B. 1958      
    3. C. 1960        Correct Answer
    4. D. 1964      
  15.  

    Total number of Parliamentary Constituency
    1. A. 32     
    2. B. 28      
    3. C. 42      
    4. D. 48        Correct Answer
  16.  

    Who was the first Marathi litterateur to win the Jnanpith Award
    1. A. Laxmanshastri Joshi     
    2. B. Vinda Karandikar      
    3. C. Ravindra Kelekar      
    4. D. V.S. Khandekar        Correct Answer
  17.  

    Who is known as the spiritual guru of Shivaji
    1. A. Eknath     
    2. B. Tukaram      
    3. C. Ramdas Swami        Correct Answer
    4. D. Gora Kumbhar      
  18.  

    What is the literacy rate of Maharastra according to 2011 census
    1. A. 80.23 %     
    2. B. 82.34 %        Correct Answer
    3. C. 85.22 %      
    4. D. 89.11 %      
  19.  

    The Bandra" Worli Sea Link Bridge was opened for public in the year
    1. A. 2007     
    2. B. 2009        Correct Answer
    3. C. 2010      
    4. D. 2011      
  20.  

    In which year the Mumbai University was established
    1. A. 1845     
    2. B. 1850      
    3. C. 1853      
    4. D. 1857        Correct Answer
  21.  

    Who was the first person of Maharashtra to received Bharat Ratna Award
    1. A. B R Ambedkar     
    2. B. Vinoba Bhave      
    3. C. Dhondo Keshav Karve        Correct Answer
    4. D. Lata Mangeshkar      
  22.  

    The Nagpur city is also known as the _________ city of India
    1. A. Orange       Correct Answer
    2. B. Mango      
    3. C. Banana      
    4. D. Apple      
  23.  

    Which king of England had been presented with the Mumbai city as a dowry from Portugal
    1. A. James VI     
    2. B. James II      
    3. C. Charles II        Correct Answer
    4. D. Henry VIII      
  24.  

    In which year the construction of Chatrapati Shivaji Terminus was completed
    1. A. 1888       Correct Answer
    2. B. 1892      
    3. C. 1898      
    4. D. 1903      
  25.  

    The Bhoodan movement was started by ___________ in 1951
    1. A. Baba Amte     
    2. B. Vinoba Bhave        Correct Answer
    3. C. Medha Patkar      
    4. D. Vinayak Damodar Savarkar      
  26.  

    Which one is recognised as state tree in Maharastra
    1. A. Banyan Tree     
    2. B. Jackfruit Tree      
    3. C. Neem Tree      
    4. D. Mango Tree        Correct Answer
  27.  

    Who was the first Vice Chancellor of Mumbai University
    1. A. John Wilson       Correct Answer
    2. B. William Guyer Hunter      
    3. C. N. G. Chandavarkar      
    4. D. Raymond West      
  28.  

    In which year, the construction of Gateway of India was completed
    1. A. 1911     
    2. B. 1917      
    3. C. 1924        Correct Answer
    4. D. 1928      
  29.  

    The Gateway of India was erected to mark the landing of which King
    1. A. James VI     
    2. B. Edward VII      
    3. C. George V        Correct Answer
    4. D. George VI      
  30.  

    Which one is the largest district by area wise in Maharastra
    1. A. Pune     
    2. B. Ahmednagar        Correct Answer
    3. C. Nashik      
    4. D. Solapur

Our Feature Post

There is a tree between houses of A and B If the tree leans on As House

    There is a tree between houses of A and B. If the tree There is a tree between houses of A and B. If the tree leans on A’s House, the t...

Our Popular Post