【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 ...
随机推荐
- 你未必知道的49个CSS知识点
作者:老姚,<JS正则迷你书>的作者 https://github.com/qdlaoyao/css-gif 本文的每一条,都是我曾经发过的掘金沸点,其中有很多条超过了百赞(窃喜).鉴于时 ...
- laravel中图片的删除
laravel中图片的删除 一.总结 一句话总结: laravel里面删除的话还是建议用Storage的delete方法,不建议用原生php的unlink方法,不然没找到文件可能会报异常 二.lara ...
- peomethues 参数设置 监控网站 /usr/local/prometheus-2.13.0.linux-amd64/prometheus --config.file=/usr/local/prometheus-2.13.0.linux-amd64/prometheus.yml --web.listen-address=:9999 --web.enable-lifecycle
probe_http_status_code{instance="xxxx",job="web_status"} probe_http_status_code{ ...
- 如何贡献补丁到uboot社区?
答: 首次贡献分为两步: 1. 首先需要订阅一下,地址在此https://lists.denx.de/listinfo/u-boot,使邮箱地址对应有一个成员名称,才能向uboot社区发送补丁,否则会 ...
- Vue绑定属性 绑定Class 绑定style
<template> <div id="app"> <h2>{{msg}}</h2> <br> <div v-bi ...
- openresty开发系列24--openresty中lua的引入及使用
openresty开发系列24--openresty中lua的引入及使用 openresty 引入 lua 一)openresty中nginx引入lua方式 1)xxx_by_lua ---> ...
- Python3基础 内置函数 id
Python : 3.7.3 OS : Ubuntu 18.04.2 LTS IDE : pycharm-community-2019.1.3 ...
- 【Python】使用POST方式抓取有道翻译结果
1.安装requests库 2.打开有道翻译,按下F12,进入开发者模式,输入我爱青青,点击Network,再点击XHR 3.撰写爬虫 import requestsimport json # 使用有 ...
- pipline中执行shell脚本推送镜像并且部署
实验架构: 192.168.0.96 gitlab 192.168.0.97 jenkins 192.168.0.98 harbor.docker集群 说明:下面代码编译镜像那一步的代码必须靠左,目的 ...
- kubernetes&prometheus 【组件】
查看prometheus target页面可得组件 kube-state-metric: https://github.com/kubernetes/kube-state-metrics/blob/m ...