【MIT 6.824 】分布式系统 课程笔记(二)Lecture 03 : GFS
Lecture 03 : GFS
一、一致性
1, 弱一致性
可能会读到旧数据
2, 强一致性
读到的数据都是最新的
3, 一致性比较
强一致性对于app的写方便, 但是性能差
弱一致性有良好的性能, 并且容易延伸服务器, 但是出问题难定位
二、系统设计
1, 为什么chunks那么大
- 为了均摊费用
- 减小master的保存chunk状态 大小 (chunk handle)
2, master知道文件架构
- 对于目录, 知道什么文件在里面
- 对于文件, 知道每个64MB 的chunk 服务器
- 保存状态在内存里
- master可以恢复
- 操作日志写到磁盘
- 压缩checkpoint
- shadow master 落后master, 可以被选拔为master
3, client读过程
- 发送文件名和chunk index给master
- master恢复包含目标 chunk 的chunkserver set
- 包括chunk版本号
- client缓存上面的信息
- client询问最近的chunk server
- 检查版本
- 如果版本检查错误, 重新联系master
4, client写过程
随机client写到已存在的文件
- client询问master 目标chunk的位置 和 primary(leases 租约)
- master回复: chunk servers set、chunk 版本、并且指定谁是primary(有60s的租约)
- client计算副本的网络拓补结构
- client发送数据到第一个备份,然后由备份发送给其他备份
- 使用管道网络(pipeline network??)
- 备份确认数据回执
- client 通知primary写
- primary写
- 通知其他备份写
- 全部完成通知client
- 如果有另一个client对同一个chunk进行写,那么c1/c2会有数据冲突,但是所有的备份数据仍然相同
client 追加:
same deal, but may put parts from C1 and C2 in any order
consistent, but not defined
or, if just one client writes, no problem -- both consistent and defined
5,record append
Client record append
client asks master for chunk locations
client pushes data to replicas, but specifies no offset
client contacts primary when data is on all chunk servers
primary assigns sequence number
primary checks if append fits into chunk
if not, pad until chunk boundary
primary picks offset for append
primary applies change locally
primary forwards request to replicas
let's saw R3 fails mid-way through applying the write
primary detects error, tells client to try again
client retries after contacting master
master has perhaps brought up R4 in the meantime (or R3 came back)
one replica now has a gap in the byte sequence, so can't just append
pad to next available offset across all replicas
primary and secondaries apply writes
primary responds to client after receiving acks from all replicas
三、错误
如果master下线了 shadow master可以提供服务, 但是只能提供读操作(脑裂额综合征,导致不能写)
四、 总结
1, GFS缺陷
- master容错性差
- 小文件
- 客户端能读到旧数据
- 追加可能会有冗余
五、参考
【MIT 6.824 】分布式系统 课程笔记(二)Lecture 03 : GFS的更多相关文章
- 李宏毅老师机器学习课程笔记_ML Lecture 3-1: Gradient Descent
引言: 这个系列的笔记是台大李宏毅老师机器学习的课程笔记 视频链接(bilibili):李宏毅机器学习(2017) 另外已经有有心的同学做了速记并更新在github上:李宏毅机器学习笔记(LeeML- ...
- 【MIT 6.824 】分布式系统 课程笔记(一)
Lecture 02 Infrastructure: RPC & threads 一.多线程挑战 共享数据: 使用互斥信号量.或者避免共享 线程间协作: 使用channels 或者 waitg ...
- 李宏毅老师机器学习课程笔记_ML Lecture 2: Where does the error come from?
引言: 最近开始学习"机器学习",早就听说祖国宝岛的李宏毅老师的大名,一直没有时间看他的系列课程.今天听了一课,感觉非常棒,通俗易懂,而又能够抓住重点,中间还能加上一些很有趣的例子 ...
- 李宏毅老师机器学习课程笔记_ML Lecture 1: ML Lecture 1: Regression - Demo
引言: 最近开始学习"机器学习",早就听说祖国宝岛的李宏毅老师的大名,一直没有时间看他的系列课程.今天听了一课,感觉非常棒,通俗易懂,而又能够抓住重点,中间还能加上一些很有趣的例子 ...
- 李宏毅老师机器学习课程笔记_ML Lecture 1: 回归案例研究
引言: 最近开始学习"机器学习",早就听说祖国宝岛的李宏毅老师的大名,一直没有时间看他的系列课程.今天听了一课,感觉非常棒,通俗易懂,而又能够抓住重点,中间还能加上一些很有趣的例子 ...
- 李宏毅老师机器学习课程笔记_ML Lecture 0-2: Why we need to learn machine learning?
引言: 最近开始学习"机器学习",早就听说祖国宝岛的李宏毅老师的大名,一直没有时间看他的系列课程.今天听了一课,感觉非常棒,通俗易懂,而又能够抓住重点,中间还能加上一些很有趣的例子 ...
- 李宏毅老师机器学习课程笔记_ML Lecture 0-1: Introduction of Machine Learning
引言: 最近开始学习"机器学习",早就听说祖国宝岛的李宏毅老师的大名,一直没有时间看他的系列课程.今天听了一课,感觉非常棒,通俗易懂,而又能够抓住重点,中间还能加上一些很有趣的例子 ...
- 深度学习课程笔记(十二) Matrix Capsule
深度学习课程笔记(十二) Matrix Capsule with EM Routing 2018-02-02 21:21:09 Paper: https://openreview.net/pdf ...
- 深度学习课程笔记(二)Classification: Probility Generative Model
深度学习课程笔记(二)Classification: Probility Generative Model 2017.10.05 相关材料来自:http://speech.ee.ntu.edu.tw ...
随机推荐
- Linux下DM无法显示建模界面的解决方法
方法来源: http://www.linuxhospital.com/read/unable-to-resolve-function-glxqueryextension-in-hyperview.ht ...
- redis 业务锁 not exist 模式
背景: 业务核心模块只能提交一次,原实现方案 前端加提交限制.后端加数据库业务逻辑判定,结果失效,api站点部署多台负载,切方法需要强求第三方接口 响应时间较慢 ,故放弃lock. 解决方案:redi ...
- T-MAX-冲刺总结
T-MAX-冲刺总结 这个作业属于哪个课程 班级链接 这个作业要求在哪里 作业要求的链接 团队名称 T-MAX 这个作业的目标 冲刺总结 作业的正文 T-MAX-冲刺总结 其他参考文献 面向B站,百度 ...
- QT中显示动画
在QT中要显示GIF图片,不能通过单单的添加部件来完成.还需要手动的编写程序.工具:QT Creator新建一个工程,我们先在designer中,添加一个QLabel部件. 将QLabel拉成适当大小 ...
- Cesium 禁止相机进入地底下[转]
原文:https://blog.csdn.net/thor027/article/details/82455649 viewer.clock.onTick.addEventListener(funct ...
- Tensorflow 2 Cifar10离线数据集手动下载、离线安装、本地加载、快速读取
Tensorflow 2 Cifar10离线数据集手动下载.离线安装.本地加载.快速读取 商务合作,科技咨询,版权转让:向日葵,135-4855__4328,xiexiaokui#qq.com 查 ...
- You are using the runtime-only build of Vue where the template compiler is not available. Either pre
在升级脚手架到vue-cli3.0版本的时候出现了这个报错: [Vue warn]: You are using the runtime-only build of Vue where the tem ...
- redis-cli 使用密码登录
#./redis-cli 输入auth +空格+ 刚才设置的密码 成功
- iptables规则保存
/etc/init.d/iptables save #查看 vim /etc/sysconfig/iptables #将iptables设置为开机启动 chkconfig iptables on #查 ...
- osg include lib -computer1
E:\\OpenSceneGraph\\OpenSceneGraph_3_6_install\\lib E:\\OpenSceneGraph\\3rdParty\\v140-x64\\lib Open ...