| 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 | ![]() |
11 | 12 | 13 | 14 |
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.
Most OpenStack services use the convention of writing their log files to sub directories of /var/log/
-
Display the nova-* service logs
[root@controller ~]#ls /var/log/novanova-api.log nova-conductor.log nova-manage.log nova-scheduler.log nova-cert.log nova-consoleauth.log nova-novncproxy.log -
Display the glance-* service logs
[root@controller ~]#ls /var/log/glanceapi.log api.log-20151004.gz api.log-20160113 registry.log registry.log-20160111 -
Display the cinder-* service logs
[root@controller ~]#ls /var/log/cinderapi.log api.log-20151004.gz api.log-20160113 registry.log registry.log-20160111 -
Display the keystone-* service logs
[root@controller ~]#ls /var/log/keystonekeystone.log keystone.log-20151004.gz keystone.log-20160111 -
Display the horizon service logs
[root@controller ~]#ls /var/log/horizonhorizon.log -
SSH to compute node #1!
[root@controller ~]#ssh root@compute1 -
CD to the directory that contains the instances
[root@compute1 ~]#cd /var/lib/nova/instances -
List the directory and note the instances
[root@compute1 instances]#ls -ldrwxr-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 -
Change directory into Instance#1
[root@compute1 instances]#cd 07334a4c-dac3-474b-83f0-1d8f4db1f093<--Instance #1 shown above -
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 -
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
-
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]#exitlogout Connection to compute1 closed. [root@controller ~]#Manging the logging function: https://docs.python.org/2/howto/logging.html#configuring-logging
