Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Cloud Computing

Similar presentations


Presentation on theme: "Introduction to Cloud Computing"— Presentation transcript:

1 Introduction to Cloud Computing
彭波 北京大学信息科学技术学院 5/25/2009 First, ask for opinions on the future of computing technology, in 5-10 years Mobile computing, grid computing, Artificial intelligence, cloud computing or something… What the computer looks like at that time How do you use your computer at that time These are interesting and challenging questions.

2 大纲 What is Cloud Computing? Build a big cloud Why we are here?
What we will get from this class? Background and our target.

3 云计算(Cloud Computing) 教学方法:故事,video,pictures  得到(隐藏的)概念,留下印象
Tell the story from SaaS PaaS Utility Computing  Cloud Computing Story about Key player’s story User experiences Slogan: Cloud Computing = 2 为什么要Cloud Computing? Some key characteristics 3.Cloud Computing面临哪些问题? 讨论,imagination for your own dream 人们的评论: positive and negative , objective 认识

4 What is Cloud Computing?
First write down your own opinion about “cloud computing” , whatever you thought about in your mind. Question: What ? Who? Why? How? Pros and cons? The most important question is: What is the relation with me? Story line:高清《云计算》最浅显解谜云故事.flv First write down your own opinion about “cloud computing” 写下来whatever you though about in your mind question: what ? Who? Why? How? Pros and cons? The most important question is : the relation with me ? Watch the video take the question and search the answer Let’s find out the key concept in the story! SaaS PaaS Utility Computing  Cloud Computing

5 Cloud Computing is… No software access everywhere by Internet
power -- Large-scale data processing Appeal for startups Cost efficiency 实在是太方便了 Software as platform Cons Security Data lock-in SaaS PaaS Utility Computing

6 Software as a Service (SaaS)
a model of software deployment whereby a provider licenses an application to customers for use as a service on demand. .vs. 传统的EULA(End User License Agreement ) Level4, Scalable, Configurable, Multi-Tenant-Efficient:增加multitier architecutre,支持load-balanced farm of identical application instances,在数量变化的多个服务器上运行。Provider按用户需求demand来增减服务器,而不需要修改任何软件的体系结构。

7 Platform as a Service (PaaS)
对于开发Web Application和Services,PaaS提供了一整套基于Internet的,从开发,测试,部署,运营到维护的全方位的集成环境。特别它从一开始就具备了Multi-tenant architecture,用户不需要考虑多用户并发的问题,而由platform来解决,包括并发管理,扩展性,失效恢复,安全。 LAMP is the industry standard But management is a hassle: Configuration, tuning Backup and recovery, disk space management Hardware failures, system crashes Software updates, security patches Log rotation, cron jobs, and much more Redesign needed once your database exceeds one box

8 Utility Computing “pay-as-you-go” 好比让用户把电源插头插在墙上,你得到的电压和Microsoft得到的一样,只是你用得少,pay less;utility computing的目标就是让计算资源也具有这样的服务能力,用户可以使用500强公司所拥有的计算资源,只是use less pay less。这是cloud computing的一个重要方面 好比让用户把电源插头插在墙上,你得到的电压和Microsoft得到的一样,只是你用得少,pay less;utility computing的目标就是让计算资源也具有这样的服务能力,用户可以使用500强公司所拥有的计算资源,只是use less pay less。这是cloud computing的一个重要方面

9 Cloud Computing is…

10 Key Characteristics illusion of infinite computing resources available on demand; elimination of an up-front commitment by Cloud users; 创业启动花费 ability to pay for use of computing resources on a short-term basis as needed。小时间片的billing,报告指出utility computing在这一点上的实践是失败的 Cloud Computing Provider需要具备的能力包括:very large datacenters, large-scale software infrastructure以及operational expertise来运行它们。这对于Google, Amazon, Microsoft, eBay这样的公司来说是必然的事。另一个重要的驱动力来自于very large datacenter比medium-sized datacenter有5-7倍的经济效益。认为构建extremely large-scale的commodity-computer datacenters是cloud computing的一个关键enabler。 very large datacenters large-scale software infrastructure operational expertise

