Skip to main content

Posts

Showing posts from February, 2018

AUTOSCALING IN AWS

AWS Auto Scaling monitors your applications and automatically adjusts capacity to maintain steady, predictable performance at the lowest possible cost.Here first we will create an image out of vm before placing it in autoscaling group.We have already a vm created.First create an image out of it.From Actions > Image > Create Image.Give necessary details and give ok.  CREATION OF AUTOSCALING GROUP First we want to Launch Configuration for autoscaling group.While creating configuration we have to specify details such as instance type,configuration name,security group and so on. Now we have created configuration for auto scaling group.Now we want to create auto scaling group.On first wizard we have to give details about  groupname,group size,network and subnet details we want and click next. Here we have to set scaling policies.Click on use scaling policies to adjust capacity of this group.There will be two options simple scaling policy an

ELASTIC LOADBALENCER IN AWS

Elastic Load Balancing distributes incoming application traffic across multiple EC2 instances, in multiple Availability Zones.Here before creating a loadbalencer assume that we have 2 subnets sub1 and sub2 in 2 availability zones.Also we have 2 ec2 instances vm1 and vm2 under these subnets.   To check loadbalencing  I have httpd installed on both instances.The index.html page contains Information as follows: Now lets begin creating loadbalencer.Here we are creating an application load balancer to distribute traffic among webservers across vm1 and vm2 From ec2-dashboard > select Load balencers >Create Load balancer >Application Load balancer   In Configure loadbalencer give >Name: give name for the load balancer we want >Scheme: Scheme can be internet facing or internal.Here we are creating an internet     facing load balancer. An Internet-facing load balancer routes requests from clients over the Internet to targets. An int

CHANGING LATEST COMMIT IN GIT

Scenario: Consider we created a file change1 and commited it.Suppose we created a second file change2 and want to add this file to same commit.We can do this. First create a filechange1 and add it to index and commit it  # touch change1 #git add change1 #git commit change -m "change commit" Note the hash value of commit by git log Now create second file change2 and add it to index #touch change2 #git add change2 Now if we want both change1 and change2 to have same commit #git commit --ammend Now change the message of commit if we want and save it By using git-log we can see that the commit value is changed #git log

USING RESET IN GIT

 Case1: First initialize git #git init Now clone with our repo git-test #git clone git@github.com:arunm8489/git-test.git #cd git-test #ls This will list the files present in our repository.Now create a new file test4 and add it to index(staging) We can see test4 is staged.Here comes one of the use of reset. #git reset HEAD test4 This will moves the test4 from staging to working area.To see it #git status Here what happened is file is moved from staging to working area Case2: Here we can test what git reset --hard HEAD will do.create another file test5 and add both test4 and test5 to staging. #git add test4 test5 # git reset --hard HEAD We can see that  all changes we made will be gone and entire content in repository will be reflected in working area. Case 3: Now we will check another use of reset Create file test4 and test5 Add it to staging and commit it Now check commits by using #git log Suppose if we want to go back to condition before

SETTING UP THE NTP SERVICE IN CENTOS7

First we have to assign correct timezone #timedatectl Local time: Sat 2015-11-07 08:17:33 EST Universal time: Sat 2015-11-07 13:17:33 UTC RTC time: Sat 2015-11-07 13:17:33 Timezone: America/New_York (EST, -0500) NTP enabled: yes NTP synchronized: yes RTC in local TZ: no DST active: no Last DST change: DST ended at Sun 2015-11-01 01:59:59 EDT Sun 2015-11-01 01:00:00 EST Next DST change: DST begins (the clock jumps one hour forward) at Sun 2016-03-13 01:59:59 EST Sun 2016-03-13 03:00:00 EDT To list available time zones # timedatectl list-timezones Africa/Abidjan Africa/Accra Africa/Addis_Ababa ... America/La_Paz America/Lima America/Los_Angeles ... Asia/Seoul Asia/Shanghai Asia/Singapore ... Pacific/Tongatapu Pacific/Wake Pacific/Wallis set the time-zone we want # timedatectl set-timezone Asia/Kolkata # timedatectl       Local time: Sat 2015-11-07 05:32:43 PST   Universal time: Sat 2015-11-07 13:32:43 UTC         RTC time: Sat 2015-11-07 13:32:43         Timezone: Asia/Kolkata (PST, -

MERGING CONFLICT IN GIT

Scenario: User bob pulled repo from central repository at 9.00AM edited it and pushed back to central repository at 9.30AM. Another user aliced pulled the same repository at 9.10AM edited it and pushed back at 9.40AM.At that time conflict occur. Solution: Let us consider bob pulled repo git-test at 9.00AM. #git init #git clone git@github.com:arunm8489/git-test.git #cd git-test Then he edited file test2 and made certain entries. Then he committed it #git commit test2 -m “first commit made bt bob” Now at 9.30AM he pushed it back to central repository #git push origin master Now test2 look as follows: During the same time Alice is editing the same file and she pushed it back to central repository at 9.40AM.During this time merging conflict will occur. We can see Alice will not be able to push it back. #git pull --rebase origin master This will pull back the central repo with certain limitations.Now we want to find the conflicts.We see on pulling it back the status sh