You are on page 1of 5

RECORD OF EXPERIMENTS

Cloud Application Development Lab

Submitted By

Sarthak Goyal
Enrolment No.: R110218138
SAP ID: 500067706
Semester VI
B. Tech. (Computer Sc. and Engineering)
Specialization in CCVT

Submitted To

Ms. Shelly

School of Computer Science


UNIVERSITY OF PETROLEUM AND ENERGY STUDIES
Dehradun-248007
2021-22
Roll No: R110218138 CAD LAB
SAP ID: 500067706

Experiment 6:
Aim: Implement Load Balancing on Cloud Platform(Django) for Application
Requirements: Python(2.7.x or 3.4.x), virtualenv, Django, Any IDE(Microsoft Visual Code,
Atom), easy_install, pip, NGINX.
The role of load balancing is to efficiently distribute the incoming network traffic across a
group of backend servers.
In this experiment, we will implement load balancing using NGINX.
Step 1: Download & Install NGINX for Mac OS X using the following command in terminal

brew install nginx

Step 2: Run NGINX using the following command

sudo nginx

Step 3: Test NGINX by visiting http://localhost:8080 on your browser. Output will show that
NGINX is running correctly.

2
Roll No: R110218138 CAD LAB
SAP ID: 500067706

Step 4: Stop the NGINX using following command

sudo nginx -s stop

Step 5: Edit NGINX configuration file using following command

nano /usr/local/etc/nginx/nginx.conf

Configure the upstream and server parts on http bracket like following

upstream jeng-goh {
server localhost:8000;
server localhost:8888;
}
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://jeng-goh;
}

3
Roll No: R110218138 CAD LAB
SAP ID: 500067706
}

Save the file using Ctrl + X and Yes.

Here we set two ports: 8000 & 8088. On these two ports we are going to run two of our
Django projects and then check NGINX. If it is working, then the Load Balancer has been
implemented successfully.
Project 1 will be run on port 8000 using the following commands

cd Desktop/cloudapp
source bin/activate
cd mysite
python manage.py runserver 8000

4
Roll No: R110218138 CAD LAB
SAP ID: 500067706
Project 2 will be run on port 8088 using the following commands

cd Desktop/cloudapp
source bin/activate
cd tutorial
python manage.py runserver 8088

Now test NGINX by visiting http://localhost

END OF EXERCISE

You might also like