11 Why now? very large-scale datacenter的实践, 因为新的技术趋势和Business模式
pay-as-you-go computing 伴随Web2.0的出现,过去”high-touch, high-margin, high-commitment”的服务提供开始转变为”low-touch, low-margin, low-commitment”的self-service。比如credit card在以前需要与payment processing service(VeriSign)签订合同,这对于个人和小business来说很困难。当PayPal出现时,任何个人可以用credit card来支付,不需要contract,没有long-term commitment,”touch”(客户支持和关系管理)的开销几乎没有

12 Key Players Amazon Web Services Google App Engine
Microsoft Windows Azure

13 Key Applications Mobile Interactive applications, Tim O’Reilly相信未来是属于能够实时对用户提供信息的服务。Mobile必定是关键。而后台在datacenter中运行是很自然的模式,特别是那些mashup融合类型的服务。 Parallel batch processing。大规模数据处理使用Cloud Computing技术很自然,MapReduce,Hadoop在这里起到重要作用。这里,数据移入/移出cloud是很大的开销,Amazon开始尝试host large public datasets for free。 The rise of analytics。数据库应用中transaction based应用还在增长,而analytics的应用增长迅速。数据挖掘,用户行为分析等应用的巨大推动。 Extension of compute-intensive desktop application。计算密集型的任务,说matlab, mathematica都有了cloud computing的扩展,woo~

14 Cloud Computing = Silver Bullet?
Google文档在3月7日发生了大批用户文件外泄事件。美国隐私保护组织就此提请政府对Google采取措施,使其加强云计算产品的安全性。 Problem of Data Lock-in

15 Challenges Refer [1]

16 Some other Voices The interesting thing about Cloud Computing is that we’ve redefined Cloud Computing to include everything that we already do I don’t understand what we would do differently in the light of Cloud Computing other than change the wording of some of our ads. Larry Ellison, quoted in the Wall Street Journal, September 26, 2008 It’s stupidity. It’s worse than stupidity: it’s a marketing hype campaign. Somebody is saying this is inevitable — and whenever you hear somebody saying that, it’s very likely to be a set of businesses campaigning to make it true. Richard Stallman, quoted in The Guardian, September 29, 2008

17 What’s matter with ME?! What you want to do with 1000pcs, or even 100,000 pcs? What you want to do with 100,000 pcs? It’s really possible now! Calculate Amaon EC2 service price for this:

18 Cloud is coming…

19 Build a big “Cloud” In distributed system course, we learn much to deal with how To build large scale distributed system. Can we use them to build a big cloud to became a cloud provider?

20 First let’s look inside the requirement of some emerging applications: large-scale data processing
slides borrowed from Data-Rich Computing: Where It’s At @hadoop summit 2008 Phillip B. GibbonsIntel Research Pittsburgh

21 Example: Wikipedia Anthropology
Kittur, Suh, Pendleton (UCLA, PARC), “He Says, She Says: Conflict and Coordination in Wikipedia” CHI, 2007 Increasing fraction of edits are for work indirectly related to articles Experiment Download entire revision history of Wikipedia 4.7 M pages, 58 M revisions, 800 GB Analyze editing patterns & trends Computation Hadoop on 20-machine cluster 3 slides from “Data Intensive Super Computing” Randal E. Bryant, Carnegie Mellon University

22 Example: Scene Completion
Hays, Efros (CMU), “Scene Completion Using Millions of Photographs” SIGGRAPH, 2007 Image Database Grouped by Semantic Content 30 different Flickr.com groups 2.3 M images total (396 GB). Select Candidate Images Most Suitable for Filling Hole Classify images with gist scene detector [Torralba] Color similarity Local context matching Computation Index images offline 50 min. scene matching, 20 min. local matching, 4 min. compositing Reduces to 5 minutes total by using 5 machines Extension Flickr.com has over 500 million images …

23 Example: Web Page Analysis
Fetterly, Manasse, Najork, Wiener (Microsoft, HP), “A Large-Scale Study of the Evolution of Web Pages,” Software-Practice & Experience, 2004 Experiment Use web crawler to gather 151M HTML pages weekly 11 times Generated 1.2 TB log information Analyze page statistics and change frequencies Systems Challenge “Moreover, we experienced a catastrophic disk failure during the third crawl, causing us to lose a quarter of the logs of that crawl.”

24 Let’s build a big Computer…
Given datacenter with tens of thousands of pcs, can you make all these tasks easier and run faster? Software infrastructure 的关键部件是? Distributed storage system Storage: file system or database system Programming Framework: parallel programming Challenges: scalability fault-tolerance Distributed Computing Framework

