Openstack monitoring component ceilometer And Folsom combined deployment experience

Source: Internet
Author: User
Tags virtualenv

Previously, the project had been using the Folsom version of openstack for secondary development, and there were significant changes to modules such as Nova. Therefore, after the release of the new version of openstack (grizzly, some new functional modules cannot be quickly transplanted to new projects. Because the system monitoring functions of openstack in earlier versions are relatively weak, kanyun + ganglia and simple monitoring functions provided by openstack have been used for system monitoring, therefore, after the release of the G version brings the monitoring function module ceilometer, You need to combine it with the original system. The following is a combination of deployment experience:

1. download the latest ceilometer code from GitHub.

2. Install MongoDB. Because ceilometer uses MongoDB as the default data persistence database, you must first install MongoDB.

Apt-Get install MongoDB

3. Add a ceilometer user to Keystone

Note:The added ceilometer account must belong to admin tenant. Otherwise, the instance monitoring information cannot be obtained, and the account is added as the reselleradmin role to facilitate swift monitoring information.The added ceilometer account must belong to admin tenant and have the roles reselleradmin and Admin.

View User List

Keystone -- OS-username admin -- OS _password pass -- OS _tenant_name admin -- OS _auth_url http: // localhost: 5000/V2.0 user-list

View the role list

Keystone -- operating-username admin -- OS _password pass -- OS _tenant_name admin -- OS _auth_url http: // localhost: 5000/V2.0
Role-list

View the tanant list

Keystone -- OS-username admin -- OS _password
Pass -- OS _tenant_name admin -- OS _auth_url http: // localhost: 5000/V2.0 tenant-list

Create user

Keystone
-- OS-username admin -- OS _password pass -- OS _tenant_name admin -- OS _auth_url http: // localhost: 5000/V2.0 user-create -- name ceilometer -- email co@co.cn -- tenant-id tid -- pass -- enabled true

Add User Role

Keystone
-- OS-username admin -- OS _password pass -- OS _tenant_name admin -- OS _auth_url http: // localhost: 5000/V2.0 user-role-add -- User-ID uid -- tenant-id tid -- Role-ID RID



4. Install ceilometer

1) First, check the packages that the module depends on.

Vim ceilometer/requirements.txt

d2to1>=0.2.10,<0.3pbr>=0.5,<0.6WebOb>=1.2kombuiso8601argparseSQLAlchemy>=0.7,<=0.7.99sqlalchemy-migrate>=0.7.2pymongo>=2.2eventletanyjson>=0.2.4Flask==0.9pecan>=0.2.0stevedore>=0.7msgpack-pythonpython-glanceclientpython-novaclient>=2.6.10python-keystoneclient>=0.2.3python-swiftclientlxmlrequests>=1.1wsme>=0.5b2pyyamloslo.config>=1.1.0happybase>=0.4

In this version, ceilometer uses the Oslo. config module added in openstack of the G version to read the configuration file.

In addition, the webob version is required to be later than 1.2. Check that the version of this library used by openstack of version F is 1.0.8, which is a big conflict, and found that many people reflect this library is not compatible with the previous library (https://bugs.launchpad.net/ceilometer/+bug/1092227), in my actual installation process also found that this library cannot be Python-novaclient,
Python-glanceclient and other libraries. So I used virtualenv (https://pypi.python.org/pypi/virtualenv) to establish an isolated Python environment to install and run ceilometer and related dependencies.

2) install virtualenv and create an isolation sandbox

Sudo Pip install virtualenv # Install

Virtualenv grizzlyenv # create an isolated environment named grizzlyenv

Source grizzlyenv/bin/activate # enter the grizzlyenv isolation Environment

A prompt will appear before the prompt, as shown in figure

(Grizzlyenv) root @ ceilotest:/OPT #

In this environment, there is a set of environments independent from the global Python environment. Using Pip and easy_install to install Python packages does not affect the global Python environment, after use, use the Deactivate command to exit the global environment. The related usage can be found online.

3) after the isolation environment is installed, you can install ceilometer here.

# Cd ceilometer

# Python setup. py develop

After installation, you can see that all the dependent packages are installed under the grizzlyenv/lib/python2.7/Site-packages/path.

Copy all files under ceilometer/etc/ceilometer/to the/etc/ceilometer/directory (new if no file exists), and change the ceilometer. conf. sample file:

Ceilometer. conf

[DEFAULT]verbose=Truedebug=Trueos_auth_url = http://192.168.5.202:35357/v2.0os_tenant_name = adminos_password = adminos_username = ceilometerpolicy_file = /etc/ceilometer/policy.jsonnotification_topics = notifications,glance_notificationsrabbit_password = adminrabbit_host = 127.0.0.1rabbit_max_retries = 10rpc_backend = ceilometer.openstack.common.rpc.impl_kombu[keystone_authtoken]signing_dir = /etc/ceilometeradmin_tenant_name = adminadmin_password = adminadmin_user = ceilometerauth_protocol = http

4) Start ceilometer

Enable the four tabs in screen and run them in sequence:

Ceilometer-collector

Ceilometer-agent-Central

Ceilometer-agent-compute

Ceilometer-API

Corresponding to the four important modules in the ceilometer architecture, no module named libvirt may occur during the ceilometer-agent-compute startup process, this is because Python-libvirt is not installed in the isolation environment, but it is also found that Pip cannot be used to install this library. However, by running the dpkg-l command, it is found that python-libvirt is indeed installed, therefore, you can directly copy the related files in the global environment to the isolated environment and modify the corresponding permissions:

CP/usr/lib/python2.7/dist-packages/libvirt */opt/stack/grizzlyenv/lib/python2.7/Site-packages/

Chown Stack: Stack/opt/stack/grizzlyenv/lib/python2.7/Site-packages/libvirt *

In this way, the instance can be started normally. After the instance is started, you can view the corresponding data records in MongoDB.

Ceilometer module information:

Wiki https://wiki.openstack.org/wiki/Ceilometer

Doc http://docs.openstack.org/developer/ceilometer/

Src-https://github.com/openstack/ceilometer

The purpose is to build a general framework for openstack Monitoring and Support custom monitoring plug-ins for independent monitoring.

Reprinted please specify good luck :)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.