1. Trang chủ
  2. » Công Nghệ Thông Tin

MySQL High Availability- P11

50 319 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 50
Dung lượng 1,15 MB

Nội dung

CHAPTER 14 Cloud Computing Solutions Joel pushed his office door partially closed while he hung his jacket on the hook on the back of the door. He jumped at the sound of knuckles rapping on his door. “Come in,” he said, as he pulled the door open and walked over to his desk. When he turned to face his visitor, he knew who it was. “Mr. Summerson. Good morning, sir.” “Good morning, Joel. Nice work on that report about high availability and scale-out. I especially like your recommendations on how we can improve throughput for some of our products.” “Thanks.” Joel held his breath, waiting for the tasking he knew was sure to come. “Last night the board and I signed a contract to customize one of our products for a new customer. The ink isn’t dry on the contract, so I won’t go into any details, but suffice it to say we will need a lot of new servers in a high availability setup. Of course, they’ll be using MySQL for the database component.” Joel tried to remember all the details he’d read about MySQL high availability, won- dering how much money he’d need to set up a host of servers. He snapped out of his thoughts as his boss continued, “ . then there’s that stuff about load balancing.” After an uncomfortable pause, Joel said, “Yes, sir.” “The problem is we don’t have resources to buy a bunch of servers, and the contract is for a six-month period of service. The board will never approve spending a bunch of money on new hardware that we may not need after the contract expires. Not to men- tion the dent to our profit margin.” Joel didn’t know what to say, so he simply waited. “So, we’d like you to put together a cloud-based solution.” With that, Mr. Summerson patted Joel on the shoulder and left. Joel stood for several moments before walking behind his desk and sitting down. Joel considered himself informed about emerging technologies, but he’d figured the cloud computing stuff was as fluffy as its namesake. He picked up his dog-eared MySQL book and flipped to the next chapter. “Well, look at that,” he said, starting to read. 477 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. The demands of today’s economy present new challenges as well as potentially new solutions for information infrastructure planners. No longer can organizations afford to simply buy more hardware every time they need to add computing power. While the cost of computing hardware has gone down over the last decade, so too have or- ganizations’ profit margins, particularly of late. Thus, organizations must make decisions with a much stronger fiscal burden and look for the most affordable services and tools to increase their customer bases by expanding their product lines while reducing costs and increasing profits. It is all about the money, after all. This need for affordable computational solutions has led technology providers to create a new way to use computers using a pay-as-you-use philosophy that allows organiza- tions to purchase computational and data usage on an ad hoc basis. This is the essence of what computer scientists describe as cloud computing. What Is Cloud Computing? Cloud computing is one of those phrases that is often misunderstood and unfortunately has several—and sometimes conflicting—definitions. Some are quick to say it’s a buzzword that describes existing technologies, while others would rather debate the finer academic and scientific (and sometimes social) aspects, and still others insist cloud computing is the future of information technology. Thus, some have flatly stated that cloud computing is nothing more than grid com- puting, while others suggest cloud computing could represent the entire Internet. Both views are flawed. Others will explain in detail all aspects of “as a service” concepts and use those to define cloud computing. Fortunately, these more nuanced views are much closer to the truth. Cloud computing is essentially a remix of a group of technologies that include grid computing and virtualization combined with application programming interfaces (APIs) and utilities to supply access to the virtualized environments. In his book Cloud Computing Architectures (O’Reilly, http://oreilly.com/catalog/9780596156374), George Reese states, “There is nothing fundamentally new in any of the technologies that make up cloud computing.” This is a sobering observation that some pundits and marketers would rather not face. However, the advancement comes in the packaging, through which giants like Amazon have made it possible to use existing technologies in a whole new way. In his treatise “15 Ways to Tell It’s Not Cloud Computing,” James Governor makes some strong statements concerning what is and what isn’t cloud computing. To para- phrase his arguments, Governor makes it clear that cloud computing isn’t something that takes a long time to explain, has a complex and steep learning curve, is isolated or requires a dedicated connection to use, or requires you to purchase hardware. Whether you agree with him or not, he forces patrons of companies trying to rebadge their 478 | Chapter 14: Cloud Computing Solutions Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. products with the word “cloud” in them to consider their purchases carefully because the cloud isn’t what most people think it is. The term “cloud computing” is derived from the conceptual drawing that depicts re- sources hosted in a large network (a cloud). We use a cloud symbol because the resource implementation (e.g., the hardware, operating system, etc.) is hidden and has little bearing on what the service is or what it provides—it is simply a service you can use. Thus, instead of seeing gateways, routers, and servers, you see the resources presented as a service. Consumers of the resources don’t care how the service is implemented; of overarching importance is for the service to solve the need and be available when required. Rather than say “cloud computing is many things to many people,” the National In- stitute of Standards and Technology (NIST) defines cloud computing as follows: Cloud computing is a model for enabling convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, servers, storage, ap- plications, and services) that can be rapidly provisioned and released with minimal man- agement effort or service provider interaction. This cloud model promotes availability and is composed of five essential characteristics, three service models, and four deploy- ment models. The characteristics that most cloud researchers define as essential to cloud computing include the following: On-demand self-service Customers can pick and choose what they need on an ad hoc basis without inter- vention of the vendor or a third party. Broad network access The resources are available through existing networking capabilities. Resource pooling Multiple users share the provider’s hardware (e.g., a multitenant sharing model). Rapid elasticity Customers are able to rapidly scale resources either manually or automatically. Measured service Services for resource monitoring and management are provided, either actively or passively (see Chapter 10). The three service models are: Infrastructure as a Service (IaaS) Resources are provided as virtual instances of complete hardware or operating system platforms. The client can add virtualized computational resources on de- mand (e.g., servers, load balancers). Thus, the components of an information in- frastructure are provided as components or middleware. The consumer has access to and control of the resources (e.g., the customer can manage an allocated server). What Is Cloud Computing? | 479 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Platform as a Service (PaaS) An API allows clients to create applications designed specifically to run on the provider’s hardware (platforms). The vendor provides the hosting environment and programming tools to permit customers to build solutions for the specific environment. Software as a Service (SaaS) Software is provided as a resource in the form of applications that run on the pro- vider’s hardware. The consumer sees only the interface to the software, just like with a desktop application. The hardware, operating system, etc., are all hidden and controlled exclusively by the vendor. This is the oldest model currently inclu- ded in definitions of the cloud, and for many decades it was known as an Appli- cation Service Provider (ASP). The deployment models refer to the availability or accessibility of the resulting solutions and include: Private Access to resources is limited to the customer only. Community Access to resources is shared among one or more customers. Public Access to resources is available to the general public. Hybrid This is an infrastructure composed of two or more of the other models. Typically, this results in a division of private and public resources that can communicate. A document with a complete discussion of the NIST’s view of cloud computing is located at http://csrc.nist.gov/groups/SNS/cloud-computing/. Cloud Architectures In this section, we will briefly examine the underlying technologies commonly used in cloud computing. You will find that most cloud computing solutions employ most if not all of these technologies: • Virtualization • Grid computing • Transactional computing • Elasticity • Software libraries 480 | Chapter 14: Cloud Computing Solutions Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Virtualization There are many forms of virtualization. If you have ever used Sun’s VirtualBox or Mi- crosoft’s VirtualPC, you have used a form of virtualization. In essence, this technology creates a pseudoplatform based on a conceptual computing hardware model. For ex- ample, it is possible to run an instance of the Microsoft Windows operating system on a Linux machine inside VirtualBox. VirtualBox creates a software-based model of each component in a PC. These form a foundation upon which Windows can boot and run as if it were on real hardware. This is just one form of virtualization. There are several mechanisms for simulating the hardware, as well as optimizations for launching, execution, and management of in- stances. The virtualization used in most IaaS solutions requires you to use prepackaged machines (called images), where each virtual machine is called an instance of an image. For example, the Amazon cloud uses Xen virtualization technology, an open source and common solution that permits scaling of the virtualized hardware (e.g., the number of CPUs), fault tolerance, and other advantages. Furthermore, some vendors let you modify existing images to customize machines to your needs, using either vendor-specific tools or a machine description in a specific format. This can be an issue if you decide you want to move from one vendor to another: your images may not be portable. You should check the vendor’s documentation about images and customizing images before you invest a lot of time and effort in this solution. Grid computing In the days when computing power was limited and the need to solve complex analytical or scientific problems was great, a technology that allowed programs to share extra computing power among a community of connected machines was invented and termed grid computing. It works by breaking a problem down into smaller computa- tional units that can be shipped to other machines for processing, then retrieving the results and correlating them on one machine. The key technology that permits these machines to communicate is a sophisticated queuing mechanism. This queuing mechanism is like a workflow and can be demon- strated as follows. A data manager machine delegates jobs and their data to slave machines and then reads their results. This involves setting up one or more queuing machines that send the processing job to any connected computers and then return their results to the data manager. When a user wants to participate in a grid computing program, he first connects his donor computer to a queuing machine and issues a pull of the processing package (a job plus data). His machine executes the job and sends the results to the queuing machine. A simplified example of this process is shown in Figure 14-1. What Is Cloud Computing? | 481 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Queuing systems are also present in cloud computing. Thus, it is possible to migrate existing grid computing solutions or build new grid computing solutions in cloud computing. This capability is why some insist cloud computing is simply grid computing with virtualization. But as you will see, there is far more to cloud computing than just these two technologies. Transactional computing Transactional computing is familiar to database users: multiple segments of data are processed together as a single transaction and correlated with other data. The idea is to define a job to include particular data and perform some action on that data as a single step (transaction). The best grid computing solutions use this concept to ensure proper delivery of the results. However, cloud computing is a bit more complicated. Specifically, large transactional applications are intended to be running for a long period of time, whereas grid solutions have very small execution times. The good news is that it is possible to build a transactional computing system in the cloud. To do so, we must ensure the longevity of the computing resources and provide mechanisms to allow the data to be segmented and processed in parallel. If you’re thinking, “Hey, this sounds like server farms,” you are correct. Most cloud computing vendors provide virtualized resources to support a transactional computing solution including load balancers, persistent instances, and permanent assignment of network- ing resources. Elasticity Elasticity is a term we use to describe an abstraction of a networking or system resource that has been made a commodity. For example, Amazon allows you to apply a given IP address to any instance of a server in its cloud. This takes on great importance in transactional systems, where you need a pool of servers that answers to a particular address. While it is fine to virtualize the servers so that they can run anywhere in the cloud, you must have a way to ensure that the IP address remains constant. Figure 14-1. Grid computing workflow 482 | Chapter 14: Cloud Computing Solutions Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. In this case, the IP address becomes an elastic resource that you can assign to any instance you want. It isn’t tied to a particular machine. Similarly, disk resources can be elastic, so you can store your data on a disk resource and make it accessible to any running instance in the cloud. Elasticity solves the problem of running virtualized machines in a pooled hardware configuration. The machines become truly plug-and-play and you can easily create and destroy them. For example, you can swap a machine running one operating system for another during development and (perhaps with a few minor changes) still access the same data—no need to build a whole new database. Software libraries You may be wondering how all of these technologies tie together and how it is possible to work with resources in a dynamic environment. The answer is that most cloud ven- dors have a specific set of tools for creating and manipulating resources in the cloud. For example, Amazon has tools on its APIs for managing your resources, creating in- stances, creating volumes (disk objects), and much more. These encompass the Ama- zon EC2 API Tools for working with cloud resources as well as Amazon EC2 AMI (Amazon Machine Image) Tools for creating and modifying machine images. Similarly, Microsoft Azure has extensions to the .NET development environment to permit you to build your cloud applications and run them in the Azure cloud. The resemblance ends here, though, because the Microsoft Azure environment also requires you to build your applications with these libraries, whereas Amazon does not. Thus, software libraries form the glue that allows all of these existing technologies to work together and become something greater than their parts—a cloud computing environment. Is Cloud Computing an Economical Choice? There are analysts and pundits on both sides of this question. The bottom line is: it depends. That is, it depends on which cloud provider you use, how many servers you need (measured in computation time), how much space you need, and for how long. One comparative study shows that the cost of a cloud solution versus a traditional solution (buying your own hardware) for a typical e-commerce situation over a period of five years comes out only slightly in favor of cloud computing. You could see this as evidence that cloud computing doesn’t offer much of a savings, and on the surface you’d be correct. However, the details of the study show the initial investment for the traditional solution to be very high. While it is true at the end of five years an organization owns its own hardware (or amortizes it to the point of obsoles- cence), the hardware in the cloud is of no concern because it is not a factor in the cost. That is, there are no recurring costs for equipment upgrades when using a cloud-based What Is Cloud Computing? | 483 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. solution. The study does not include this cost in the comparison and if it did, it is likely that the difference in expenditures over five years would be considerably higher for the traditional solution. In order to answer the question of whether cloud computing is economical, you have to do your homework. The cost factor will be different for each organization and for each project. The best way to analyze this cost is to determine (or estimate) the number of servers, how much data you will need to store, how much data will be moved around in the cloud, and which additional features you need (VPN, load balancing, etc.). Spe- cifically, you need to examine the billable components of the cloud computing vendor and estimate the cost based on those parameters. Once you have that, you can deter- mine the costs for a traditional solution, factoring in maintenance and upgrades, and then make a fair comparison. Many clients use cloud computing not to save money, but for its flexibility. We’ll dis- cuss why it can be a valuable solution in the following section. However, there are some organizations that view the use of cloud computing as pro- hibited either by policy or fear. For example, some organizations do not allow storage of their private data on systems that they do not own and that (conceivably) some administrator outside of the organization (i.e., one of the cloud vendor’s employees) could use to gain access to the data. If you find yourself facing these demons, you should contact the cloud vendor and discuss your concerns and weigh the risks accordingly. One way to overcome this limitation is to segregate your data and use the cloud for public data only. Also, in the case of Amazon Web Services (AWS), the cloud vendor may have features that permit you to isolate your cloud instances or connect them via a VPN to your own IT infrastructure (see http://aws.amazon.com/vpc/ for more details on Amazon’s VPN Cloud offering). Cloud Computing Use Cases Now that you have a good understanding of what cloud computing is, let’s examine what you can do with it. All manner of organizations have found new and exciting uses for cloud computing. These include start-up companies looking for an inexpensive entry into the market, researchers who need computational power for a limited time, and information technology managers who feel the budget crunch but must still meet the needs of their users. In this section, we discuss some common use cases for em- ploying cloud computing: Traditional web services Cloud resources supply content or applications to users on the Internet. Shared services One or more applications run in the cloud and are shared by different users. An example is an application that allows partners to collaborate and share data (e.g., a supply chain). 484 | Chapter 14: Cloud Computing Solutions Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Scale-out from enterprise This allows rapid expansion of an application using solutions that run in the cloud and connect to the enterprise. Cloud bursting This allows users to deploy temporary resources quickly to solve immediate, short- term computational tasks. Research and development This allows developers to explore multiple system and application configurations without the need for dedicated hardware. As you can see, there are many ways to use cloud computing, and more uses are being discovered every day. What we’ve seen in the field so far is just a start to the possibilities. Cloud Computing Benefits The potential benefits of cloud computing include: Reduced runtime and response time By leveraging grid or scale-out techniques, it is possible to reduce the amount of time a task takes to complete and even improve data access time dramatically. You can use hardware-based solutions for similar effects, but at a severe investment cost. Cloud solutions allow you to generate as many machine instances as you need and pay only for what you use. Minimize infrastructure risk and maintenance Hardware failure is no longer your responsibility. The vendor owns and maintains the machines that run the cloud systems, so you do not require a large staff or investment in service providers. Lower cost of entry With the ability to pay for only what you use, you no longer have to budget for a large infrastructure that you may or may not use. Best of all, you can grow your infrastructure on the fly and, better still, reduce it without having to amortize the hardware or declare it surplus. Increased pace of development The lower cost of entry and the ability to pay only for what you need means you can get a new application started with far less investment than in the past (on your own or using a service provider’s hardware). This has the side effect of leveling the field for start-up companies, allowing them to compete early in their development. Of course, for each advantage there is a corresponding drawback. Some of the potential risks of cloud computing are: Cloud Computing Benefits | 485 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Service failure Service level agreements (SLAs) tend to be poorly defined (or nonexistent) in the cloud computing field, and if your underlying service is unreliable, you have little recourse. Potential runaway costs If you experience an unusually heavy load and scale up to meet it, you may succeed in meeting the need, but incur high usage costs in doing so. Lack of features You may decide at some point that you need to implement a feature in your ar- chitecture or application that the vendor doesn’t support. Security risks You are sharing machines with other users, and software flaws can allow data to be leaked or stolen. Cloud Computing Vendors Whenever there is an emerging technology, there is inevitably an explosion of vendors, products, and services that all claim in one form or another to provide the new tech- nology. Cloud computing is not immune to this phenomenon. There are hundreds of vendors that provide everything from specialized hardware, software services, and platforms to turnkey pick-and-pay portfolios. If you use the NIST definition presented in “What Is Cloud Computing?” on page 478, you’ll quickly find that many vendors aren’t meeting all of the tenets of the definition. However, there are a number of vendors that are striving to meet the full definition for cloud computing. The following list names 10 of the top vendors, along with a brief description of the type of solutions each provides: 3Tera An IaaS provider specializing in rapid scale-out capabilities Akamai An IaaS provider specializing in managing data on the Web Amazon A cloud computing vendor offering virtualized SaaS, PaaS, and IaaS solutions along with storage solutions Enki Consulting An IaaS provider specializing in virtual private data center solutions IBM Blue Cloud A cloud computing vendor offering virtualized SaaS, PaaS, and IaaS solutions Joyent An IaaS provider specializing in the needs of large enterprises 486 | Chapter 14: Cloud Computing Solutions Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. [...]... support MySQL: Chucks-MacBook-Pro:~ Chuck$ ec2-describe-images -o self -o amazon | grep mysql IMAGE ami-225fba4b ec2-public-images/fedora-core4-apachemysql-v1.07.manifest.xml amazon available public i386 machine instance-store IMAGE ami-25b6534c ec2-public-images/fedora-core4-apache -mysql manifest.xmamazon available public i386 machine instance-store IMAGE ami-255fba4c ec2-public-images/fedora-core4 -mysql- v1.07... 420 GB plus 10 GB root partition) 64-bit High c1.xlarge High- memory extra large 6.5 EC2 CU (2 virtual cores with 3.25 EC2 CU each) 17.1 GB 420 GB instance storage (1 × 420 GB) 64-bit Moderate m2.xlarge High- memory double extra large 13 EC2 CU (4 virtual cores with 3.25 EC2 CU each) 34.2 GB 850 GB instance storage (1 × 840 GB plus 10 GB root partition) 64-bit High m2.2xlarge 490 | Chapter 14: Cloud Computing... 420 GB plus 10 GB root partition) 64-bit High m1.large Extra large 8 EC2 CU (4 virtual cores with 2 EC2 CU each) 15 GB 1690 GB instance storage (4 × 420 GB plus 10 GB root partition) 64-bit High m1.xlarge High- CPU medium 5 EC2 CU (2 virtual cores with 2.5 EC2 CU each) 1.7 GB 350 GB instance storage (340 GB plus 10 GB root partition) 32-bit Moderate c1.medium High- CPU extra large 20 EC2 CU (8 virtual... Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark Type CPU Memory Local storage Platform I/O Name High- memory quadruple extra large 26 EC2 CU (8 virtual cores with 3.25 EC2 CU each) 68.4 GB 1690 GB instance storage (2 × 840 GB plus 10 GB root partition) 64-bit High m2.4xlarge Amazon bills you based on the computational hours during which you’ve reserved your virtual machine, using... much easier For instance, you can load up a prebuilt AMI that runs a Linux, Apache, MySQL, PHP/Perl/Python (LAMP) stack Amazon S3 Also in 2006, Amazon created S3 as its premier online storage web service S3 provides developers with easy, secure, persistent online storage offering essentially unlimited capacity At a high level, S3 is similar (at least in concept) to a storage area network (SAN) in that... the last snapshot are saved Point-in-time snapshots provide an effective and efficient way to create durable backups, especially for your MySQL databases With all the capability of a normal disk and much more, EBS volumes are the perfect solution for storing your MySQL database files You get snapshotting and similar backup capabilities, and the sustainability is unparalleled How Does It All Work? Before... software Make sure you’re using a free AMI to avoid extra charges, or check the price of the AMI before using it Since you are working with MySQL, it is a good idea to choose the image labeled LAMP Web Starter, since it has everything you need to get started using MySQL in the cloud At this time, the LAMP stack is running on a Fedora host Figure 14-6 shows the dialog for choosing an image Figure 14-6... feature in building highly available cloud solutions Amazon CloudFront A content management service that allows you to provide static and streaming content (sometimes called active content) to users in widely different geographic locations Amazon SimpleDB Provides very basic nonrelational database storage and retrieval Amazon Relational Database Service (RDS) Amazon’s offering of the MySQL database system... the bottom of this page You can sign up for an optional service called AWS Multi-Factor Authentication, which uses a key generator pad to further increase the security of your account If security is a high concern when working in AWS, you should consider reading more about what this service can provide There are buttons and links on this page to assist you in determining whether you should use this... nonrelational database storage and retrieval Amazon Relational Database Service (RDS) Amazon’s offering of the MySQL database system You can use this service instead of creating and managing your own MySQL installation Amazon Fulfillment Web Service (FWS) Provides a bundled set of e-commerce tools—the same tools that the now-famous Amazon merchant website uses Amazon Simple Queue Service (SQS) The . a high availability setup. Of course, they’ll be using MySQL for the database component.” Joel tried to remember all the details he’d read about MySQL high. (RDS) Amazon’s offering of the MySQL database system. You can use this service instead of creating and managing your own MySQL installation. Amazon Fulfillment

Ngày đăng: 07/11/2013, 19:15

TỪ KHÓA LIÊN QUAN