25 Challenges 大规模数据处理面临的困难 大规模PC机群scaling reliably is hard!
On 1000s of nodes MTBF < 1 day With so many disks, nodes, switches something is always broken 并行/分布式程序开发,调试is hard! 数据如何划分 任务如何调度 任务之间的通信 错误处理,容错… Storage System & Computing Framework 良好可扩展性 良好的容错能力 What have we learned to deal with these problems? replications and consistency fault-tolerance, recovery by logging & checkpoints consensus, Programming Model 一定的表达能力 很好的简单易用性

26 Cluster-Based Distributed File Systems
Observation: When dealing with very large data collections, following a simple client-server approach is not going to work. Solution 1: For speeding up file accesses, apply striping techniques by which files can be fetched in parallel: (a) whole-file distribution, (b) file-striped system

27 A natural DFS design File stripping as Chunks

28 Master of DFS 功能 问题 元数据管理
inode: file -> <filename, timestamp, size, owner, chunklist…> 运行数据管理 Chunk server info管理:map(chunk, chunkserver) Client info管理: locks, open files, etc. 问题 Performance bottleneck? Master failure? Master Recovery? A p2p(dHT) design to calculate chunk address to chunk id is very interesting. Multiple master with data space partition is scalable, but not safe and even more fragile Metadata all in memory leads to high performance, -> support less files, it that ok? But when crash, data lost is inevitable?

29 ChunkServer of DFS 功能 问题 管理chunk data: chunkid -> local file
Performance bottleneck? Chunkserver failure -> data lost? Replications is one answer

30 Review on DFS design Workload Goal Strategies 大数据 顺序读和append操作为主
Reliability, availability, scalability… Tolerance to hardware failures Managing numerous files of large size Optimizing commonly performed operations Strategies Chunk Replications (fault tolerance and performance) Large chunk size (MB) All metadata in memory on Master, with operation log

31 Data Replications in DFS
Master Chunkserver /foo/bar.dat Chunkserver Chunkserver Client Chunkserver Chunkserver Chunkserver

32 Data Mutations Two kinds of data mutations are supported Chunk A B
Random writes Record appends Leases used to maintain consistent mutation order A B Replica A B Record appends much more frequent than random writes Concurrent appends are common Replica A B

33 Primary-based Consistency Protocol
What if a mutation operation fail in the middle? Chunkserver Chunkserver Secondary replica Master Chunkserver Primary replica Chunkserver Secondary replica 并发append时,primary replica的网络带宽成为瓶颈 Any other design? 取消并发写! Chunkserver Client Chunkserver /foo/bar.dat

34 Relaxed Consistency Model
修改操作后的文件区域状态 Consistent 不管从那个replicas读,所有clients看到相同数据 Defined consistent + 所有clients看到更新操作写入的全部数据 Undefined consistent +但是可能不能反映任意一个更新操作写入的数据 Inconsistent Clients不同时间看到不同的数据 Refer to [3] GFS employs a relaxed consistency model GFS defines two types of mutations Writes cause data to be written to a specific location specified by the application Record appends cause data to be written at an offset chosen by GFS. GFS ensures that data is written atomically at least once. I will talk about the append-at-least-once semantics later. GFS’s consistency model is based on the definition of states of a file region after mutation A file region is said to be consistent if all clients see the same data, regardless which replicas they read from. In addition, if all clients see what the mutation writes in its entirety, it is defined. A file region is in undefined state if it is consistent but it doesn’t reflect what any one mutation has written Otherwise, it will be inconsistent, that is, different clients see data at different times Relaxed consistency model Two types of mutations Writes Cause data to be written at an application-specified file offset Record appends Operations that append data to a file Cause data to be appended atomically at least once Offset chosen by GFS, not by the client

35 Consistency Model (contd)
不提供完全严格的一致性[3] 由应用程序处理这种放宽的一致性下出现的inconsistent数据区域问题 提供atomic append,保证append at least once A file region can have different states. A file region is said to be in a consistent state, if all the clients see the same data irrespective of the chunkserver they read the data from. A file region is said to be in the defined state after a mutation, if all the clients see the same data, irrespective of the chunkserver they read the data from, and if the clients can see that the mutation has written in its entirety. The table shows the state of the region for the different cases. For a data write, if it is serial (i.e. only one client is writing at any time to the region) and if the write succeeds, then the region is in a defined state. In the case of concurrent writes to the region, if the write succeeds, it is in a consistent state but it is undefined, because the region would contain fragments of different writes. In the case of record appends, the state is defined in both the serial and the concurrent cases. But the defined regions are interspersed with inconsistent regions. If the mutation operation fails, the region is inconsistent. The application is supposed to take care of the relaxed consistency. The applications do this by writing self identifying records.

