介绍:https://pdos.csail.mit.edu/6.824/labs/lab-mr.html
前期工作
使用windows vscode远程linux来做,这样我们可以在windows debug,也可以直接在remote server运行我们的测试脚本
remote development 开发配置参考:
- https://www.jianshu.com/p/0f2fb935a9a1
- https://blog.youkuaiyun.com/weixin_42397613/article/details/114983147
- https://blog.youkuaiyun.com/weixin_39523456/article/details/113998296
阅读 6.824 Lab 1: MapReduce 的介绍,我们先把mrsequential的例子使用我们的环境运行起来
# remote server上
git clone git://g.csail.mit.edu/6.824-golabs-2021 6.824
cd src/main
# 加-gcflags的原因可以看:https://www.coder.work/article/7497554
go build -race -buildmode=plugin -gcflags="all=-N -l"../mrapps/wc.go
在我们本地的环境运行vscode,同时远程连接上remote server ,如下:

打开我们的项目,打开main/mrsequential.go文件,点击Run->Add Configuration...,设置如下的内容
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${file}",
// "program": "${fileDirname}",
"args": ["wc.so", "pg-being_ernest.txt"]
}
]
}
args里面原本应该是["wc.so", "pg*.txt"],但是vscode里面模式无法识别出来正则,就直接填入文件名就可以了
配置完成后,我们可以 Run
分布式MapReduce框架实践

本文详细介绍了一种基于MIT课程6.824的分布式MapReduce框架实现过程,从环境搭建到核心代码解析,再到测试验证,全面覆盖了MapReduce的工作原理及其实现细节。
最低0.47元/天 解锁文章
1211





