Discover millions of ebooks, audiobooks, and so much more with a free trial

From $11.99/month after trial. Cancel anytime.

Troubleshooting Ubuntu Server
Troubleshooting Ubuntu Server
Troubleshooting Ubuntu Server
Ebook589 pages2 hours

Troubleshooting Ubuntu Server

Rating: 0 out of 5 stars

()

Read preview

About this ebook

This book is for a vast audience of Linux system administrators who primarily work on Debian-based systems and spend long hours trying to fix issues with the enterprise server.
LanguageEnglish
Release dateSep 25, 2015
ISBN9781782175025
Troubleshooting Ubuntu Server

Related to Troubleshooting Ubuntu Server

Related ebooks

Networking For You

View More

Related articles

Reviews for Troubleshooting Ubuntu Server

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Troubleshooting Ubuntu Server - Bhargav Skanda

    Table of Contents

    Troubleshooting Ubuntu Server

    Credits

    About the Author

    About the Reviewer

    www.PacktPub.com

    Support files, eBooks, discount offers, and more

    Why subscribe?

    Free access for Packt account holders

    Preface

    What this book covers

    What you need for this book

    Who this book is for

    Conventions

    Reader feedback

    Customer support

    Errata

    Piracy

    Questions

    1. Package Management

    Getting started with packages

    Package

    Repository

    The .deb packages

    Dependency

    Open source

    Using dpkg for package management

    Understanding the apt-get package management tool

    Updating the repository list with the apt-get update command

    Installing a package with the apt-get install command

    Upgrading a package with the apt-get upgrade command

    Cleaning with the apt-get clean command

    Purging a package with the apt-get purge command

    Fixing unsuccessful installations with the apt-get –f command

    Checking for broken dependencies with the apt-get check command

    The apt-cache tool

    Searching for a package with the apt-cache search command

    Package management with aptitude

    Configuration and extra repositories

    Resolving the failed to get error

    Downloading software from an outside repository

    Automatic updates

    Security updates

    Kernel updates

    Application updates

    The unattended-upgrades package

    Creating a repository mirror

    Setting up a mirror machine

    Configuring the /etc/apt/mirror.list file

    Using the local mirror

    Summary

    2. Networking and DNS

    Networking concepts

    IP addressing

    DHCP client for dynamic addresses

    Assigning a static IP address

    DHCP

    Installation

    Configuration

    Network sniffing with tcpdump

    Capturing packets from eth0

    Saving the tcpdump results in a file

    Reading packets saved in a file by tcpdump

    Readable timestamps in packets

    Reading packets of a specific protocol

    Reading packets on a specific port

    Reading TCP packets between two hosts

    Binding and bonding

    Binding

    Bonding

    DNS

    Setting up DNS

    Setting up primary and secondary DNS servers

    The hints file – zone .

    The local host file – zone 0.0.127.in-addr.arpa

    The reverse zone file – zone 24.126.10.in-addr.arpa

    The primary zone file – zone ubuntuserver.org

    The primary zone file

    The reverse zone file

    PTR records

    Summary

    3. Network Authentication

    OpenLDAP

    Installation

    Populating the database

    Logging

    Access control

    Kerberos

    Installation

    Database setup

    Setting up the Kerberos client

    Kerberos SSH and logon

    Integrating LDAP with Kerberos

    Installation

    Database setup

    OpenSSH, public, and private keys – passwordless SSH

    The SSH client and the server

    Setting up passwordless SSH

    Disabling password authentication

    Allowing or denying users to SSH

    Greeting users with a banner

    Summary

    4. Monitoring and Optimization

    Nagios

    The Nagios setup

    Adding another host in Nagios

    Nagios templates

    Nagios hostgroups and services

    Nagios setup alerts

    Writing a Nagios plugin

    The NRPE plugin

    Enabling external commands

    Puppet

    Installing Puppet

    Setting up the client

    Setting up the manifest

    ClusterSSH

    Summary

    5. Process Management

    The basics of process management

    $$ and $PPID

    pidof

    Parent and child

    fork() and exec()

    exec

    ps

    pstree

    ps fx

    ps -C and pgrep

    top

    Signaling processes

    kill

    Listing all signals

    kill -1 or SIGHUP

    kill -15 or SIGTERM

    kill -9 or SIGKILL

    SIGSTOP and SIGCONT

    pkill

    killall

    Process priorities

    renice

    nice

    Background processes

    jobs

    & (ampersand)

    jobs -p

    Suspended state with Ctrl + Z

    bg

    fg

    Summary

    6. Shell Management, Tools, and User Management

    The Secure Shell server

    Installing the SSH server

    Configuration

    Default settings for the SSH server

    The SSH configuration file

    Using passphrases

    Scheduling jobs with cron

    Scheduling user cron jobs

    Configuring jobs using at

    Job schedule security

    Optimizing the shell

    Bash profiles

    The /etc/bash.bashrc file

    The /etc/profile file

    Variables in bash

    User management and file permissions

    User management in Ubuntu

    Adding and removing users

    Managing file permissions

    Understanding file permissions

    Changing permissions with chmod

    Modifying ownership using chown and chgrp

    Setting default permissions with umask

    Special file permissions

    Summary

    7. Virtualization

    What is virtualization?

    libvirt

    Installation

    virt-install

    virt-clone

    Managing the virtual machine

    virsh

    The virtual machine manager

    The virtual machine viewer

    JeOS and vmbuilder

    JeOS

    vmbuilder

    Setup

    Adding users to groups

    Installing vmbuilder

    Defining the virtual machine

    JeOS installation

    IP address

    Enabling the bridge

    Partitions

    Setting the user and password

    Final steps in the installation

    First boot

    First login

    Auto updates

    ACPI handling

    The complete command

    Summary

    8. OpenStack with Ubuntu

    The OpenStack architecture

    The environment

    Security

    Networking

    OpenStack networking

    The controller node

    The network node

    The compute node

    Verifying the network connectivity

    Network Time Protocol

    Configuring the controller node

    Installing the NTP service

    Configuring the NTP service

    Configuring other nodes

    Installing the NTP service

    Configuring the NTP service

    OpenStack packages

    Enabling the OpenStack repository

    Finalizing the installation

    Database

    Installing and configuring the database server

    Finalizing the installation

    The messaging server

    Installing the RabbitMQ message broker service

    Configuring the message broker service

    The Identity service

    Installing and configuring the Identity service

    Configuring the prerequisites

    Installing and configuring the components

    Finalizing the installation

    Tenants, users, and roles

    Configuring prerequisites

    Creating tenants, users, and roles

    The service entity and API endpoint

    Configuring the prerequisites

    Creating the service entity and API endpoint

    The Image service

    Installing and configuring the Image service

    Configuring the prerequisites

    Installing and configuring the Image service components

    Finalizing the installation

    The Compute service

    Installing and configuring the Compute service

    Configuring the prerequisites

    Installing and configuring the Compute service components

    Finalizing the installation

    Installing and configuring the compute node

    Installing and configuring the compute hypervisor components

    Finalizing the installation

    OpenStack networking

    Installing and configuring the controller node

    Configuring the prerequisites

    Installing the Networking components

    Configuring the server components of Networking

    Configuring the Modular Layer 2 plugin

    Configuring Networking on the compute node

    Finalizing the installation

    Installing and configuring the network node

    Configuring the prerequisites

    Installing the Networking components

    Configuring the Networking components

    Configuring the Modular Layer 2 plugin

    Configuring the Layer 3 agent

    Configuring the DHCP agent

    Configuring the metadata agent

    Configuring the OVS service

    Finalizing the installation

    Installing and configuring the compute node

    Configuring the prerequisites

    Installing the Networking components

    Configuring the Networking common components

    Configuring the ML2 plugin

    Configuring the OVS service

    Configuring Compute to use Networking

    Finalizing the installation

    Creating initial networks

    External networks

    Creating an external network

    Creating the subnet for the external network

    The tenant network

    Creating a tenant network

    Creating the subnet for the tenant network

    Creating the router to attach the external and tenant networks

    Dashboard

    Prerequisites

    Installing and configuring the dashboard

    Installing the packages

    Configuring the dashboard

    Finalizing the installation

    The Block Storage service

    Installing and configuring the controller node

    Configuring the prerequisites

    Installing and configuring the Block Storage service components

    Finalizing the installation

    Installing and configuring the storage node

    Configuring the prerequisites

    Installing and configuring the Block Storage volume components

    Finalizing the installation

    The Object Storage service

    Installing and configuring the controller node

    Configuring the prerequisites

    Installing and configuring the controller node components

    Installing and configuring the storage node

    Configuring the prerequisites

    Installing and configuring the storage node components

    Summary

    9. OpenStack and Ubuntu Best Practices

    Creating rings for Object Storage

    Creating an account ring

    Creating a container ring

    Creating an object ring

    Copying the configuration files for rings

    Finalizing the installation

    The Orchestration module

    Installing and configuring

    Configuring the prerequisites

    Installing and configuring the Orchestration components

    Finalizing the installation

    The Telemetry module

    Installing and configuring the controller node

    Configuring the prerequisites

    Installing and configuring the Telemetry components

    Finalizing the installation

    Installing and configuring the Compute agent

    Configuring the prerequisites

    Configuring the Compute agent for the Telemetry module

    Finalizing the installation

    Configuring the Image service

    Adding the Block Storage agent for Telemetry

    Configuring Object Storage for Telemetry

    The Database service

    Installing the Database service

    Taking care of the prerequisites

    Installing the Database module

    The Data Processing service

    Installing the Data Processing service

    OpenStack flashback

    Best practices for Ubuntu Server

    Summary

    Index

    Troubleshooting Ubuntu Server


    Troubleshooting Ubuntu Server

    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: September 2015

    Production reference: 1180915

    Published by Packt Publishing Ltd.

    Livery Place

    35 Livery Street

    Birmingham B3 2PB, UK.

    ISBN 978-1-78528-414-4

    www.packtpub.com

    Credits

    Author

    Skanda Bhargav

    Reviewer

    Keenan Payne

    Commissioning Editor

    Priya Singh

    Acquisition Editors

    Shaon Basu

    Sonali Vernekar

    Content Development Editor

    Gaurav Sharma

    Technical Editor

    Taabish Khan

    Copy Editor

    Roshni Banerjee

    Project Coordinator

    Bijal Patel

    Proofreader

    Safis Editing

    Indexer

    Hemangini Bari

    Graphics

    Sheetal Aute

    Production Coordinator

    Nitesh Thakur

    Cover Work

    Nitesh Thakur

    About the Author

    Skanda Bhargav is an engineering graduate from Visvesvaraya Technological University (VTU), Belgaum, Karnataka, India. He did his majors in Computer Science Engineering. He is a Cloudera-certified developer in Apache Hadoop. His interests are Big Data and Hadoop. He is currently pursuing his Master's in Computer Software Engineering from San Jose State University, Silicon Valley, California.

    He has been a reviewer for the following books and videos:

    Building Hadoop Clusters, Sean Mikha, Packt Publishing

    Hadoop Cluster Deployment, Danil Zburivsky, Packt Publishing

    Instant MapReduce Patterns – Hadoop Essentials How-to, Srinath Perera, Packt Publishing

    Cloudera Administration Handbook, Rohit Menon, Packt Publishing

    Hadoop Map Reduce v2 Cookbook – Second Edition, Thilina Gunarathne, Packt Publishing

    Data Analysis and Business Modeling with Excel 2013, David Rojas, Packt Publishing

    I would like to thank my family for their immense support and faith in me throughout my learning stage. My friends have brought the confidence in me to a level that makes me bring out the best in me. I am happy that god has blessed me with such wonderful people around me, without whom this success would not have been possible.

    About the Reviewer

    Keenan Payne is a frontend developer for a company called Asana in San Francisco, CA. He has written for many online publications and built a CSS framework called Concise, and in his spare time, he loves to surf and make music.

    www.PacktPub.com

    Support files, eBooks, discount offers, and more

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

    Why subscribe?

    Fully searchable across every book published by Packt

    Copy and paste, print, and bookmark content

    On demand and accessible via a web browser

    Free access for Packt account holders

    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.

    Preface

    The mission of this book is to simplify the tasks of an administrator and equip them with the tools to win the battle not once, not twice, but each time the server acts in a way that is not in accordance with the usual behavior. This book will help administrators ensure that the servers do not face even a nanosecond of outage as businesses in today's world are entirely dependent on these machines.

    After reading and following the guidelines carefully, you will be able to identify the problems in Ubuntu Server, diagnose the causes, and rectify them. The areas this book intends to cover are networks, CPU, memory, and handling cloud computing-related issues using OpenStack.

    What this book covers

    Chapter 1, Package Management, covers the different ways software can be installed, configured, upgraded, and removed using package management tools. There are various ways and tools to do this. Technical topics that are covered in this chapter are dpkg, aptitude, and apt-get, which are the command-line utilities used to automate some of the package management tasks. You will learn the various tools and methodologies to handle software, such as the command-line tools, as well as GUI for the installation, mirroring, upgrade, and removal of software along with their dependencies.

    Chapter 2, Networking and DNS, deals with networking. This chapter covers how to understand, configure, and troubleshoot network-related issues. This is a very brief introduction to networking and handling wired and wireless networking. This chapter covers DNS setup, networking concepts, interface configuration, DHCP, network sniffing, binding, and bonding. Regarding DNS, the topics covered are forward zone, reverse zone, and configuring the primary master and secondary master. You will learn the networking concepts, which are key to diagnosing and rectifying networking issues in Ubuntu Server. It also covers the configuration of DHCP, DNS, and interfaces.

    Chapter 3, Network Authentication, deals with network authentication for managing users' access to other systems in a secure way. It covers the different tools and methods for letting users access systems and services with restricted authentication. The technical topics covered are OpenLDAP, Kerberos, Kerberos with LDAP, NIS, Samba (optional), PAM, SSH, public and private keys, the RSA and DSA algorithms, passwordless SSH, X forwarding, and sshd. You will be able to set up and manage the users' access to systems and services as well as install, configure, and troubleshoot the services and tools.

    Chapter 4, Monitoring and Optimization, deals with monitoring various resources on the server and load balancing with tools. This chapter also covers Nagios, Munin, Puppet, and ClusterSSH. System monitoring, CPU load, storage, networks, memory, resource monitoring, load balancing with IPVS, and ldirectord are also covered in this chapter. You will learn about resource monitoring for CPU, memory, and networks.

    Chapter 5, Process Management, covers all the processes, their states, and how to manage them by using the command-line tools. The topics that are covered are ps, top, renice, kill, $$ and $PPID, job, fg, queues, process switching, process priority, and background jobs. You will learn how to handle process management using the command-line tools.

    Chapter 6, Shell Management, Tools, and User Management, discusses shell, shell management tools, and user management. Topics such as the Secure Shell server, scheduling using cron, shell optimization, file

    Enjoying the preview?
    Page 1 of 1