36 Summary for DFS Architecture: master-worker
File strip : large chunk size Scalability & Availability: Chunk replication Primary-based consistency protocol Relaxed consistency model

37 Distributed Computing
大规模机群 + 可靠存储(DFS)上怎样计算? 编程 运行 调试

38 Example: Web Page Analysis
Fetterly, Manasse, Najork, Wiener (Microsoft, HP), “A Large-Scale Study of the Evolution of Web Pages,” Software-Practice & Experience, 2004 Experiment Use web crawler to gather 151M HTML pages weekly 11 times Generated 1.2 TB log information Analyze page statistics and change frequencies Systems Challenge “Moreover, we experienced a catastrophic disk failure during the third crawl, causing us to lose a quarter of the logs of that crawl.” map on chunks (data blocks) Reduce: summary the result Independent tasks

39 A simple solution M:提取网页长度,按domain执行数据合并

40 A possible solution M: 提取网页长度,按domain执行数据合并 R: 按domain执行数据合并

41 A More difficult Problem
统计文档集中每个word出现的次数?

42 Shuffle Implementation

43 Partition and Sort Group
Partition function: hash(key)%reducer number Group function: sort by key

44 A Distributed Computing Framework
Parallel/Distributed Computing Programming Model I’m the MapReduce Framework Input split shuffle output

45 Typical problem solved by MapReduce
读入数据: key/value 对的记录格式数据 Map: 从每个记录里extract something map (in_key, in_value) -> list(out_key, intermediate_value) 处理input key/value pair 输出中间结果key/value pairs Shuffle: 混排交换数据 把相同key的中间结果汇集到相同节点上 Reduce: aggregate, summarize, filter, etc. reduce (out_key, list(intermediate_value)) -> list(out_value) 归并某一个key的所有values,进行计算 输出合并的计算结果 (usually just one) 输出结果 Outline stays the same, map and reduce change to fit the problem

46 Mapreduce Framework

47 Word Frequencies in Web pages
输入:one document per record 用户实现map function,输入为 key = document URL value = document contents map输出 (potentially many) key/value pairs. 对document中每一个出现的词,输出一个记录<word, “1”>

48 Example continued: MapReduce运行系统(库)把所有相同key的记录收集到一起 (shuffle/sort)
用户实现reduce function对一个key对应的values计算 求和sum Reduce输出<key, sum>

49 Model is Widely Applicable MapReduce Programs In Google Source Tree
Refer to [4] Example uses: distributed grep distributed sort web link-graph reversal term-vector / host web access log stats inverted index construction document clustering machine learning statistical machine translation ...

50 Algorithms Fit in MapReduce
文献中见到实现了的算法 K-Means, EM, SVM, PCA, Linear Regression, Naïve Bayes, Logistic Regression, Neural Network PageRank Word Co-occurrence Matrices,Pairwise Document Similarity Monte Carlo simulation ……

51 Capability of MapReduce
解决大部分并行计算需求的主要手段? MapReduce难于有效实现的并行算法[2] Dense/Sparse Linear Algebra N-Body Problems Dynamic Programming Graph Traversal Combinational Logic 。。。 Ucb/Eecs, K. Asanovic, R. Bodik, B. Catanzaro, J. Gebis, P. Husbands, K. Keutzer, D. Patterson, W. Plishker, J. Shalf, S. Williams, and K. Yelick, "The landscape of parallel computing research: a view from Berkeley," "The landscape of parallel computing research: a view from Berkeley," 2006

52 Google MapReduce Architecture
Single Master node Many worker bees Many worker bees How is this distributed? Partition input key/value pairs into chunks, run map() tasks in parallel After all map()s are complete, consolidate all emitted values for each unique emitted key Now partition space of output map keys, and run reduce() in parallel If map() or reduce() fails, reexecute!

