Book Image

Troubleshooting CentOS

By : Jonathan Hobson
Book Image

Troubleshooting CentOS

By: Jonathan Hobson

Overview of this book

Table of Contents (17 chapters)
Troubleshooting CentOS
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

CentOS (Community Enterprise Operating System) is known as a robust, stable, and generally trouble-free operating system that is particularly well-suited to the role of a server. As a faithful adaption of RHEL, CentOS has been with us since its initial release in May 2004. It is used by a significant number of servers across the world, by an increasing number of individuals and businesses for a variety of needs, and it can be found in many mission critical situations. CentOS is considered to be a favorite among Linux professionals, and if it is configured correctly, serviced, and maintained, in most instances, a CentOS-based server should never give rise to any major complications. However, there are occasions when things do go wrong, and in such a situation, where the old joke of "rebooting the machine" is not the most appropriate form of action, then your only recourse is to consider troubleshooting the system.

Based on the overall theme of troubleshooting a CentOS 7 server, the purpose of this book is to take you on a journey across the whole spectrum of issue-based problem solving. Active processes, the networking environment, package management, users, directories and files, shared resources, security, databases, web-based services, and DNS will all be encountered with the sole purpose of building your knowledge base and enabling you to develop a fresh approach to problem solving.

What this book covers

Chapter 1, Basics of Troubleshooting CentOS, serves as an introduction to the book, in general, by giving you the low-down on gathering hardware information, dmesg, working with log files, and learning how to manipulate these log files using an array of command-line tools.

Chapter 2, Troubleshooting Active Processes, takes up the running and dives into the world of tuning server performance, swap, memory management, system load, monitoring disk I/O, a tour of the system, guidance on issuing the kill signal, and running additional performance checks using many more tools associated with the command line.

Chapter 3, Troubleshooting the Network Environment, walks you through the process of diagnosing a variety of issues related to the network environment. ping, dig, host, traceroute, mtr, ss, and tcpdump are just some of the tools that will be discussed when highlighting a whole host of network-related problems.

Chapter 4, Troubleshooting Package Management and System Upgrades, puts yum (Yellowdog Updater, Modified) in the spotlight with the intention of showing you how to manage plugins, add additional repositories, download RPM packages, restore the RPM database, and gather generalized software information.

Chapter 5, Troubleshooting Users, Directories, and Files, takes a stance on on-going maintenance and provides the information you need to prepare you for a variety of issues that the professional troubleshooter may face. From user management to login.defs, utmpdump to general file and directory audits. This chapter also builds on your existing knowledge related to the XFS filesystem and shows you how to recover the lost data with Scalpel.

Chapter 6, Troubleshooting Shared Resources, takes a magnifying glass to NFS on CentOS 7 and shows you how to provide shares, manage exports, and access them via a client workstation while simultaneously approaching the subject of CIFS and autofs to deliver an all round problem solving guide.

Chapter 7, Troubleshooting Security Issues, builds on the momentum and discusses why you need to keep SELinux by showing you how to generate audit reports with aureport. From this point onward, you will discover a comprehensive review on FirewallD and an installation guide for Tripwire so that you can develop your very own intrusion detection system.

Chapter 8, Troubleshooting Database Services, lends a hand to troubleshooters and system administrators alike by taking the key points regarding MariaDB, MySQL, and PostgreSQL to provide a birds eye view of how to deal with a lost root password, database tuning, database metrics, and how to install MySQL server on CentOS 7.

Chapter 9, Troubleshooting Web Services, takes a step back from recovery and examines the need to improve a system, website, or web application. Taking you through the art of cURL, you will not only discover how to audit your server and access FTP, but you will also learn how to validate your Akamai headers and manage Varnish with the overall intention to illustrate the fine line between Dev/Ops and troubleshooting.

Chapter 10, Troubleshooting DNS Services, completes our journey with an investigation into a variety of domain name service issues. Hostnames, FQDNs, BIND, and iftop are all under the knife as we navigate to a number of issues related to bandwidth, cache flushing, and how to make a DNS health check.

What you need for this book

The requirement of this book is based on the use of CentOS 7, a community-supported distribution derived from sources freely provided to the public by Red Hat. As such, CentOS Linux is functionally compatible with RHEL (Red Hat Enterprise Linux), although some package names may have been changed in order to remove upstream vendor branding and artwork. CentOS Linux is available for free, at no cost, and free to redistribute.

Who this book is for

This is a practical guide used to troubleshoot the CentOS 7 community-based enterprise server. It is assumed that you already have a server up and running, a good working knowledge of CentOS, and that you are comfortable with the concept of working with the services used by your server. You are not expected to be an expert by any means, but the familiarity of working with a server by remote administration will always help.

Conventions

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: "Discover how to gather hardware-based system information using lscpu and lspci."

A block of code is set as follows:

/path/to/nfs/publication/directory    XXX.XXX.XXX.XXX(rw,sync,root_squash,no_all_squash)

Any command-line input or output is written as follows:

# yum groupinstall "Base" "Development Libraries" "Development Tools"

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

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 , 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.

Customer support

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.

Errata

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

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 with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.