0% found this document useful (0 votes)
27 views8 pages

My Assigment

The diagram shows the multi-tier architecture with load balancers, web servers, application servers, databases, caching layers and a CDN. Key services like search, payments and recommendations are also depicted. Elastic load balancers help scale the frontend horizontally.

Uploaded by

Rasiq Desai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views8 pages

My Assigment

The diagram shows the multi-tier architecture with load balancers, web servers, application servers, databases, caching layers and a CDN. Key services like search, payments and recommendations are also depicted. Elastic load balancers help scale the frontend horizontally.

Uploaded by

Rasiq Desai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

QUESTION-1

Create an application and demo how we can deploy the application using ElasticBeanStalk
or demo the ElasticBeanStalk steps to deploy the application.

Solution: Please find the below URL of PHP Application which has been deployed successfully through
Elastic Bean Stalk.

CLICK http://vizitechkkebs-env.eba-2c3whimr.eu-central-1.elasticbeanstalk.com

STEPS T0 DEPLOYMENT IN EBS:


1. Go to EBSCreate New EnvironmentSelect Web Server Environment
2. Fill all parameters like
Application Name
Environment Name
Choose a platformPHPPlatform branch PHP 7.4Platform version.
3. In Application CodeUpload your Code Click Configure more options.

4. In Software Tab Keep everything as default, unless and until you want to add Environmental
variables.
5. Instances Tab Keep everything as default, and select your appropriate Security Groups which you
want to apply.
6. Capacity Tab Keep everything as default.
7. Load BalancerDepends on the requirement.
8. Rolling Updates & DeploymentsSelect Deployments All at Once, Rolling, Rolling with Batch,
Immutable. Rolling Updates typeDisable or Immutable and select your health check True or
False.
9. Security TabAttach your Service Role and also your EC2 Key Pair.
10. Monitoring Tab Select as required.
11. Managed Updates Keep everything as default.
12. Notifications TabKeep everything as default.
13. Network TabSelect your Custom VPC
14. Database Tab Select as required.

Review and Create your EnvironmentIt will take couple of minutes to launch your application.

If everything goes will without any code issue or infra issue, then your application will be up and running
with the HEALTH: OK

Finally, you can go to your environment to view your application


http://vizitechkkebs-env.eba-2c3whimr.eu-central-1.elasticbeanstalk.com

Below you can see EBS has created a running instance backend in which your PHP app is running on.
QUESTION-2
Ansible automation Demo - Showcase any use case that you want that shows Ansible in
action.

Firstly I have created 3 instances on AWS and named as Master-Node, Node-1 and Node-2

Configuration PART:

I have added a useradd named test in all the machines, and in the vi sshd_config. – I have given access
to PasswordAuthentication: YES and PermitRootLogin: YES

Now from MASTER Node you can login into Node-1 and Node-2

#To change from root user to newly added user


su – test

NOW root user can able to switch to newly created user which is test by entering the command ‘su - test’,
by from test user we can’t able to switch to root user, So we need to generate the key and share the key to
all Nodes1 and Node2.

ANSBILE WORKS ON KEYLESS AUTHENTICATION, It should not ask for password


If I login from MASTER to other nodes.

Lets first give root privileges to test user

vi /etc/sudoers —> ## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment)
#includedir /etc/sudoers.d
ec2-user ALL=(ALL) NOPASSWD: ALL
test ALL=(ALL) NOPASSWD: ALL

SSH Connectivity on MASTER NODE:


#For creating KEY-GEN on all accounts
ssh-keygen - and create the key

ssh-copy-id 172.31.33.191
ssh-copy-id 172.31.34.180

ssh [email protected] - U can login to Node-1 , without any password prompt.


ssh [email protected] - U can login to Node-2 , without any password prompt.

INSTALLING ANSIBLE ON ALL MACHINES


MASTER:
sudo amazon-linux-extras install ansible2

ansible --version

#CONFIGURING ANSIBLE IN MASTER


cd etc/
cd ansible/
vi ansible.cfg

Installing python
sudo yum list installed|grep -i python
python

We need to ADD our nodes 1 and node 2 in the /etc/ansible/hosts ansible

cd etc/
cd ansible/
sudo vi hosts

[local]
localhost
[webserver]
172.31.33.191
[appserver]
172.31.34.180

cat hosts

ansible all --list-hosts

[test@ip-172-31-47-252 ~]$ ansible webserver -m ping


[WARNING]: Platform linux on host 172.31.33.191 is using the discovered Python
interpreter at /usr/bin/python, but future installation of another Python
interpreter could change this. See https://docs.ansible.com/ansible/2.9/referen
ce_appendices/interpreter_discovery.html for more information.
172.31.33.191 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"ping": "pong"
WRITING ANSIBLE PLAY BOOKS:

cd home/
ll
cd test
ls -l
mkdir -p Playbook
cd Playbook/
ls -l

#Install vim on all servers from master

ansible all -m yum -a 'pkg=vim state=installed update_cache=true'

#To check vim installed or not

ansible all -m shell -a 'yum list installed|grep vim'

[test@ip-172-31-47-252 Playbook]$ sudo vi MyfirstPlaybook.yml


#to check hosts

cat /etc/ansible/hosts

Sudo vim MyfirstPlaybook.yml


ansible-playbook MyfirstPlaybook.yml

You can see Apache web server has been successfully running on the Node-1 and Node-2.
Like-wise you can run your playbooks from MASTER NODE.
QUESTION-3
Showcase the architecture diagram for the site like Flipkart or Facebook.

You might also like