You are previewing Troubleshooting Ubuntu Server.
O'Reilly logo
Troubleshooting Ubuntu Server

Book Description

Make life at the office easier for server administrators by helping them build resilient Ubuntu server systems

About This Book

  • Tackle the issues you come across in keeping your Ubuntu server up and running

  • Build server machines and troubleshoot cloud computing related issues using Open Stack

  • Discover tips and best practices to be followed for minimum maintenance of Ubuntu Server 3

  • Who This Book Is For

    This book is for a vast audience of Linux system administrators who primarily work on Debian-based systems and spend long hours trying fix issues with the enterprise server. Ubuntu is already one of the most popular OSes and this book targets the most common issues that most administrators have to deal with. With the right tools and definite solutions, you will be able to keep your Ubuntu servers in the pink of health.

    What You Will Learn

  • Deploy packages and their dependencies with repositories

  • Set up your own DNS and network for Ubuntu Server

  • Authenticate and validate users and their access to various systems and services

  • Maintain, monitor, and optimize your server resources and avoid tremendous load

  • Get to know about processes, assigning and changing priorities, and running processes in background

  • Optimize your shell with tools and provide users with an improved shell experience

  • Set up separate environments for various services and run them safely in isolation

  • Understand, build, and deploy OpenStack on your Ubuntu Server

  • In Detail

    Ubuntu is becoming one of the favorite Linux flavors for many enterprises and is being adopted to a large extent. It supports a wide variety of common network systems and the use of standard Internet services including file serving, e-mail, Web, DNS, and database management. A large scale use and implementation of Ubuntu on servers has given rise to a vast army of Linux administrators who battle it out day in and day out to make sure the systems are in the right frame of operation and pre-empt any untoward incidents that may result in catastrophes for the businesses using it. Despite all these efforts, glitches and bugs occur that affect Ubuntu server's network, memory, application, and hardware and also generate cloud computing related issues using OpenStack.

    This book will help you end to end. Right from setting up your new Ubuntu Server to learning the best practices to host OpenStack without any hassles. You will be able to control the priority of jobs, restrict or allow access users to certain services, deploy packages, tackle issues related to server effectively, and reduce downtime.

    Also, you will learn to set up OpenStack, and manage and monitor its services while tuning the machine with best practices. You will also get to know about Virtualization to make services serve users better. Chapter by chapter, you will learn to add new features and functionalities and make your Ubuntu server a full-fledged, production-ready system.

    Style and approach

    This book contains topic-by-topic discussion in an easy-to-understand language with loads of examples to help you take care of Ubuntu Server. Plenty of screenshots will guide you through a step-by-step approach.

    Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. 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.

    Table of Contents

    1. Troubleshooting Ubuntu Server
      1. Table of Contents
      2. Troubleshooting Ubuntu Server
      3. Credits
      4. About the Author
      5. About the Reviewer
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Errata
          2. Piracy
          3. Questions
      8. 1. Package Management
        1. Getting started with packages
          1. Package
          2. Repository
          3. The .deb packages
          4. Dependency
          5. Open source
        2. Using dpkg for package management
        3. Understanding the apt-get package management tool
          1. Updating the repository list with the apt-get update command
          2. Installing a package with the apt-get install command
          3. Upgrading a package with the apt-get upgrade command
          4. Cleaning with the apt-get clean command
          5. Purging a package with the apt-get purge command
          6. Fixing unsuccessful installations with the apt-get –f command
          7. Checking for broken dependencies with the apt-get check command
        4. The apt-cache tool
          1. Searching for a package with the apt-cache search command
        5. Package management with aptitude
        6. Configuration and extra repositories
          1. Resolving the "failed to get" error
          2. Downloading software from an outside repository
        7. Automatic updates
          1. Security updates
          2. Kernel updates
          3. Application updates
          4. The unattended-upgrades package
        8. Creating a repository mirror
          1. Setting up a mirror machine
          2. Configuring the /etc/apt/mirror.list file
          3. Using the local mirror
        9. Summary
      9. 2. Networking and DNS
        1. Networking concepts
          1. IP addressing
          2. DHCP client for dynamic addresses
          3. Assigning a static IP address
        2. DHCP
          1. Installation
          2. Configuration
        3. Network sniffing with tcpdump
          1. Capturing packets from eth0
          2. Saving the tcpdump results in a file
          3. Reading packets saved in a file by tcpdump
          4. Readable timestamps in packets
          5. Reading packets of a specific protocol
          6. Reading packets on a specific port
          7. Reading TCP packets between two hosts
        4. Binding and bonding
          1. Binding
          2. Bonding
        5. DNS
          1. Setting up DNS
          2. Setting up primary and secondary DNS servers
            1. The hints file – zone "."
            2. The local host file – zone "0.0.127.in-addr.arpa"
            3. The reverse zone file – zone "24.126.10.in-addr.arpa"
            4. The primary zone file – zone "ubuntuserver.org"
        6. The primary zone file
        7. The reverse zone file
          1. PTR records
        8. Summary
      10. 3. Network Authentication
        1. OpenLDAP
          1. Installation
          2. Populating the database
          3. Logging
          4. Access control
        2. Kerberos
          1. Installation
          2. Database setup
          3. Setting up the Kerberos client
          4. Kerberos SSH and logon
        3. Integrating LDAP with Kerberos
          1. Installation
          2. Database setup
        4. OpenSSH, public, and private keys – passwordless SSH
          1. The SSH client and the server
          2. Setting up passwordless SSH
          3. Disabling password authentication
        5. Allowing or denying users to SSH
          1. Greeting users with a banner
        6. Summary
      11. 4. Monitoring and Optimization
        1. Nagios
          1. The Nagios setup
          2. Adding another host in Nagios
          3. Nagios templates
          4. Nagios hostgroups and services
          5. Nagios setup alerts
          6. Writing a Nagios plugin
          7. The NRPE plugin
          8. Enabling external commands
        2. Puppet
          1. Installing Puppet
          2. Setting up the client
          3. Setting up the manifest
        3. ClusterSSH
        4. Summary
      12. 5. Process Management
        1. The basics of process management
          1. $$ and $PPID
          2. pidof
          3. Parent and child
          4. fork() and exec()
          5. exec
          6. ps
            1. pstree
            2. ps fx
            3. ps -C and pgrep
          7. top
        2. Signaling processes
          1. kill
          2. Listing all signals
          3. kill -1 or SIGHUP
          4. kill -15 or SIGTERM
          5. kill -9 or SIGKILL
          6. SIGSTOP and SIGCONT
          7. pkill
          8. killall
        3. Process priorities
          1. renice
          2. nice
        4. Background processes
          1. jobs
          2. & (ampersand)
          3. jobs -p
          4. Suspended state with Ctrl + Z
          5. bg
          6. fg
        5. Summary
      13. 6. Shell Management, Tools, and User Management
        1. The Secure Shell server
          1. Installing the SSH server
          2. Configuration
            1. Default settings for the SSH server
            2. The SSH configuration file
          3. Using passphrases
        2. Scheduling jobs with cron
          1. Scheduling user cron jobs
          2. Configuring jobs using at
          3. Job schedule security
        3. Optimizing the shell
          1. Bash profiles
            1. The /etc/bash.bashrc file
            2. The /etc/profile file
            3. Variables in bash
        4. User management and file permissions
          1. User management in Ubuntu
            1. Adding and removing users
          2. Managing file permissions
            1. Understanding file permissions
            2. Changing permissions with chmod
            3. Modifying ownership using chown and chgrp
            4. Setting default permissions with umask
          3. Special file permissions
        5. Summary
      14. 7. Virtualization
        1. What is virtualization?
        2. libvirt
          1. Installation
            1. virt-install
            2. virt-clone
          2. Managing the virtual machine
            1. virsh
            2. The virtual machine manager
            3. The virtual machine viewer
        3. JeOS and vmbuilder
          1. JeOS
          2. vmbuilder
            1. Setup
              1. Adding users to groups
          3. Installing vmbuilder
            1. Defining the virtual machine
            2. JeOS installation
              1. IP address
              2. Enabling the bridge
              3. Partitions
              4. Setting the user and password
              5. Final steps in the installation
                1. First boot
                2. First login
                3. Auto updates
                4. ACPI handling
                5. The complete command
        4. Summary
      15. 8. OpenStack with Ubuntu
        1. The OpenStack architecture
        2. The environment
          1. Security
          2. Networking
            1. OpenStack networking
              1. The controller node
              2. The network node
              3. The compute node
              4. Verifying the network connectivity
            2. Network Time Protocol
              1. Configuring the controller node
                1. Installing the NTP service
                2. Configuring the NTP service
              2. Configuring other nodes
                1. Installing the NTP service
                2. Configuring the NTP service
            3. OpenStack packages
              1. Enabling the OpenStack repository
              2. Finalizing the installation
            4. Database
              1. Installing and configuring the database server
              2. Finalizing the installation
            5. The messaging server
              1. Installing the RabbitMQ message broker service
              2. Configuring the message broker service
        3. The Identity service
          1. Installing and configuring the Identity service
            1. Configuring the prerequisites
            2. Installing and configuring the components
            3. Finalizing the installation
            4. Tenants, users, and roles

              1. Configuring prerequisites
              2. Creating tenants, users, and roles
            5. The service entity and API endpoint
              1. Configuring the prerequisites
              2. Creating the service entity and API endpoint
        4. The Image service
          1. Installing and configuring the Image service
            1. Configuring the prerequisites
            2. Installing and configuring the Image service components
            3. Finalizing the installation
        5. The Compute service
          1. Installing and configuring the Compute service
            1. Configuring the prerequisites
            2. Installing and configuring the Compute service components
            3. Finalizing the installation
            4. Installing and configuring the compute node
              1. Installing and configuring the compute hypervisor components
              2. Finalizing the installation
        6. OpenStack networking
          1. Installing and configuring the controller node
            1. Configuring the prerequisites
            2. Installing the Networking components
            3. Configuring the server components of Networking
            4. Configuring the Modular Layer 2 plugin
            5. Configuring Networking on the compute node
            6. Finalizing the installation
          2. Installing and configuring the network node
            1. Configuring the prerequisites
            2. Installing the Networking components
            3. Configuring the Networking components
            4. Configuring the Modular Layer 2 plugin
            5. Configuring the Layer 3 agent
            6. Configuring the DHCP agent
            7. Configuring the metadata agent
            8. Configuring the OVS service
            9. Finalizing the installation
          3. Installing and configuring the compute node
            1. Configuring the prerequisites
            2. Installing the Networking components
            3. Configuring the Networking common components
            4. Configuring the ML2 plugin
            5. Configuring the OVS service
            6. Configuring Compute to use Networking
            7. Finalizing the installation
        7. Creating initial networks
          1. External networks
            1. Creating an external network
              1. Creating the subnet for the external network
          2. The tenant network
            1. Creating a tenant network
              1. Creating the subnet for the tenant network
          3. Creating the router to attach the external and tenant networks
        8. Dashboard
          1. Prerequisites
          2. Installing and configuring the dashboard
            1. Installing the packages
            2. Configuring the dashboard
            3. Finalizing the installation
        9. The Block Storage service
          1. Installing and configuring the controller node
            1. Configuring the prerequisites
            2. Installing and configuring the Block Storage service components
            3. Finalizing the installation
          2. Installing and configuring the storage node
            1. Configuring the prerequisites
            2. Installing and configuring the Block Storage volume components
            3. Finalizing the installation
        10. The Object Storage service
          1. Installing and configuring the controller node
            1. Configuring the prerequisites
            2. Installing and configuring the controller node components
          2. Installing and configuring the storage node
            1. Configuring the prerequisites
            2. Installing and configuring the storage node components
        11. Summary
      16. 9. OpenStack and Ubuntu Best Practices
        1. Creating rings for Object Storage
          1. Creating an account ring
          2. Creating a container ring
          3. Creating an object ring
          4. Copying the configuration files for rings
          5. Finalizing the installation
        2. The Orchestration module
          1. Installing and configuring
            1. Configuring the prerequisites
            2. Installing and configuring the Orchestration components
            3. Finalizing the installation
        3. The Telemetry module
          1. Installing and configuring the controller node
            1. Configuring the prerequisites
            2. Installing and configuring the Telemetry components
            3. Finalizing the installation
          2. Installing and configuring the Compute agent
            1. Configuring the prerequisites
            2. Configuring the Compute agent for the Telemetry module
            3. Finalizing the installation
          3. Configuring the Image service
          4. Adding the Block Storage agent for Telemetry
          5. Configuring Object Storage for Telemetry
        4. The Database service
          1. Installing the Database service
            1. Taking care of the prerequisites
            2. Installing the Database module
        5. The Data Processing service
          1. Installing the Data Processing service
        6. OpenStack flashback
        7. Best practices for Ubuntu Server
        8. Summary
      17. Index