centos7 安装配置openstack-ceilometer (官网openstack-juno版)

Before you install andconfigure Telemetry, you must install MongoDB, create a MongoDB database, andcreate Identity service credentials including endpoints.

1.       Install the MongoDBpackage:

#   yum install mongodb-server mongodb

2.       Edit the /etc/mongodb.conf file and complete the following actions:

a.        Configure the bind_ip key to use the management interface IP address of the controllernode.

bind_ip =10.0.0.11

b.        By default, MongoDB createsseveral 1 GB journal files in the /var/lib/mon- godb/journal directory. If you want to reduce the size of each journal file to128 MB and limit total journal space consumption to 512 MB, assert the small-
files key:

smallfiles = true

You can also disable journaling. For more information, see theMongoDB manual.

c.         Start the MongoDB servicesand configure them to start when the system boots:

#  service mongod start

#  chkconfig mongod on

3.       Create the ceilometer database:

#  mongo--host controller --eval ‘db =db.getSiblingDB("ceilometer"); db.addUser({user:"ceilometer", pwd: "CEILOMETER_DBPASS",
roles:        [ "readWrite","dbAdmin" ]})‘

Replace ceil〇meter_dbpass with asuitable password.

4.         Source the admin credentials to gain access to admin-only CLI commands:

$ source admin-openrc.sh

5.         To create the Identityservice credentials:

a.        Create the ceilometer user:

$ keystone user-create --name ceilometer --pass CEILOMETER_PASS
Replace CEILOMETER—PASS with a suitable password.

b.       Link the ceilometer user to the service tenant and admin role:

$ keystone user-role-add --user ceilometer --tenant service--role admin

c.        Create the ceilometer service:

$ keystone service-create --name ceilometer --type metering\ --description "Telemetry"

d.       Create the Identity serviceendpoints:

$ keystone endpoint-create \

--service-id $(keystone service-list | awk ‘/metering / {print $2}‘) \

--publicurl
http://controller:8777 \

--internalurl http://controller:81H\

--adminurl
http://controller:8111 \

--region regionOne

To install and configure the Telemetry modulecomponents

1.         Install the packages:

# yum installopenstack-ceilometer-api openstack-ceilometer-collector \openstack-ceilometer-notification openstack-ceilometer-central

openstack-ceilometer-alarm \ python-ceilometerclient

2.         Generate a random value touse as the metering secret:

#   openssl rand -hex 10

3.       Edit the /etc/ceilometer/ceilometer.conf file andcomplete the following ac-tions:

a. In the [database] section, configure database access:

[database]

connection = mongodb://ceilometer:                              
701LOME

ceilometer

Replace CEILOMETER—DBPASS withthe password you chose for the Telemetry module database.

b In the [default] section, configure RabbitMQmessage broker access:

[DEFAULT]

rpc_backend = rabbit

rabbit_host=                                
controller

rabbit_password = RABBIT_PASS

Replace ra^bbit_pa^SS with the password youchose for the guestaccount in RabbitMQ.

a.        In the [DEFAULT] and [keystone_authtoken]sections, configure Identity service access:

[DEFAULT]

auth_strategy = keystone [keystone_authtoken]

auth_uri = http:// controller:SO 00/v2.0

identity_uri = http://
controller:3S3S1

admin_tenant_name = service admin_user = ceilometeradmin_password = CEIL〇METER_PASS

Replace CEILOmeter_pass with thepassword you chose for the celiometer user in theIdentity service.

Note

Comment out any auth_host, auth_port, and auth_protocoloptions because the identity_uri option replaces them.

b.       In the [service_credentials] section, configure service credentials:

[service_credentials]

os_auth_url = http://                               
controller:SO 00/v2.

os_username = ceilometer os_tenant_name = serviceos_password = CEIL〇METER_PASS

Replace CEIL〇meter_pass with thepassword you chose for the ceilometer user in theIdentity service.

c.        In the [publisher] section, configure the metering secret:

[publisher]

metering_secret= METERING_SECRET

Replace metering_Secret with therandom value that you generated in a pre-vious step.

