Install and Configure git in two Linux EC2 Instance (2 Regions)
In this article,we will see Launch two linux EC2 instances in different regions and Install & Configure git to run configuration commands.
Implementation Steps
- Launch Linux EC2 Instance in Mumbai Region.
- Connect to Linux EC2 Instance through Putty.
- Run commands to Install & Configure the git.
- Go to London Region.
- Launch Linux EC2 Instance in London Region.
- Connect to Linux EC2 Instance through Putty.
- Run commands to Install & Configure the git.
Launch Linux EC2 Instance in Mumbai Region
Please check below link to Launch Linux Server.
Launch Linux Launch Linux Server
We can see Linux Server “Mumbai-Git” which was created earlier.
Connect to Linux EC2 Instance through Putty
Run commands to Install & Configure the git
Open Linux Terminal
1 2 3 4 5 6 7 8 9 10 11 |
Using username "ec2-user". Authenticating with public key "imported-openssh-key" __| __|_ ) _| ( / Amazon Linux 2 AMI ___|\___|___| https://aws.amazon.com/amazon-linux-2/ 5 package(s) needed for security, out of 13 available Run "sudo yum update" to apply all updates. [ec2-user@ip-172-31-43-80 ~]$ |
Switch to root user
1 2 |
[ec2-user@ip-172-31-43-80 ~]$ sudo su [root@ip-172-31-43-80 ec2-user]# |
Install Server Updates
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
[root@ip-172-31-43-80 ec2-user]# yum update -y Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 2.4 kB 00:00:00 Resolving Dependencies --> Running transaction check ---> Package file.x86_64 0:5.11-33.amzn2.0.2 will be updated ---> Package file.x86_64 0:5.11-35.amzn2.0.1 will be an update --> Finished Dependency Resolution Dependencies Resolved ================================================================================================ Package Arch Version Repository Size ================================================================================================ Installing: kernel x86_64 4.14.154-128.181.amzn2 amzn2-core 20 M python2-rpm x86_64 4.11.3-40.amzn2.0.3 amzn2-core 84 k replacing rpm-python.x86_64 4.11.3-25.amzn2.0.3 Updating: file x86_64 5.11-35.amzn2.0.1 amzn2-core 57 k file-libs x86_64 5.11-35.amzn2.0.1 amzn2-core 339 k python x86_64 2.7.16-4.amzn2 amzn2-core 92 k yum noarch 3.4.3-158.amzn2.0.3 amzn2-core 1.2 M Cleanup : yum-3.4.3-158.amzn2.0.2.noarch 15/25 Erasing : rpm-python-4.11.3-25.amzn2.0.3.x86_64 16/25 Cleanup : python-libs-2.7.16-3.amzn2.0.1.x86_64 24/25 Cleanup : rsyslog-8.24.0-16.amzn2.6.1.x86_64 25/25 Verifying : python-libs-2.7.16-4.amzn2.x86_64 1/25 Verifying : file-5.11-35.amzn2.0.1.x86_64 2/25 Verifying : python-2.7.16-4.amzn2.x86_64 3/25 Verifying : file-libs-5.11-33.amzn2.0.2.x86_64 25/25 Installed: kernel.x86_64 0:4.14.154-128.181.amzn2 python2-rpm.x86_64 0:4.11.3-40.amzn2.0.3 Updated: file.x86_64 0:5.11-35.amzn2.0.1 file-libs.x86_64 0:5.11-35.amzn2.0.1 python.x86_64 0:2.7.16-4.amzn2 python-devel.x86_64 0:2.7.16-4.amzn2 python-libs.x86_64 0:2.7.16-4.amzn2 rpm.x86_64 0:4.11.3-40.amzn2.0.3 rpm-build-libs.x86_64 0:4.11.3-40.amzn2.0.3 rpm-libs.x86_64 0:4.11.3-40.amzn2.0.3 rpm-plugin-systemd-inhibit.x86_64 0:4.11.3-40.amzn2.0.3 rsyslog.x86_64 0:8.24.0-41.amzn2.2.1 yum.noarch 0:3.4.3-158.amzn2.0.3 Replaced: rpm-python.x86_64 0:4.11.3-25.amzn2.0.3 Complete! |
Install git package
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
[root@ip-172-31-43-80 ec2-user]# yum install git -y Loaded plugins: extras_suggestions, langpacks, priorities, update-motd Resolving Dependencies --> Running transaction check ---> Package git.x86_64 0:2.17.2-2.amzn2 will be installed --> Processing Dependency: perl-Git = 2.17.2-2.amzn2 for package: git-2.17.2-2.amzn2.x86_64 ---> Package perl-Git.noarch 0:2.17.2-2.amzn2 will be installed Dependencies Resolved ================================================================================================ Package Arch Version Repository Size ================================================================================================ Installing: git x86_64 2.17.2-2.amzn2 amzn2-core 217 k Installing for dependencies: emacs-filesystem noarch 1:25.3-3.amzn2.0.1 amzn2-core 64 k git-core x86_64 2.17.2-2.amzn2 amzn2-core 4.0 M Running transaction Installing : git-core-2.17.2-2.amzn2.x86_64 1/8 Installing : git-core-doc-2.17.2-2.amzn2.noarch 2/8 Installing : libsecret-0.18.5-2.amzn2.0.2.x86_64 3/8 Verifying : git-core-2.17.2-2.amzn2.x86_64 5/8 Verifying : git-2.17.2-2.amzn2.x86_64 6/8 Verifying : perl-Git-2.17.2-2.amzn2.noarch 7/8 Verifying : git-core-doc-2.17.2-2.amzn2.noarch 8/8 Installed: git.x86_64 0:2.17.2-2.amzn2 Dependency Installed: emacs-filesystem.noarch 1:25.3-3.amzn2.0.1 git-core.x86_64 0:2.17.2-2.amzn2 git-core-doc.noarch 0:2.17.2-2.amzn2 libsecret.x86_64 0:0.18.5-2.amzn2.0.2 perl-Error.noarch 1:0.17020-2.amzn2 perl-Git.noarch 0:2.17.2-2.amzn2 perl-TermReadKey.x86_64 0:2.30-20.amzn2.0.2 Complete! |
Verify git Package
1 2 3 |
[root@ip-172-31-43-80 ec2-user]# which git /bin/git [root@ip-172-31-43-80 ec2-user]# |
Check Version of git Package
1 2 |
[root@ip-172-31-43-80 ec2-user]# git --version git version 2.17.2 |
Set Username Configuration
1 |
[root@ip-172-31-43-80 ec2-user]# git config --global user.name "Ram" |
Set Email Configuration
1 |
[root@ip-172-31-43-80 ec2-user]# git config --global user.eamil "rameshatchala.ktexperts@gmail.com" |
Verify Username and Email Configurations
1 2 3 |
[root@ip-172-31-43-80 ec2-user]# git config --list user.name=Ram user.eamil=rameshatchala.ktexperts@gmail.com |
Set the Date
1 2 |
[root@ip-172-31-43-80 ec2-user]# date +%T -s"21:43:00" 21:43:00 |
Verify Date
1 2 |
[root@ip-172-31-43-80 ec2-user]# date Sat Nov 30 21:43:15 UTC 2019 |
Go to London Region
Click on Europe (London) to change the region.
Launch Linux EC2 Instance in London Region
Please check below link to Launch Linux Server.
Launch Linux Launch Linux Server
We can see Linux Server “London-Git” which was created earlier.
Connect to Linux EC2 Instance through Putty
Run commands to Install & Configure the git
Open Linux Terminal
1 2 3 4 5 6 7 8 9 10 11 |
Using username "ec2-user". Authenticating with public key "imported-openssh-key" __| __|_ ) _| ( / Amazon Linux 2 AMI ___|\___|___| https://aws.amazon.com/amazon-linux-2/ 5 package(s) needed for security, out of 13 available Run "sudo yum update" to apply all updates. [ec2-user@ip-172-31-30-41 ~]$ |
Switch to root user
1 2 |
[ec2-user@ip-172-31-30-41 ~]$ sudo su [root@ip-172-31-30-41 ec2-user]# |
Install Server Updates
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
[root@ip-172-31-30-41 ec2-user]# yum update -y Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 2.4 kB 00:00:00 Resolving Dependencies --> Running transaction check ---> Package file.x86_64 0:5.11-33.amzn2.0.2 will be updated ---> Package file.x86_64 0:5.11-35.amzn2.0.1 will be an update ---> Package file-libs.x86_64 0:5.11-33.amzn2.0.2 will be updated --> Finished Dependency Resolution Dependencies Resolved ================================================================================================ Package Arch Version Repository Size ================================================================================================ Installing: kernel x86_64 4.14.154-128.181.amzn2 amzn2-core 20 M python2-rpm x86_64 4.11.3-40.amzn2.0.3 amzn2-core 84 k replacing rpm-python.x86_64 4.11.3-25.amzn2.0.3 Updating: file x86_64 5.11-35.amzn2.0.1 amzn2-core 57 k file-libs x86_64 5.11-35.amzn2.0.1 amzn2-core 339 k python x86_64 2.7.16-4.amzn2 amzn2-core 92 k yum noarch 3.4.3-158.amzn2.0.3 amzn2-core 1.2 M Cleanup : yum-3.4.3-158.amzn2.0.2.noarch 15/25 Erasing : rpm-python-4.11.3-25.amzn2.0.3.x86_64 16/25 Cleanup : python-libs-2.7.16-3.amzn2.0.1.x86_64 24/25 Cleanup : rsyslog-8.24.0-16.amzn2.6.1.x86_64 25/25 Verifying : file-libs-5.11-33.amzn2.0.2.x86_64 25/25 Installed: kernel.x86_64 0:4.14.154-128.181.amzn2 python2-rpm.x86_64 0:4.11.3-40.amzn2.0.3 Updated: file.x86_64 0:5.11-35.amzn2.0.1 file-libs.x86_64 0:5.11-35.amzn2.0.1 python.x86_64 0:2.7.16-4.amzn2 python-devel.x86_64 0:2.7.16-4.amzn2 Replaced: rpm-python.x86_64 0:4.11.3-25.amzn2.0.3 Complete! |
Install git package
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
[root@ip-172-31-30-41 ec2-user]# yum install git -y Loaded plugins: extras_suggestions, langpacks, priorities, update-motd Resolving Dependencies --> Running transaction check ---> Package git.x86_64 0:2.17.2-2.amzn2 will be installed Dependencies Resolved ================================================================================================ Package Arch Version Repository Size ================================================================================================ Installing: git x86_64 2.17.2-2.amzn2 amzn2-core 217 k Installing for dependencies: emacs-filesystem noarch 1:25.3-3.amzn2.0.1 amzn2-core 64 k git-core x86_64 2.17.2-2.amzn2 amzn2-core 4.0 M perl-TermReadKey x86_64 2.30-20.amzn2.0.2 amzn2-core 31 k Transaction Summary ================================================================================================ Install 1 Package (+7 Dependent packages) Total download size: 6.8 M Installed size: 36 M Downloading packages: (1/8): emacs-filesystem-25.3-3.amzn2.0.1.noarch.rpm | 64 kB 00:00:00 (2/8): git-2.17.2-2.amzn2.x86_64.rpm | 217 kB 00:00:00 (8/8): perl-TermReadKey-2.30-20.amzn2.0.2.x86_64.rpm | 31 kB 00:00:00 ------------------------------------------------------------------------------------------------ Total 26 MB/s | 6.8 MB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : git-core-2.17.2-2.amzn2.x86_64 1/8 Verifying : git-2.17.2-2.amzn2.x86_64 6/8 Installed: git.x86_64 0:2.17.2-2.amzn2 Dependency Installed: emacs-filesystem.noarch 1:25.3-3.amzn2.0.1 git-core.x86_64 0:2.17.2-2.amzn2 git-core-doc.noarch 0:2.17.2-2.amzn2 libsecret.x86_64 0:0.18.5-2.amzn2.0.2 perl-Error.noarch 1:0.17020-2.amzn2 perl-Git.noarch 0:2.17.2-2.amzn2 perl-TermReadKey.x86_64 0:2.30-20.amzn2.0.2 Complete! |
Verify git Package
1 2 |
[root@ip-172-31-30-41 ec2-user]# which git /bin/git |
Check Version of git Package
1 2 |
[root@ip-172-31-30-41 ec2-user]# git --version git version 2.17.2 |
Set Username Configuration
1 |
[root@ip-172-31-30-41 ec2-user]# git config --global user.name "Ram" |
Set Email Configuration
1 |
[root@ip-172-31-30-41 ec2-user]# git config --global user.email "rameshatchala.ktexperts@gmail.com" |
Verify Username and Email Configurations
1 2 3 |
[root@ip-172-31-30-41 ec2-user]# git config --list user.name=Ram user.email=rameshatchala.ktexperts@gmail.com |
Set the Date
1 2 |
[root@ip-172-31-30-41 ec2-user]# date +%T -s"21:43:00" 21:43:00 |
Verify Date
1 2 |
[root@ip-172-31-30-41 ec2-user]# date Sat Nov 30 21:43:15 UTC 2019 |
Thank you for giving your valuable time to read the above information. Please click here to subscribe for further updates
KTEXPERTS is always active on below social media platforms.
Facebook : https://www.facebook.com/ktexperts/
LinkedIn : https://www.linkedin.com/company/ktexperts/
Twitter : https://twitter.com/ktexpertsadmin
YouTube : https://www.youtube.com/c/ktexperts
Instagram : https://www.instagram.com/knowledgesharingplatform
Priya
very nice information about devops thanks for making..
santhi
Really nice session with detailed explanation.Easy to understand and we can learn lot things by seeing your article in short time.
Thanks for sharing…