





















































OpenStack is a complex suite of software that can make tracking down issues and faults quite daunting to beginners and experienced system administrators alike. While there is no single approach to troubleshooting systems, understanding where OpenStack logs vital information or what tools are available to help track down bugs will help resolve issues we may encounter.
OpenStack provides tools to check various parts of Compute Services, and we'll use common system commands to check whether our environment is running as expected.
To check our OpenStack Compute host we must log in to that server, so do this now before following the given steps.
To check that Nova is running the required services, we invoke the nova-manage tool and ask it various questions of the environment as follows:
sudo nova-manage service list
You will see the following output. The :-) icons are indicative that everything is fine.
Troubleshooting is covered at the end of the book, but if you do see XXX then the answer will be in the logs at /var/log/nova/.
If you get intermittent XXX and :-) icons for a service, first check if the clocks are in sync.
ps -ef | grep glance
netstat -ant | grep 9292.*LISTEN
These should return process information for Glance to show it is running and 9292 is the default port that should be open in the LISTEN mode on your server ready for use.
sudo rabbitmqctl status
The following is an example output from rabbitmqctl when everything is running OK:
ntpq -p
It should return output regarding contacting NTP servers, for example:
MYSQL_PASS=openstack
mysqladmin -uroot –p$MYSQL_PASS status
This will return some statistics about MySQL, if it is running:
We have used some basic commands that communicate with OpenStack Compute and other services to show they are running. This elementary level of troubleshooting ensures you have the system running as expected.
Logging is important in all computer systems, but the more complex the system, the more you rely on being able to spot problems to cut down on troubleshooting time. Understanding logging in OpenStack is important to ensure your environment is healthy and is able to submit relevant log entries back to the community to help fix bugs.
Log in as the root user onto the appropriate servers where the OpenStack services are installed.
OpenStack produces a large number of logs that help troubleshoot our OpenStack installations. The following details outline where these services write their logs.
Logs for the OpenStack Compute services are written to /var/log/nova/, which is owned by the nova user, by default. To read these, log in as the root user. The following is a list of services and their corresponding logs:
OpenStack Dashboard (Horizon) is a web application that runs through Apache by default, so any errors and access details will be in the Apache logs. These can be found in /var/log/ apache2/*.log, which will help you understand who is accessing the service as well as the report on any errors seen with the service.
OpenStack Storage (Swift) writes logs to syslog by default. On an Ubuntu system, these can be viewed in /var/log/syslog. On other systems, these might be available at /var/log/messages.
Logging can be adjusted to allow for these messages to be filtered in syslog using the log_level, log_facility, and log_message options. Each service allows you to set the following:
If you change any of these options, you will need to restart that service to pick up the change.
Many OpenStack services allow you to control the chatter in the logs by setting different log output settings. Some services, though, tend to produce a lot of DEBUG noise by default.
This is controlled within the configuration files for that service. For example, the Glance Registry service has the following settings in its configuration files:
Moreover, many services are adopting this facility. In production, you would set debug to False and optionally keep a fairly high level of INFO requests being produced, which may help with the general health reports of your OpenStack environment.
Logging is an important activity in any software, and OpenStack is no different. It allows an administrator to track down problematic activity that can be used in conjunction with the community to help provide a solution. Understanding where the services log, and managing those logs to allow someone to identify problems quickly and easily, are important.