Mindmajix

Checking OpenStack services

OpenStack provides tools to check on its services. In this section, we’ll show you how to check the operational status of these services. We will also use common system commands to check whether our environment is running as expected or not.

Getting started

To check our OpenStack Compute host, we must log into that server, so do this now before following the given steps.

How to achieve it…

To check that OpenStack Compute is running the required services, we invoke the nova-manage tool and ask it various questions about the environment, as follows:

Checking OpenStack Compute Services

To check our OpenStack Compute services, issue the following command:

sudo nova-manage service list

You will see an output similar to the following. The :-) indicates that everything is fine.

nova-manage service list

Screenshot_725

The fields are defined as follows:

Binary: This is the name of the service that we’re checking the status of.

Host: This is the name of the server or host where this service is running. With the appropriate permissions, you can select which host instances are launched on and which roles can boot instances on this hos

Zone: This refers to the OpenStack Zone that is running that service. A zone can run different services. The default zone is called a nova.

Status: This states whether or not an administrator has enabled or disabled that service.

State: This refers to whether that’s running service is working or not.

Updated_At: This indicates when that service was last checked.

If OpenStack Compute has a problem, you will see XXX in place of :-). The following command shows the same:

nova-compute compute.book      nova enabled             XXX          2013-06-18 16:47:35

If you do see XXX, the answer to the problem will be in the logs at /var/log/nova/.

Tip

If you get intermittent XXX and :-) for a service, first check whether the clocks are in sync.

OpenStack Image Service (Glance)

The OpenStack Image Service, Glance, while critical to the ability of OpenStack to provision new instances, does not contain its own tool to check the status of the service. Instead, we rely on some built-in Linux tools. The OpenStack Image Service (Glance) doesn’t have a tool to check its running services, so we can use some system commands instead, as follows:

ps -ef | grep glance
netstat -ant | grep 9292.*LISTEN

These should return process information for Glance to show that it’s running, and 9292 is the default port that should be open in the LISTEN mode on your server, which is ready for use. The output of these commands will be similar to the following:

ps -ef | grep glance

This produces output like the following:

Screenshot_726

To check if the correct port is in use, issue the following command:

netstat -ant | grep 9292
tcp          0                 0 0.0.0.0:9292                           0.0.0.0:*                                 LISTEN

Other services that you should check

Should Glance be having issues while the above services are in working order, you will want to check the following services as well:

rabbitmq: For rabbitmq, run the following command:

sudo rabbitmqctl status

For example, output from rabbitmqctl (when everything is running OK) should look similar to the following screenshot:

Screenshot_727

If rabbitmq isn’t working as expected, you will see output similar to the following indicating that the rabbitmq service or node is down:

Screenshot_728

ntp: For ntp (Network Time Protocol, for keeping nodes in time-sync), run the following command:

ntpq -p

Tip

ntp is required for multi-host OpenStack environments, but it may not be installed by default. Install the ntp package with sudo apt-get install -y ntp)

This should return output regarding contacting NTP servers, for example:

Screenshot_729

MySQL Database Server: For MySQL Database Server, run the following commands:

PASSWORD=openstack
mysqladmin -uroot –p$PASSWORD status

This will return some statistics about MySQL, if it is running, as shown in the following screenshot:

Screenshot_730

Checking OpenStack Dashboard (Horizon)

Like the Glance Service, the OpenStack Dashboard service, Horizon, does not come with a built-in tool to check its health.

Horizon, despite of not having a built-in utility to check service health, does rely on the Apache web server to serve pages. To check the status of the service, then, we check the health of the web service. To check the health of the Apache web service, log into the server running Horizon and execute the following command:

ps -ef | grep apache

This command produces output like the following screenshot:

Screenshot_731

To check that Apache is running on the expected port, TCP Port 80, issue the following command:

netstat -ano | grep :80

This command should show the following output:

tcp          0       0 0.0.0.0:80             0.0.0.0:*                 LISTEN                    off (0.00/0/0)

