Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

COMP5349 Cloud Computing

Replacement Exam Script

S1, 2022

Question 1 Short Answer Questions (20 points)

1     [6 points] Explain how to implement a erasure coding scheme LRC(10,2,2). Show an example

failure pattern with three failed fragments in your design and analyse the reconstruction cost.

2     [8  points]  Describe  the  similarity  and  differences  between  hypervisor,  container  runtime  and

operating system.

3     [6 points] Assume that during a crash recovery scenario, the database layer has specified three

CPLs:  800, 900 and 1000 and the storage service has specified VCL of 805. Explain the meaning of all different LSNs. Work out the value of VDL and its meaning.

Question 2 GFS (15 points)

This question has two parts. All parts are related with an GFS cluster with a master node M and many  chunk servers CS1, … CSn . A logfile L is stored as three chunks L0 , L1 and L2 .  They are replicated in a few nodes. The distribution of replicas is shown in the table.

Chunk/Server

CS 1

CS 2

CS 3

CS 4

CS 5

0

x

 

x

x

 

L1

x

x

 

x

 

L2

x

 

x

 

x

1.   [5  points]  Assume  a  MapReduce  application  designed  to  analyze  various  log  events.  The application takes L as input in a particular execution, describe a possible scenario for the application to get the input data. Your description should describe the nodes being contacted and the possible control and data flow between nodes. No point will be awarded for describing the general GFS read

process.

2.   [ 10 points] Assume two clients C1 and C2  concurrently append latest entries to chunk L2. The replica on CS3 holds the current lease for this chunk. C1 is running on a machine closest to CS3; is running on a machine closest to CS5. At time t0, C1 needs to append an log entry le1, C2 needs to append a log entry le2 . Describe a possible scenario for the cluster to handle the concurrent append requests. You can make assumptions on the relative distance between the nodes involved. No point will be awarded for describing the general GFS write process.

Question 3 Resource Allocation and scheduling (25 points)

Assume a YARN cluster consists of ten AWS c4.xlarge  instances . The cluster has one master node and    nine work nodes .  An AWS c4.xlarge instance has 4 vCPU and 7 .5G memory . Assume YARN can use 6G memory on each node manager . YARN is configured to use a fair scheduler and each user’s applications  are submitted to its own queue .

The default resource configuration for MapReduce application is:

•   Application Master: 1G

•    Mapper: 3G

•    Reducer: 5G

For simplicity, we assume containers for reduce tasks will be requested after all map tasks in the same job have been completed .

The default resource configuration for Spark application is:

•    Application Master: 1G

•    Executor Memory: 6G

    Executor Core: 4

For simplicity, we assume all executors will be requested at the same time and stay throughout the life cycle of the application.

User A submitted a MapReduce application M at t0 .  There is no other application running in the cluster when M is submitted . M contains two jobs . The first job has an input of 10 blocks . It uses three reduce  tasks . The second job take the first job’s output for the map stage . It uses four reduce tasks .

User B submitted a Spark application S at t1. The application will start one job with three stages . Each stage has 10 tasks . It requires three executors .

At t2 , five map tasks of M’s first job have completed .

At t3, all map tasks of M’s first job have completed .

1.   [2 points] What is the total number of vCPU and total size of memory YARN can allocate?

2.   [2 points] Describe the queues and their respective resource capacity at t0  and t1 respectively .

3.   [5 points] Describe the containers M requested and allocated before t3  and their respective resource allocation .

4.   [4 points] Describe the containers M will request after t3  and the sequence of requesting them .

5.   [6 points] Describe the sequence of requesting and allocating containers for application S. You can make assumptions on how containers are allocated on different nodes . Note that , depending on the available resources in the cluster, containers requested at the same time may not be         allocated at the same time .

6.   [6 points] Describe a possible way of allocating tasks to the executors for application S.

Question 4  Spark Programming and Distributed Execution (20 points)

This question has several parts. All parts are related with the following Spark program. The program uses the same ratings.csv file you have used in many lab exercises.

 

1.    [8 points] Executing this application may start one or more jobs.  Describe the stages of each job. For each stage, specify the operations to be executed in the stage. If a stage is skipped, you should mention that well.

2.    [6 points] Identify the variables referring to Data Frame or RDD. For each RDD or DataFrame, describe the content of its element

3.    [6 points] Assuming ratings.csv has 4 blocks, how many partitions are there in each intermediate DataFrame or RDD created to compute var5.

Question 5. Distributed Data Consistency (20 points)

This question has multiple parts and all parts are based on a replicated system with five nodes:  PR1, R2, R3 and R4. P is the distinguished proposer when the system starts. It is supposed to    receive all write commands and to determine the order of the received write commands. P runs multiple Paxos instances to achieve consensus among all replicas on the order of the write          commands. Assume P has run the prepare phase  of infinite Paxos instances with proposal           number 1 and has received promises in all instances from every nodes. Below is a sequence of   events happened in the system.

•           At t0

•     P receives five concurrent update commands and determines that the order        should be: q1, q2, q3, q4 and  q5 . P starts the accept phase for five Paxos instances numbered as 1, 2, 3, 4,5.

•           At t1

•     P receives new write commands q6, q7   and q8 from client and starts the accept phase for relevant Paxos instance.

•     R1, R2 and R4 receive the message in instance 1, 2 and 4

•     R3 receives the message in instance 1, 2 and 5

At t2

•     R2, R3 and R4 receive the message in instance 6.

•     R1 receives the message in instance 7

•     R2 receives the message in instance 8

At t3

•     P fails and R1 is now the new distinguished proposer. It has received a new write commands q9

1.    [2 points] What message(s) does(do) P send to R1 at t0 ?

2.    [2 points] What message(s) does(d0) P send to R2 at t 1?

2.    [4 points] At t3  what does R1 know about the order of the write commands?

3.    [6 points] Describe the process R1 takes to ensure the system will move forward to establish a sequence of the write commands sent by clients.

4.   [6 points] Describe a possible way for R3 to obtain the up to date knowledge of the         write command sequence. Your description should give detailed message sequence that conforms to Paxos algorithm.