53 MapReduce Operation Master informed of result locations
Initial data split into 64MB blocks M sends data location to R workers Computed, results locally stored Final output written

54 Fault Tolerance 通过re-execution实现fault tolerance
周期性heartbeats检测failure Re-execute失效节点上已经完成+正在执行的 map tasks Why???? Re-execute失效节点上正在执行的reduce tasks Task completion committed through master Robust: lost 1600/1800 machines once  finished ok Master Failure?

55 Refinement: Redundant Execution
Slow workers significantly delay completion time Other jobs consuming resources on machine Bad disks w/ soft errors transfer data slowly Solution: Near end of phase, spawn backup tasks Whichever one finishes first "wins" Dramatically shortens job completion time

56 Refinement: Locality Optimization
Master scheduling policy: Asks GFS for locations of replicas of input file blocks Map tasks typically split into 64MB (GFS block size) Map tasks scheduled so GFS input block replica are on same machine or same rack Effect Thousands of machines read input at local disk speed Without this, rack switches limit read rate

57 Refinement: Skipping Bad Records
Map/Reduce functions sometimes fail for particular inputs Best solution is to debug & fix Not always possible ~ third-party source libraries On segmentation fault: Send UDP packet to master from signal handler Include sequence number of record being processed If master sees two failures for same record: Next worker is told to skip the record

58 Other Refinements Compression of intermediate data Combiner
“Combiner” functions can run on same machine as a mapper Causes a mini-reduce phase to occur before the real reduce phase, to save bandwidth Local execution for debugging/testing User-defined counters

59 Summary CloudComputing brings How to make it real?
Possible of using unlimited resources on-demand, and by anytime and anywhere Possible of construct and deploy applications automatically scale to tens of thousands computers Possible of construct and run programs dealing with prodigious volume of data How to make it real? Distributed File System Distributed Computing Framework …………………………………

60 Q&A

61 参考文献 [1] M. Armbrust, A. Fox, R. Griffith, A. D. Joseph, R. H. Katz, A. Konwinski, G. Lee, D. A. Patterson, A. Rabkin, I. Stoica, and M. Zaharia, "Above the Clouds: A Berkeley View of Cloud Computing," EECS Department, University of California, Berkeley UCB/EECS , February [2] Ucb/Eecs, K. Asanovic, R. Bodik, B. Catanzaro, J. Gebis, P. Husbands, K. Keutzer, D. Patterson, W. Plishker, J. Shalf, S. Williams, and K. Yelick, "The landscape of parallel computing research: a view from Berkeley," [3] G. Sanjay, G. Howard, and L. Shun-Tak, "The Google file system," in Proceedings of the nineteenth ACM symposium on Operating systems principles. Bolton Landing, NY, USA: ACM Press, 2003. [4] J. D. a. S. Ghemawat, "MapReduce: Simplified Data Processing on Large Clusters," in Osdi, 2004, pp

62 Google App Engine App Engine handles HTTP(S) requests, nothing else
Think RPC: request in, processing, response out Works well for the web and AJAX; also for other services App configuration is dead simple No performance tuning needed Everything is built to scale “infinite” number of apps, requests/sec, storage capacity APIs are simple, stupid

63 App Engine Architecture
req/resp stateless APIs R/O FS urlfech Python VM process stdlib mail app images datastore stateful APIs memcache 63

64 Microsoft Windows Azure

65 Amazon Web Services Amazon’s infrastructure (auto scaling, load balancing) Elastic Compute Cloud (EC2) – scalable virtual private server instances Simple Storage Service (S3) Simple Queue Service (SQS) – messaging SimpleDB - database Flexible Payments Service, Mechanical Turk, CloudFront, etc.

66 Amazon Web Services Very flexible, lower-level offering (closer to hardware) = more possibilities, higher performing Runs platform you provide (machine images) Supports all major web languages Industry-standard services (move off AWS easily) Require much more work, longer time-to-market Deployment scripts, configuring images, etc. Various libraries and GUI plug-ins make AWS do help Use AWS if you: Want to use third party open source software Have existing code Want to transfer web app to own machine/servers later on Port code to another language Want control (EC2 instances and machine images) Ex: need to stress/load test app – just load up 1000 instances Features – messaging, payment services, etc

67 Price of Amazon EC2


Download ppt "Introduction to Cloud Computing"

Similar presentations


Ads by Google