OpenStack Installation Guide for Red Hat Enterprise Linux, CentOS,and Fedora

To finalize installation

? Start the Telemetryservices and configure them to start when the system boots:

#  systemctlenable openstack-ceilometer-api.service openstack-ceilometer-notification.service \

openstack-ceilometer-central.serviceopenstack-ceilometer-collector. service \

openstack-ceilometer-alarm-evaluator.serviceopenstack-ceilometer-alarm- notifier.service

#  systemctlstart openstack-ceilometer-api.service openstack-ceilometer- notification.service\

openstack-ceilometer-central.serviceopenstack-ceilometer-collector. service \

openstack-ceilometer-alarm-evaluator.serviceopenstack-ceilometer-alarm- notifier.service

Installthe Compute agent for Telemetry

Telemetry iscomposed of an API service, a collector and a range of disparate agents. Thissection explains how to install and configure the agent that runs on thecompute node.

To configure prerequisites

1.       Install the package:

#  yum installopenstack-ceilometer-compute python-ceilometerclient python- pecan

2.       Edit the /etc/nova/nova.conf file and add the following lines to the [default] section:

[default]

instance_usage_audit = Trueinstance_usage_audit_period = hour notify_on_state_change = vm_and_task_state

notification_driver = nova.openstack.common.notifier.rpc_notifiernotification_driver = ceilometer.compute.nova_notifier

3.       Restart the Computeservice:

#  systemctl restart openstack-nova-compute.service

To configure the Computeagent for Telemetry

Edit the /etc/ceilometer/ceilometer.conf file andcomplete the following actions:

1.       In the [publisher] section, set the secret key for Telemetry service nodes:

[publisher]

#  Secretvalue for signing metering messages (string value) metering_secret = CEIL〇METER_T〇KEN

Replace CEIL〇meter_t〇k^en with theceilometer token that you created previously.

2.       In the [default] section, configure RabbitMQ broker access:

[DEFAULT]

rabbit_host =                            
controller

rabbit_password= RABBIT_PASS

Replace ra^bbit_pa^sS with the password youchose for the guest account in Rabbit- MQ.            —

3.       In the [keystone_authtoken] section, configure Identity service access:

[keystone_authtoken]

auth_uri = http://controller:5000/v2.0

identity_uri = http://                           
controller:3 S3 SI

admin_tenant_name = service admin_user = ceilometeradmin_password = CEIL〇METER_PASS

Replace 〇eil〇meter_pa^sS with the password you chose for the Telemetry module database.

Note

Comment outthe auth_host, auth_port, and auth_protocolkeys, since they are replaced by the identity_uri and auth_urikeys.

4.       In the [service_credentials] section, configure service credentials:

[service_credentials]

os_auth_url =
http://controller:5000/v2.0 os_username = ceilometer os_tenant_name = serviceos_password = CEIL〇METER_PASS
os_endpoint_type= internalURL

Replace CEILOMETER_PASSwith the password you chose for the ceilometer user in the Identity service.

To finish installation

? Start the service andconfigure it to start when the system boots:

#   systemctl enableopenstack-ceilometer-compute.service

#   systemctl start openstack-ceilometer-compute.service

Configurethe Image Service for Telemetry

1.       To retrieve image samples,you must configure the Image Service to send notifications to the bus.

Edit /etc/glance/glance-api.conf and modify the
[DEFAULT]section:

notification_driver = messaging rpc_backend =rabbit

rabbit_host =                            
controller

rabbit_password= RABBIT_PASS

2.       Restart the Image Serviceswith their new settings:

OpenStack Installation Guide for Red Hat Enterprise Linux, CentOS,and Fedora

#systemctl restart registry.service

Add theBlock Storage service agent for Telemetry

1.       To retrieve volume samples,you must configure the Block Storage service to send noti-fications to the bus.

Edit /etc/cinder/cinder.confand add in the [DEFAULT] sectionon the con-troller and volume nodes:

control_exchange = cinder

notification_driver = cinder.openstack.common.notifier.rpc_notifier

2.       Restart the Block Storageservices with their new settings.

