6.824 Lab 1 实验指导书: MapReduce

该实验要求实现一个分布式MapReduce系统,包括一个协调器和一个或多个工作进程,它们通过RPC通信。工作进程从协调器获取任务,处理输入,执行Map和Reduce操作,并将结果写入文件。协调器需要监测任务超时并重新分配。实验提供了简单的顺序MapReduce实现和一些应用示例,如word-count。你需要实现分布式版本,并确保在完成实验后,测试脚本能够通过检查,包括正确性、并行性和故障恢复能力。
摘要由CSDN通过智能技术生成

Introduction

In this lab you'll build a MapReduce system. You'll implement a worker process that calls application Map and Reduce functions and handles reading and writing files, and a coordinator process that hands out tasks to workers and copes with failed workers. You'll be building something similar to the MapReduce paper. (Note: the lab uses "coordinator" instead of the paper's "master".)

本lab要实现MR,详细见论文

We supply you with a simple sequential mapreduce implementation in src/main/mrsequential.go. It runs the maps and reduces one at a time, in a single process. We also provide you with a couple of MapReduce applications: word-count in mrapps/wc.go, and a text indexer in mrapps/indexer.go. You can run word count sequentially as follows:

提供了 mr-sequential,以及一些mr应用

$ cd ~/6.824
$ cd src/main
$ go build -race -buildmode=plugin ../mrapps/wc.go
$ rm mr-out*
$ go run -race mrsequential.go wc.so pg*.txt
$ more mr-out-0
A 509
ABOUT 2
ACT 8
...

↑ 这样运行mr-sequential

(Note: If you don't compile with -race, you won't be able to run with -race)

Feel free to borrow code from mrsequential.go. You should also have a look at mrapps/wc.go to see what MapReduce application code looks like.

↑可以借鉴的东西

Your Job (moderate/hard)

Your job is to implement a distributed MapReduce, consisting of two programs, the coordinator and the worker. There will be just one coordinator process, and one or more worker processes executing in parallel. In a real system the workers would run on a bunch of different machines, but for this lab you'll run them all on a single machine. The workers will talk to the coordinator via RPC. Each worker process will ask the coordinator for a task, read the task's input from one or more files, execute the task, and write the task's output to one or more files. The coordinator should notice if a worker hasn't completed its task in a reasonable amount of time (for this lab, use ten seconds), and give the same task to a different worker.

实现一个分布式的MR,master和worker。本lab中所有的都运行在一台机器上。worker和master通过RPC通信。本lab中,如果worker没有在10s内响应master,master就应该将对应的任务分配给其他worker

We have given you a little code to start you off. The "main" routines for the coordinator and worker are in main/mrcoordinator.go and main/mrworker.go; don't change these files. You should put your implementation in mr/coordinator.go, mr/worker.go, and mr/rpc.go.

↑改哪些代码,不改哪些代码

Here's how to run your code on the word-count MapReduce application. First, make sure the word-count plugin is freshly built:

$ go build -race -buildmode=plugin ../mrapps/wc.go
<
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值