Skip to content

Latest commit

 

History

History
114 lines (73 loc) · 3.81 KB

File metadata and controls

114 lines (73 loc) · 3.81 KB
date 2016-05-09
draft false
weight 10
title Lab 10 - Logs
Mon Mon Mon Mon Tue Tue Tue Tue Wed Wed Wed Thur Thur Thur Thur
00 01 02 03 04 05 06 07 08 09 alt text 11 12 13 14

Lab Duration: 10 minutes

Lab Objective

The objective of this lab is to show how to locate the various logs for services supporting OpenStack, thereby allowing admins to monitor their OpenStack deployment. The second part of this lab is designed as a reference for how to build an rsyslog server for your OpenStack infastruture. This lab has no dependency on other labs.

1. Where are the logs?

Most OpenStack services use the convention of writing their log files to sub directories of /var/log/

  1. Display the nova-* service logs

    [root@controller ~]# ls /var/log/nova

    nova-api.log   nova-conductor.log    nova-manage.log      nova-scheduler.log
    nova-cert.log  nova-consoleauth.log  nova-novncproxy.log
    
  2. Display the glance-* service logs

    [root@controller ~]# ls /var/log/glance

    api.log  api.log-20151004.gz  api.log-20160113  registry.log  registry.log-20160111 
    
  3. Display the cinder-* service logs

    [root@controller ~]# ls /var/log/cinder

    api.log  api.log-20151004.gz  api.log-20160113  registry.log  registry.log-20160111
    
  4. Display the keystone-* service logs

    [root@controller ~]# ls /var/log/keystone

    keystone.log  keystone.log-20151004.gz  keystone.log-20160111 
    
  5. Display the horizon service logs

    [root@controller ~]# ls /var/log/horizon

    horizon.log
    
  6. SSH to compute node #1!

    [root@controller ~]# ssh root@compute1

  7. CD to the directory that contains the instances

    [root@compute1 ~]# cd /var/lib/nova/instances

  8. List the directory and note the instances

    [root@compute1 instances]# ls -l

    drwxr-xr-x. 2 nova nova 69 Oct  4 20:20 07334a4c-dac3-474b-83f0-1d8f4db1f093 <-- Instance#1
    drwxr-xr-x. 2 nova nova 69 Nov  4 20:26 6a56b82f-547d-440b-9ebc-04813a343a2a <-- Instance#2
    drwxr-xr-x. 2 nova nova 53 Nov  4 20:25 _base
    -rw-r--r--. 1 nova nova 73 Nov  4 21:15 compute_nodes
    drwxr-xr-x. 2 nova nova 91 Nov  4 20:25 locks
    
  9. Change directory into Instance#1

    [root@compute1 instances]# cd 07334a4c-dac3-474b-83f0-1d8f4db1f093 <--Instance #1 shown above

  10. List the files in this directory

    [root@compute1 07334a4c-dac3-474b-83f0-1d8f4db1f093]# ls -l

    -rw-rw----. 1 nova qemu   28356 Oct  3 00:03 console.log  <--cat console.log | tail -20
    -rw-r--r--. 1 qemu qemu 1703936 Oct  3 00:04 disk         <-- BORING to look at, ephemeral storage
    -rw-r--r--. 1 nova nova      79 Oct  2 23:24 disk.info    <-- cat disk.info
    -rw-r--r--. 1 nova nova    2715 Oct  2 23:27 libvirt.xml  <--less libvirt.xml
    
  11. Inspect the log files shown above. No special analysis required on your part, just check out the logs

    Use the cat or less command to look at thes files. Hints of what to use are shown above

  12. When complete, just exit the SSH session as follows and you will be connected back to the controller node.

    [root@compute1 07334a4c-dac3-474b-83f0-1d8f4db1f093]# exit

    logout
    Connection to compute1 closed.
    [root@controller ~]#
    

    Manging the logging function: https://docs.python.org/2/howto/logging.html#configuring-logging