On the controller node:

#   systemctl restart openstack-cinder-api.serviceopenstack-cinder- scheduler.service

On the storage node:

#  systemctlrestart openstack-cinder-volume.service

3.       If you want to collectOpenStack Block Storage notification on demand, you can usecinder-volume-usage-audit from OpenStack Block Storage. For more information,

BlockStorage audit script setup to get notifications.

Configure the ObjectStorage service for Teleme-try

1.       Install thepython-ceilometerclient package on your Object Storage proxy server:

# yum install python-ceilometerclient

2.       To retrieve object storestatistics, the Telemetry service needs access to Object Stor-age with the ResellerAdmin role. Give this role to your os_username userfor the

os_tenant_name tenant:

$ keystone   
role-create--name ResellerAdmin

+--------- +---------------------------------- +

| Property |             
Value               |

+--------- +---------------------------------- +

|    id    |  462fa46c13fd4798a95a3bfbe27b5e54 |

|   name   丨         
ResellerAdmin           |

+--------- +---------------------------------- +

$keystone user-role-add--tenant service --user ceilometer \

--role 462fa46c13fd4798a95a3bfbe27b5e54

3.       You must also add theTelemetry middleware to Object Storage to handle incoming and outgoing traffic.Add these lines to the /etc/swift/proxy-server.conf file:

OpenStack Installation Guide for Red Hat Enterprise Linux, CentOS,and Fedora

[filter:ceilometer]use = egg:ceilometer#swift

4.       Add ceilometer tothe pipeline parameter of that same file:

[pipeline:main]

pipeline = healthcheck cache authtoken keystoneauthceilometer proxy- server

5.       Add the system user swift to the system group ceilometer to giveObject Storage access to the ceilometer.conf file.

#   usermod -a -G ceilometer swift

6.       Add ResellerAdmin to the operator_roles parameter of that samefile:

operator_roles =Member,admin,swiftoperator,_member_,ResellerAdmin

7.       Restart the service withits new settings:

#   systemctl restart openstack-swift-proxy.service

Verifythe Telemetry installation

To test the Telemetryinstallation, download an image from the Image Service, and use the ceilometercommand to display usage statistics.

1. Use the ceilometer meter-list command to test the access to Telemetry:

$ ceilometer meter-list

2.       Download an image from theImage Service:

$ glanceimage-download "cirros-0.3.3-x86_64" > cirros.img

3.       Call the ceilometer meter-list command again to validate that the download has been detected andstored by the Telemetry:

$ ceilometermeter-list

+---------------
+------ +----- +--------------------------------------

+-------- +---------------------------------- +

| Name          
|  Type  |  Unit |                            ResourceID |

User ID | Project ID                       
|

+---------------
+------ +----- +--------------------------------------

+-------- +---------------------------------- +

|   image                  |  gauge   |  image |    acafc7c0-40aa-4026-9673-b879898e1fc2        |

None        |     efa984b0a914450e9a47788ad330699d  |

|   image.download |     delta   |  B          |    acafc7c0-40aa-4026-9673-b879898e1fc2      |

None        |     efa984b0a914450e9a47788ad330699d  |

|   image.serve          |    delta   |  B          |    acafc7c0-40aa-4026-9673-b879898e1fc2      |

None        |     efa984b0a914450e9a47788ad330699d  |

|   image.size            |  gauge   |  B          |    acafc7c0-40aa-4026-9673-b879898e1fc2      |

None        |     efa984b0a914450e9a47788ad330699d  |

4.       You can now get usagestatistics for the various meters:


$ ceilometer statistics -m image.download -p 60

版权声明:本文为博主原创文章,未经博主允许不得转载。

时间: 2024-07-30 18:15:29

centos7 安装配置openstack-ceilometer (官网openstack-juno版)的相关文章

centos7 安装配置openstack-dashboard (官网openstack-juno版)

System requirements Before you install theOpenStack dashboard, you must meet the following system require-ments: ? OpenStack Compute installation.Enable the Identity Service for user and project man-agement. Note the URLs of the IdentityService and C

