23,99 €
This book is targeted at system engineers and system administrators who want to upgrade their knowledge and skills in high availability and want to learn practically how to achieve high availability with CentOS Linux. You are expected to have good CentOS Linux knowledge and basic networking experience.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 172
Veröffentlichungsjahr: 2015
Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: April 2015
Production reference: 1220415
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78528-248-5
www.packtpub.com
Author
Mitja Resman
Reviewers
Denis Fateyev
Christophe Grenier
Commissioning Editor
Veena Pagare
Acquisition Editor
Reshma Raman
Content Development Editor
Neeshma Ramakrishnan
Technical Editor
Abhishek R. Kotian
Copy Editor
Vikrant Phadke
Project Coordinator
Danuta Jones
Proofreaders
Stephen Copestake
Safis Editing
Paul Hindle
Indexer
Rekha Nair
Production Coordinator
Melwyn D'sa
Cover Work
Melwyn D'sa
Mitja Resman hails from a small, beautiful country called Slovenia in south-central Europe. He is a fan of Linux and also an open source enthusiast. He is a Red Hat Certified Engineer and Linux Professional Institute professional. Working as a system administrator, Mitja gained years of professional experience with open source software and Linux system administration on local and international projects. The Swiss Army Knife syndrome makes him an expert in the field of VMware virtualization, Microsoft system administration, and more recently, Android system administration.
Mitja has a strong desire to learn, develop, and share knowledge with others. This is the reason he started a blog called GeekPeek.Net. It provides CentOS Linux guides and how-to articles covering all sorts of topics appropriate for both beginners and advanced users. Mitja is also a devoted father and husband. His daughter and wife are the ones who take his mind off the geek stuff and make him appreciate life and look forward to the things to come.
I would like to thank my wife for putting up with my late night writing sessions and for all the support I got when I decided to write this book. I would also like to thank all of my family for the words of encouragement at the time of writing this book. Also, a special thanks to my friend who introduced me to Linux many years ago.
Denis Fateyev holds a Master's degree in Computer Science, and has been working with Linux for more than 10 years, mostly with Red Hat and CentOS. He currently works as a Perl programmer and a DevOps for a small German company. Being a keen participant in the open source community, he is a package maintainer in the Fedora and Repoforge projects. Foreign languages (German and Spanish) and linguistics are also his passion.
Denis can be reached at <[email protected]>.
Christophe Grenier holds a diploma from ESIEA Graduate School of Engineering, and is the director of operations at Global SP—a French IT service provider. He has more than 15 years of experience in Red Hat Linux systems. He uses the Corosync cluster solution from CentOS 5 onwards. Christophe teaches several courses about Linux and IT Security in Sécurité de l'Information et des Systèmes at ESIEA Mastère Spécialisé. He is also known for the open source data recovery utilities, TestDisk, and PhotoRec.
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.
The book will guide you through the process of installing, configuring, and administering a multinode computer cluster on CentOS version 6 and 7 using two different cluster suites with respect to the CentOS version.
Chapter 1, Getting Started with High Availability, provides facts about high availability.
Chapter 2, Meet the Cluster Stack on CentOS, shows you how cluster stack software works as a whole to provide high availability.
Chapter 3, Cluster Stack Software on CentOS 6, covers installation and configuration of cluster stack software on CentOS 6.
Chapter 4, Resource Manager on CentOS 6, teaches you how to manage your cluster resources and services with the RGManager resource manager on CentOS 6.
Chapter 5, Playing with Cluster Nodes on CentOS 6, explains how to manage and administer cluster nodes on CentOS 6.
Chapter 6, Fencing on CentOS 6, provides the details and recommendations on the quorum disk on CentOS 6.
Chapter 7, Testing Failover on CentOS 6, discovers cluster node fencing on CentOS 6.
Chapter 8, Two-node Cluster Considerations on CentOS 6, covers some final cluster failover tests on CentOS 6.
Chapter 9, Cluster Stack Software on CentOS 7, shows you how to install and configure cluster stack software on CentOS 7.
Chapter 10, Resource Manager on CentOS 7, teaches you how to manage your cluster resources and services with the Pacemaker resource manager on CentOS 7.
Chapter 11, Playing with Cluster Nodes on CentOS 7, explains how to manage and administer cluster nodes on CentOS 7.
Chapter 12, STONITH on CentOS 7, introduces the details and recommendations on quorum disk on CentOS 7.
Chapter 13, Testing Failover on CentOS 7, covers cluster node fencing, the so-called STONITH, on CentOS 7.
Chapter 14, Two-node Cluster Considerations on CentOS 7, provides some final cluster failover tests on CentOS 7.
To closely follow the guides provided in this book, three virtual or physical machines with a working CentOS version 6 or 7 installation are required. The machines must have Internet connectivity to provide successful software installation, and local network connectivity to provide normal cluster operation.
This book is targeted at system engineers and system administrators who want to upgrade their knowledge and skills in high availability, and want to learn how to practically achieve high availability with CentOS Linux. You are expected to have good knowledge of CentOS Linux and basic networking experience.
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "If you want to change this, edit the NTP configuration file in /etc/ntp.conf."
Any command-line input or output is written as follows:
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Check the Cluster Status parameter to confirm that the cluster node was removed from the cluster configuration."
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.
To send us general feedback, simply e-mail <[email protected]>, and mention the book's title in the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors and our ability to bring you valuable content.
If you have a problem with any aspect of this book, you can contact us at <[email protected]>, and we will do our best to address the problem.
We live in a fast-paced world and, with all the technology surrounding us, we take it for granted most of the time. When we set the alarm clock in the evening before falling asleep, we never give much thought whether the alarm will actually work in the morning or not; and when we turn the ignition key to drive off to work, we never stop to think whether the car will fail to start or not. On a normal day, there is hardly any chance of anything like this happening to us, so we can calmly go to sleep in the evening. The same applies to visiting our favorite website first thing in the morning. We are, in fact, more likely to expect that the car will not start or the bus will be late than that we will not be able to log in to our Facebook or Gmail account. No wonder, these sites are is always online and ready to serve information whenever we request it.
Have you ever asked yourself, "How can this be?" We all know we cannot trust technology implicitly. Sooner or later, it can and it will fail. With such complex systems and technologies surrounding us, we are actually not aware how many systems are required to run flawlessly so that we can read our e-mails and check our Facebook walls. How did we become so sure that these complex systems will always provide what we require?
The answer to the question is high availability. Highly available systems are what made us all blind, in the belief that services are always there and on and failure is not an option. As the title of this book suggests, the objective is to familiarize you with how to achieve high availability, focusing on an actual, practical example of a three-node cluster configuration on CentOS Linux version 6 and 7. A three-node cluster is chosen because the number of cluster nodes plays a key role in the cluster configuration process, which will be explained in more detail later in the book. You will become familiar with two different software solutions available for achieving high availability on CentOS Linux.
In the first chapter, you will learn about high availability in general. It will start by laying the foundation and explaining what high availability is, also describing what system design approaches must be followed to make an IT system highly available. We will explain the meaning of computer clusters, why we need them, and the possible computer cluster configurations.
The emphasis of this book is on the following topics:
The general meaning of the word "availability" is a characteristic of a resource—either a person or an object that can be accessed or used. Resource availability can be measured, and therefore, a ratio of the time a resource is accessible or usable to the time the resource is inaccessible or unusable can be calculated. Adding an adjective "high" to the word "availability" suggests that the resource should be accessible and usable most of the time during a given time interval. The term "high availability" is commonly used in information technology and it describes IT systems with a high level of availability.
High availability in IT refers to a system that is continuously operational and available for the delivery of services it provides for end users. The key point when talking about IT systems is the availability to deliver services to end users, since a system can be up-and-running from the IT administrator's perspective but can fail to provide services for end users, which makes it useless. There are a number of factors that can lead to service downtime, mainly because there are so many different layers that must work together to provide service availability.
An IT system usually consists of many different components. All of these components must be continuously available for a desirable length of time. It is needless to say that it is very important for these highly available systems to be properly designed, well thought through, and thoroughly tested with the goal of eliminating any possibility of potential failure. That being said, high availability is a system design approach, and a service implementation in a way, to provide the highest achievable level of performance and availability by eliminating all system-wide single points of failure.
Not every system can be marked highly available. It is common practice in IT to measure and calculate the availability of a system. Monitoring tools such as Nagios, Zenoss, or Zabbix can be used to provide reports on system availability and also alerts in the case of system unavailability. The measurements taken must reflect the actual availability of the system to the end user. By measuring and calculating the availability of a system, we can split them into systems that are classified as highly available and systems that are not. System availability is commonly expressed as a percentage of system uptime in a given year.
IT systems that offer high availability of services must follow a specific system design approach by which they can provide the most available continuous operation. The fundamental rule of a high-availability system design approach is to avoid single points of failure. A single point of failure is a component of a system that could lead to system and service downtime if it fails. The design should avoid single points of failure, which makes the system more robust and automatically increases system and service availability.
A complex IT system providing application services can have a large number of single points of failure at different levels, but how can we eliminate all of them? The solution is redundancy. Redundancy means duplication of the system's critical components. Duplication of devices allows continuous system operation even if one of the duplicated devices fails. There are two types of redundancy: passive and active. Passive redundancy means using two or more devices while only one of them provides its service at certain point in time. The other devices wait to take over in the case of an unrecoverable failure of the operating device. Active redundancy means using two or more devices, all providing their service at all times. Even if one of the devices fails, other devices are continuously providing the service.
Let me try to explain single points of failure and redundancy with a practical example. Let's say you are hosting a simple website on your personal home computer. The computer is located at your home, hidden in your storage closet. It is happily providing a website service for end users. It is always on and users can access the website any time of the day. If you and I