-
2008-10-03
Self-service, Prorated Super Computing Fun!
As part of eliminating TimeSelect, The New York Times has decided to make all the public domain articles from 1851-1922 available free of charge. These articles are all in the form of images scanned from the original paper. In fact from 1851-1980, all 11 million articles are available as images in PDF format. To generate a PDF version of the article takes quite a bit of work — each article is actually composed of numerous smaller TIFF images that need to be scaled and glued together in a coherent fashion.
Previously we had generated all the PDFs dynamically. This approach had worked reasonably well, but with the strong possibility of a significant traffic increase we started to rethink things. Clearly, pre-generating all the articles and statically serving them would be a great option. Pretty quickly I thought about how we could do this (and have some fun along the way, but beware — my idea of fun is probably radically different from that of most people).
I had been using Amazon S3 service for some time and was quite impressed. And in late 2006 I had begun playing with Amazon EC2. So the the basic idea I had was this: upload 4TB of source data into S3, write some code that would run on numerous EC2 instances to read the source data, create PDFs, and store the results back into S3. S3 would then be used to serve the PDFs to the general public. It all sounded pretty simple, and that is how I got the folks in charge to agree to such an idea — not to mention that Amazon S3/EC2 is pretty easy on the wallet.
The code to generate the PDFs was fairly straightforward, but to get it to run in parallel across multiple machines was an open issue. Being a voracious reader of all kinds of blogs, I had come across and read the MapReduce paper from Google several years ago (it made me weep). I also knew about Hadoop, the open source implementation of the MapReduce idea. Given all these parts, I had a rough idea of how I could make all this work.
I quickly got to work copying 4TB of data to S3. Next I started writing code to pull all the parts that make up an article out of S3, generate a PDF from them and store the PDF back in S3. This was easy enough using the JetS3t — Open Source Java toolkit for S3, iText PDF Library and installing the Java Advanced Image Extension.
Once the basic code was up and running, I set about learning the intricacies of Hadoop. The Hadoop documentation is pretty sparse but helpful enough. I was able to create a Hadoop cluster on my local machine and wrap my code with the proper Hadoop semantics. After a bit more tweaking and bug fixing, I was ready to deploy Hadoop and my code on a cluster of EC2 machines. For deployment, I created a custom AMI (Amazon Machine Image) for EC2 that was based on a Xen image from my desktop machine. Using some simple Python scripts and the boto library, I booted four EC2 instances of my custom AMI. I logged in, started Hadoop and submitted a test job to generate a couple thousands articles — and to my surprise it just worked.
I then began some rough calculations and determined that if I used only four machines, it could take some time to generate all 11 million article PDFs. But thanks to the swell people at Amazon, I got access to a few more machines and churned through all 11 million articles in just under 24 hours using 100 EC2 instances, and generated another 1.5TB of data to store in S3. (In fact, it work so well that we ran it twice, since after we were done we noticed an error in the PDFs.)
Honestly, I had a couple of moments of panic. I was using some very new and not totally proven pieces of technology, on a project that was very high profile and on a inflexible deadline. But clearly it worked out, since I am still blogging from open.nytimes.com.
Now that this adventure can be called a success, I can’t imagine how we might have done it without Amazon S3 / EC2 . The one caveat I will offer to people who are interested in doing something like this is that it is highly addictive. We have already completed the S3 / EC2 portion of another project and I have ideas for countless more.
With the 1851-1922 articles now free, you can see what kind of computer
was desired in 1892: “Computer Wanted”from : http://open.blogs.nytimes.com/2007/11/01/self-service-prorated-super-computing-fun/
-
2008-10-03
云计算泄露Google的秘密
今年4月,美国华盛顿州一个农业小镇昆西忽然喧嚣起来,原来这里要兴建7个足球场大小的超大 型农场,只不过它不是用来圈养牲畜的,而是微软可以承载数十万台服务器的服务器农场。这个耗资数亿美元的数据中心将确保微软应对来自Web服务的挑战。无 独有偶,尽管互联网企业Google和雅虎早已有了庞大的数据中心,但是现在也正耗费巨资建立一系列数据中心。10月,IBM与Google达成协议,共 同出资建立一个供云计算(Cloud Computing)研究的大型数据中心。为什么全球IT巨头都在同一时间开始打起数据中心的主意?
看看亚马逊去年推出的弹性计算云服务。由于它可以让小型企业按照自己的需要购买亚 马逊数据中心的处理能力,受到了用户的大力追捧:以EC2为基础的云存储S3在不到一年的时间里,就已经存储了50亿个对象。受S3的刺激,今年,云存储 服务之战再度升级,Google、微软和苹果都在近期推出了这一服务,希望在亚马逊独大的市场中分流更多用户,以便扩大广告受众。更多的企业和个人选择通 过Web服务共享大型数据中心的资源,这已经成为不可逆转的趋势,但问题是,以Web服务为导向新建的数据中心应该是什么样的?
何以成为趋势
支持云计算,只有这样的数据中心才能承担层出不穷的Web应用。其实,云计算就是 Google数据中心得以处理互联网服务的技术秘密,而Google的搜索引擎就是云计算初期的服务产品,现在的云存储以及未来更多形式的Web新应用将 使云计算成为Web时代的新型计算语言。
那么,神秘的云计算究竟是什么?IBM高性能随需解决方案团队副总裁Willy Chiu近日接受记者采访时表示,云计算能够使计算分布在大量的分布式计算机,而非本地计算机或远程服务器农场上,这使得企业数据中心的运行与互联网计算 模式相似。而满足云计算的数据中心足以应对互联网规模的计算挑战,往往在分秒之间就能处理超大规模的数据流量。通过与网格计算的对比,Willy Chiu形象地解释了云计算的秘密。金融机构利息计算可用来解读网格计算:由于计算利息的公式一定,因此可以按照数据库的参数分配计算任务,采用多态模拟 的方式,以重复的形式进行分布式计算,最后将各个计算任务整合起来得到最终计算结果。而搜索引擎计算用来解读云计算再合适不过:网页的变更通常大量而复 杂,但云计算可很容易地处理海量数据,它不仅可以将搜索任务切分为多个小的任务模块执行,而且单个任务模块可以采用不同的算法,这样的计算结果集合就是搜 索结果。
由此看来,云不仅仅是计算机资源的简单汇集,因为其提供了一种管理这些资源的机 制,管理包括资源提供、变更请求、重新映像、工作负载重新平衡、资源解除提供和资源监测。从某种意义上说,云计算更像是网格计算的升级,但它的最大魅力就 在于,在这种计算模式下,计算业务将不再局限于个人桌面和企业计算中心,而可以成为一种依托于互联网处理的服务。
让云计算落地
如果说大型互联网企业是云计算最早的需求者与推动者,那么,越来越多的非互联网用户 也开始遭遇互联网企业当初的问题:不仅效率、能耗和管理成本不能满足需求,他们还开始大量采用类似互联网企业的业务,如电子商务、内部门户、虚拟世界等 等。让更多用户真正享用云计算的任务落在了关注数据中心的系统企业肩上:这些用户什么时候也可以像亚马逊、Google等互联网巨头那样,运行和管理自己 的数据中心呢?
11月15日,IBM率先出台了蓝云(Blue Cloud)计划,而它的目标就是为企业带来即可使用的云计算。蓝云基于由IBM软件、系统技术和服务支持的开放标准和开源软件,它包括一系列的云计算产 品,使计算不仅仅局限在本地机器或远程服务器农场,而是通过架构一个分布的、可全球访问的资源结构,使数据中心在类似互联网的环境下运行计算。
即可使用也意味着对于广大企业来说,云计算不再只是概念。据悉,在计划出台当 天,IBM就在上海演示了运行在配置Power和x86处理器的IBM BladeCenter上的云计算技术,当时的演示任务是随着某一应用工作负载的变化,如何动态地提供和分配资源。而第一套支持Power和x86处理器 系统的蓝云产品将于明年春季正式推出,IBM还计划于明年提供一个System z大型主机云环境,以充分利用System z支持的超大数量虚拟机的能力。同时,IBM还计划提供基于高密度机架集群的云环境。据Willy Chiu透露,大多数服务器产品上都将升级为支持蓝云的产品,而通过服务和软件部门的协作,蓝云可以渗透到IBM的软件、硬件以及服务之中。
IBM已经在自己企业内部实现了云计算应用试点,同时IBM还选定了一批涉及金融 服务、政府、电信等多个行业的用户,将于近期合作展开云计算的升级计划。据悉,目前,第一个吃螃蟹的用户是越南科技部。就在11月13日,双方已经共同宣 布了一项将运行在云计算基础架构上的开放创新试点计划。
IT天空多“云”
可以看出,IBM已经将云计算作为重要的战略方向。IBM全球高级副总裁 Zeitler甚至将IBM蓝云计划的重要性与IBM在7年前对Linux的支持相比拟。目前,全球有超过200名的IBM研究人员参与开发蓝云计 划,Zeitler近日还表示,在今后三年的阶段规划中将投入巨资来实施蓝云计划。尽管他没有透露具体资金数目,但是将几乎所有服务器、软件以及服务都能 做到支持蓝云绝对是一项浩大的工程。
当然,看重企业内部计算大规模转移到云计算的系统级企业并非只有IBM一家。例 如,戴尔在今年3月成立了新业务部—数据中心解决方案部门,而它推出的第一项服务就是云计算解决方案。Sun也在前不久推出了移动数据中心—可以装在集装 箱里的Sun Black Box,里面满满当当地放置了252台Sun服务器。除了移动的特色之外,它也将在云计算中发挥重大作用。因为Sun认为,未来PC、手持设备、iPod 等无数终端设备都将简单地接入到在线应用,这正是云计算的体现。此外,Sun还提供租赁主机的服务来帮助用户实现云计算。
由此可见,蓝云产品与Sun Black Box都是将系统的占用空间、经济性、能耗量、计算性能当作一个综合的整体来考虑,把服务器、存储设备、网络设备、操作系统、中间件等软硬件都集成在一起 的IT基础设施管理起来。同时,通过实时监控高效计算资源利用情况,向着使用户像使用水电等资源一样使用IT设施的目标又迈进了一步。不过,IBM并没有 相关的租赁服务计划推出。Willy Chiu认为,这是为了防止因租赁相关服务而造成商业机密泄露等安全问题。谈到与Sun Black Box在技术思路上的区别时,Willy Chiu认为,蓝云面向主流商业性客户普及互联网计算技术,其核心竞争力包括:更为开放,支持开源系统;高层次地实现虚拟化技术;具备自动配置能力;提供 企业级安全的互联网计算能力。也许用户不愿意全部服务器都使用同样的操作系统,而IBM的蓝云产品通过API接口可以实现较大的开放性。
随着支持云计算的产品和方案的陆续落地,非互联网型企业也将享用这一技术,明年也许可以被称为云计算的应用元年。
蓝云架构什么样?
云计算既描述了一种平台,又描述了一类应用。一个云计算平台能够根据需要动态地提供、配置、再配置和解除提供服务器。而云应用则是那些经过扩展能够通过互联网访问的各种应用,这些云应用运行在那些托管Web应用和Web服务的大型数据中心及功能强大的服务器上。
IBM开发蓝云的目的,是帮助用户充分利用云计算,包括云应用的能力,通过基于 SOA的Web服务,与现有的IT基础架构集成。蓝云将特别关注IT管理简化方面的突破性需求,以保证安全性、隐私性、可靠性、高使用率和高效率。另外, 云计算主要针对现有的和即将出现的大规模数据密集型工作负载。
IBM的蓝云计算平台由数据中心、IBM Tivoli配置管理器、IBM Tivoli Monitoring、IBM Websphere应用服务器、IBM DB2和虚拟组件构成。所有的请求都由Web 2.0组件来处理。然后转发到Tivoli配置管理器,进行服务器的分配或解除分配。
IBM蓝云计算平台架构
基于开源Linux和Xen的虚拟化基础架构
from: http://media.ccidnet.com/art/2619/20071123/1285245_1.html