To test access to the web server from the command line issues the following command:

telnet localhost 80

This command should show the following output:

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Checking OpenStack Identity (Keystone)

Keystone comes with a client side implementation called the python-keystone client. We use this tool to check the status of our Keystone services.

To check that Keystone is running the required services, we invoke the keystone command:

# keystone user-list

This produces output like the following screenshot:

Screenshot_732

Additionally, you can use the following commands to check the status of Keystone. The following command checks the status of the service:

# ps -ef | grep keystone

This should show output similar to the following:

keystone 5441 1 0 Jun20 ? 00:00:04 /usr/bin/python /usr/bin/keystone-all

Next you can check that the service is listening on the network. The following command can be used:

netstat -anlp | grep 5000

This command should show output like the following:

tcp          0       0 0.0.0.0:5000       0.0.0.0:          LISTEN                    54421/python
Checking OpenStack Networking (Neutron)

When running the OpenStack Networking service, Neutron, there are a number of services that should be running on various nodes. These are depicted in the following diagram:

Screenshot_733

On the Controller node, check that the Quantum Server API service is running on TCP Port 9696 as follows:

sudo netstat -anlp | grep 9696

The command brings back output like the following:

tcp          0                    0       0.0.0.0:9696             0.0.0.0:*       LISTEN                 22350/python

On the Compute node, check that the following services are running using the ps command:

ovsdb-server 
ovs-switchd
quantum-openvswitch-agent

For example, run the following command:

ps -ef | grep ovsdb-server

On the Network node, check that the following services are running:

ovsdb-server 
ovs-switchd
quantum-openvswitch-agent 
quantum-dhcp-agent 
quantum-l3-agent quantum-
metadata-agent

To check our Neutron agents are running correctly, issue the following command from the Controller host when you have the correct OpenStack credentials sourced into your environment:

quantum agent-list

This will bring back output like the following screenshot when everything is running correctly:

Screenshot_734

Checking OpenStack Block Storage (Cinder)

To check the status of the OpenStack Block Storage service, Cinder, you can use the following commands:

Use the following command to check if Cinder is running:

ps -ef | grep cinder

This command produces output like the following screenshot:

Screenshot_735

Use the following command to check if iSCSI target is listening:

netstat -anp | grep 3260

This command produces output like the following:

tcp 0 0 0.0.0.0:3260 0.0.0.0:* LISTEN 10236/tgtd

Use the following command to check that the Cinder API is listening on the network:

netstat -an | grep 8776

This command produces output like the following:

tcp                    0 0.0.0.0:8776                       0.0.0.0:*                 LISTEN

To validate the operation of the Cinder service, if all of the above is functional, you can try to list the volumes Cinder knows about using the following:

cinder list

This produces output like the following:

Screenshot_736

Checking OpenStack Object Storage (Swift)

The OpenStack Object Storage service, Swift, has a few built-in utilities that allow us to check its health. To do so, log into your Swift node and run the following commands:

Use the following command for checking the Swift Service

Using Swift Stat:

swift stat

This produces output like the following:

Screenshot_737

Using PS:

Note

There will be a service for each configured container, account, object-store.

ps -ef | grep swift

This should produce output like the following screenshot:

Screenshot_738

Use the following command for checking the Swift API:

ps -ef | grep swift-proxy

This should produce the following screenshot:

Screenshot_739

Use the following command for checking if Swift is listening on the network:

netstat -anlp | grep 8080

This should produce output like the following:

tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 9818/python

How it works…

We have used some basic commands that communicate with OpenStack services to show that they’re running. This elementary level of checking helps with troubleshooting our OpenStack environment better.


 

0 Responses on Checking OpenStack services"

Leave a Message

Your email address will not be published. Required fields are marked *

Copy Rights Reserved © Mindmajix.com All rights reserved. Disclaimer.
Course Adviser

Fill your details, course adviser will reach you.