Centos7安装配置gitlab

Centos7安装配置gitlab 这篇文字我会介绍在Centos7上安装gitlab,配置gitlab的smtp,并且创建项目demo. sudo yum install openssh-server sudo yum install postfix sudo yum install cronie sudo service postfix start sudo chkconfig postfix on sudo lokkit -s http -s ssh 使用清华大学gitlab的镜像http

Centos7 安装配置OpenLdap服务及OpenLdap管理工具

我们上一篇文章中介绍了,Centos7+Openvpn使用Windows AD(LDAP)验证登录的配置介绍.说到LDAP服务,我们知道不止windows有,linux下也有,比如openldap,sambaLDAP服务,具体就不多介绍了,我们今天主要介绍一下Centos7 安装配置OpenLdap及Ldap管理工具等操作,为后面的Centos7+Openvpn+openldap验证登录做好基础. 我们首先配置一个指定源,我们源地址指向了阿里云的仓库源 cd /etc/yum.repos.d v

Centos7安装配置Apache+PHP+Mysql+phpmyadmin

转载自: Centos7安装配置Apache+PHP+Mysql+phpmyadmin 一.安装Apache yum install httpd 安装成功后,Apache操作命令: systemctl start httpd //启动apache systemctl stop httpd //停止apache systemctl restart httpd //重启apache systemctl enable httpd //设置apache开机启动 异常处理我再阿里云上配置并出现启动Apac

CentOS7安装配置redis-3.0.0

清园 沉没的Atlantis CentOS7安装配置redis-3.0.0 一.安装必要包 yum install gcc 二.linux下安装 #下载 wget http://download.redis.io/releases/redis-3.0.0.tar.gz tar zxvf redis-3.0.0.tar.gz cd redis-3.0.0 #如果不加参数,linux下会报错 make MALLOC=libc  安装好之后,启动文件 #启动redis src/redis-server

CentOS7安装配置DNS服务器

准备工作(假设名称为bigcloud.local) #更改主机名称 #vi /etc/sysconfig/network # Created by anaconda NETWORKING=yes HOSTNAME=bigcloud.local #修改文件/etc/hosts,内容如下: 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1         localhost local

在CentOS7中安装MySQL, 基于MySQL官网文档

目录 在CentOS7中安装MySQL, 基于官网文档 前言 开始 准备工作 下载安装 配置 在CentOS7中安装MySQL, 基于官网文档 前言 版本 CentOS7, 安装于windows的VMWare MySQL5.7.13 个人小创举 这次安装经历很多困难, 一开始, 惯性思维+懒惰, 不愿意多费力费脑, 在中文网站找别人咀嚼过的解决方案, 但都被各种来回抄的答案坑惨. 后来没办法硬着头皮看MySQL官网的文档, 一开始还是用浏览器的全页翻译, 也很惨. 反而, 后来换成英文原文越看越

CentOS下安装和配置MySQL-JDK-Tomcat-Nginx(个人官网环境搭建手冊)

今天,又一次弄我的个人云主机的环境.准备运营自己用Java写的个人官网等站点. 服务器环境:阿里云CentOS 6.4位 包含以下脚本在内的绝大部分命令和脚本,都是我亲自运行过,靠谱的. 完整的"运营运维"经验,请參考我的CSDN博客-运营运维 分类:http://blog.csdn.net/FansUnion/article/category/1714547 1.mysql 1.1 安装mysql yum install mysql-server 1.2 启动mysql,服务名字是&

CentOS下安装和配置MySQL-JDK-Tomcat-Nginx(个人官网环境搭建手册)

今天,重新弄我的个人云主机的环境,准备运营自己用Java写的个人官网等网站. 服务器环境:阿里云CentOS 6.4位 包括以下脚本在内的绝大部分命令和脚本,都是我亲自执行过,靠谱的. 完整的"运营运维"经验,请参考我的CSDN博客-运营运维 分类:http://blog.csdn.net/FansUnion/article/category/1714547 1.mysql 1.1 安装mysql yum install mysql-server 1.2 启动mysql,服务名字是&q