找回密码
 注册
查看: 5603|回复: 0

Install Ceilometer Enable Compute service meters for Red Hat Enterprise Linux an

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2018-12-23 22:22:13 | 显示全部楼层 |阅读模式
Telemetry uses a combination of notifications and an agent to collect Compute meters. Perform these steps on each compute node.
Install and configure components¶

    % ^. X& r; _7 u: E
  • Install the packages:
    # yum install openstack-ceilometer-compute# yum install openstack-ceilometer-ipmi (optional)( ^+ F( L1 H# I% I' N

    5 y: E, k9 A6 _9 p1 D0 R
  • Edit the /etc/ceilometer/ceilometer.conf file and complete the following actions:

    ! H! |$ `* r+ d

      3 U: \1 s5 G' s/ B- v: m& c
    • In the [DEFAULT] section, configure RabbitMQ message queue access:
      [DEFAULT]...transport_url = rabbit://openstack:RABBIT_PASS@controller6 [6 X3 K* ^7 L; e$ @# W" l# v

      & ?0 D3 c1 @5 _
      Replace RABBIT_PASS with the password you chose for the openstack account in RabbitMQ.
    • In the [service_credentials] section, configure service credentials:
      [service_credentials]...auth_url = http://controller:5000project_domain_id = defaultuser_domain_id = defaultauth_type = passwordusername = ceilometerproject_name = servicepassword = CEILOMETER_PASSinterface = internalURLregion_name = RegionOne! n* ]% K5 v- V# X
      - c  L- u6 @/ d) q
      Replace CEILOMETER_PASS with the password you chose for the ceilometer user in the Identity service.

      - w' ?) Y( ]5 K  Y1 u
    $ i5 O8 j1 q' _& m9 [  x! R; o, P
; T* d/ q) X2 A0 h# d' M
Configure Compute to use Telemetry¶
    ' x% C- i- ]" F
  • Edit the /etc/nova/nova.conf file and configure notifications in the [DEFAULT] section:
    [DEFAULT]...instance_usage_audit = Trueinstance_usage_audit_period = hournotify_on_state_change = vm_and_task_state[oslo_messaging_notifications]...driver = messagingv2
    ! n  o7 P. ^1 l9 f
# R6 g6 ^0 @# X, z: b
Configure Compute to poll IPMI meters¶9 v! F& \4 U; R9 D- a( y

! F+ @* y- G3 ?8 i5 J, aNote$ \: }, \( G$ I5 s; g, R
To enable IPMI meters, ensure IPMITool is installed and the host supports Intel Node Manager.

. P0 K/ B' Y/ t; @$ i; s

    1 w2 X' X# r+ C6 ]1 A- p
  • Edit the /etc/sudoers file and include:
    .. code-block:: ini" X+ A, @3 K7 v1 k; |* f* x7 U

    0 U" ]% i# x+ i" w/ @! [
    ceilometer ALL = (root) NOPASSWD: /usr/bin/ceilometer-rootwrap /etc/ceilometer/rootwrap.conf *
    + R# E2 m; Q! `/ Y+ V. ^1 B$ z
  • Edit the /etc/ceilometer/polling.yaml to include the required meters, for example:
    .. code-block:: yaml
    , E6 |# i+ K$ }2 ]" `+ F5 P3 o' ~! G  s4 @+ @' j+ R

    ( ~# j3 N8 e( G  {9 T
      ) z# ]( J  W' C: K( s' r# y
    • name: ipmi interval: 300 meters:
      ' k* m# Q# W  e& x. k. S

        ' M1 h3 H3 W0 Y3 W* v
      • hardware.ipmi.temperature+ E4 `$ B4 P5 m8 o' j
      : s! G. A: S+ R6 P

      : X2 p. B$ B4 d' w% }; Z; S
    / d1 |2 e7 y* n7 B, L8 z

    ' ~" _3 U9 j: p2 g. R" j

3 l. U3 {! u; X0 gFinalize installation¶

    * r5 T- R: N8 I0 t2 E3 c9 h
  • Start the agent and configure it to start when the system boots:
    # systemctl enable openstack-ceilometer-compute.service# systemctl start openstack-ceilometer-compute.service# systemctl enable openstack-ceilometer-ipmi.service (optional)# systemctl start openstack-ceilometer-ipmi.service (optional)
  • Restart the Compute service:
    # systemctl restart openstack-nova-compute.service# y* @. A3 @, q% Y; j( Y
% R: c* f6 \" n$ t4 K1 M
" [0 W. ?( T5 K' z. c' q& V
0 E# j! }" a8 {9 s( k4 z3 {
This section describes how to install and configure the Telemetry service, code-named ceilometer, on the controller node.
Prerequisites¶
Before you install and configure the Telemetry service, you must configure a target to send metering data to. The recommended endpoint is Gnocchi.
    * A6 Q+ s; r) N3 N1 W
  • Source the admin credentials to gain access to admin-only CLI commands:
    $ . admin-openrc
  • To create the service credentials, complete these steps:
    & M( d3 ]1 Z( T- h

      ) n$ X8 u7 {. N5 [
    • Create the ceilometer user:
      $ openstack user create --domain default --password-prompt ceilometerUser Password:Repeat User Password:+-----------+----------------------------------+| Field     | Value                            |+-----------+----------------------------------+| domain_id | e0353a670a9e496da891347c589539e9 || enabled   | True                             || id        | c859c96f57bd4989a8ea1a0b1d8ff7cd || name      | ceilometer                       |+-----------+----------------------------------+
    • Add the admin role to the ceilometer user.
      $ openstack role add --project service --user ceilometer admin0 j( A1 ?) D5 k- B+ j; g& ?( e5 }
      ( O( Y2 z9 U' ?3 g' z% g
      7 j- H( t" p# K
      + ^+ M6 H$ Z) ~
      Note
      : t) e* ?! J* _0 t* o
      This command provides no output.

      + R4 W- X$ z1 y$ i1 V0 _( b% ^, z3 M
  • Register Gnocchi service in Keystone:

    - L. }% f* M8 S

      ' c) M& v3 J, V8 F+ T
    • Create the gnocchi user:
      $ openstack user create --domain default --password-prompt gnocchiUser Password:Repeat User Password:+-----------+----------------------------------+| Field     | Value                            |+-----------+----------------------------------+| domain_id | e0353a670a9e496da891347c589539e9 || enabled   | True                             || id        | 8bacd064f6434ef2b6bbfbedb79b0318 || name      | gnocchi                          |+-----------+----------------------------------+
    • Create the gnocchi service entity:
      $ openstack service create --name gnocchi \  --description "Metric Service" metric+-------------+----------------------------------+| Field       | Value                            |+-------------+----------------------------------+| description | Metric Service                   || enabled     | True                             || id          | 205978b411674e5a9990428f81d69384 || name        | gnocchi                          || type        | metric                           |+-------------+----------------------------------+
    • Add the admin role to the gnocchi user.
      $ openstack role add --project service --user gnocchi admin
      8 ~" \: \6 e( y, H. R# }6 T% `0 f- K8 M
      / q2 b$ u0 v8 q* X9 j

      7 V: C% z# \+ r2 F+ P' |( DNote
      / T6 m9 l: n3 K0 f
      This command provides no output.
    • Create the Metric service API endpoints:
      $ openstack endpoint create --region RegionOne \  metric public http://controller:8041+--------------+----------------------------------+| Field        | Value                            |+--------------+----------------------------------+| enabled      | True                             || id           | b808b67b848d443e9eaaa5e5d796970c || interface    | public                           || region       | RegionOne                        || region_id    | RegionOne                        || service_id   | 205978b411674e5a9990428f81d69384 || service_name | gnocchi                          || service_type | metric                           || url          | http://controller:8041           |+--------------+----------------------------------+$ openstack endpoint create --region RegionOne \  metric internal http://controller:8041+--------------+----------------------------------+| Field        | Value                            |+--------------+----------------------------------+| enabled      | True                             || id           | c7009b1c2ee54b71b771fa3d0ae4f948 || interface    | internal                         || region       | RegionOne                        || region_id    | RegionOne                        || service_id   | 205978b411674e5a9990428f81d69384 || service_name | gnocchi                          || service_type | metric                           || url          | http://controller:8041           |+--------------+----------------------------------+$ openstack endpoint create --region RegionOne \  metric admin http://controller:8041+--------------+----------------------------------+| Field        | Value                            |+--------------+----------------------------------+| enabled      | True                             || id           | b2c00566d0604551b5fe1540c699db3d || interface    | admin                            || region       | RegionOne                        || region_id    | RegionOne                        || service_id   | 205978b411674e5a9990428f81d69384 || service_name | gnocchi                          || service_type | metric                           || url          | http://controller:8041           |+--------------+----------------------------------+& n9 ~4 z  k: n6 k8 n% e

    " |8 {% z% R- X
9 Q) ]$ J$ `  }6 e! l' n: G1 F3 ?' Q: F
Install Gnocchi¶

    + p; l6 i$ ?% k
  • Install the Gnocchi packages. Alternatively, Gnocchi can be install using pip:
    # yum install openstack-gnocchi-api openstack-gnocchi-metricd \  python-gnocchiclient: l  L/ \2 g6 h( \) u6 \
    ) d1 \8 g% N) b9 @$ E
    6 o8 M8 q0 g. d3 v3 s4 I3 {
    . G4 x4 e& l8 k, {1 c% Z, F: U
    Note
    ! y2 `" W) X5 n0 v
    Depending on your environment size, consider installing Gnocchi separately as it makes extensive use of the cpu.

    , H' |, m' H# J

    : q0 h3 N) h% e7 C3 O5 e5 |/ [8 _
  • Create the database for Gnocchi’s indexer:

    " k8 B  B) n4 I$ t" l; @5 Q

      9 |5 v9 p% \0 r- D" z# c9 F, e6 c* d
    • Use the database access client to connect to the database server as the root user:
      $ mysql -u root -p
    • Create the gnocchi database:
      CREATE DATABASE gnocchi;
    • Grant proper access to the gnocchi database:
      GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'localhost' \  IDENTIFIED BY 'GNOCCHI_DBPASS';GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'%' \  IDENTIFIED BY 'GNOCCHI_DBPASS';. o# f; U: h/ E- M' k" Z$ ~6 a
      & r. H$ J  o6 m: B: y5 g4 `
      Replace GNOCCHI_DBPASS with a suitable password.
    • Exit the database access client.

      , s7 h" j! k$ f0 A/ f% Y1 u+ [& M
  • Edit the /etc/gnocchi/gnocchi.conf file and add Keystone options:

    7 j, n* K* O; \4 `0 z4 s- K

      * C1 ^. ^' n' ?2 q# S  l! Y) J
    • In the [api] section, configure gnocchi to use keystone:
      [api]auth_mode = keystone
    • In the [keystone_authtoken] section, configure keystone authentication:
      [keystone_authtoken]...auth_type = passwordauth_url = http://controller:5000/v3project_domain_name = Defaultuser_domain_name = Defaultproject_name = serviceusername = gnocchipassword = GNOCCHI_PASSinterface = internalURLregion_name = RegionOne* J8 H' A0 D1 `" U" _7 z! {

      % g4 U  V- ^4 j" q- ]; _' g) E
      Replace GNOCCHI_PASS with the password you chose for the gnocchi user in the Identity service.
    • In the [indexer] section, configure database access:
      [indexer]url = mysql+pymysql://gnocchi:GNOCCHI_DBPASS@controller/gnocchi
      & P6 {' f  T8 F  b! \& C) h  H+ M3 c9 D. Z. b+ C4 Q' T/ i% f5 ]& R
      Replace GNOCCHI_DBPASS with the password you chose for Gnocchi’s indexer database.
    • In the [storage] section, configure location to store metric data. In this case, we will store it to the local file system. See Gnocchi documenation for a list of more durable and performant drivers:
      [storage]# coordination_url is not required but specifying one will improve# performance with better workload division across workers.coordination_url = redis://controller:6379file_basepath = /var/lib/gnocchidriver = file
      * L) @( a, t% w7 O4 n
  • Initialize Gnocchi:
    gnocchi-upgrade
    3 V( L" F; j+ f7 [3 a
. f" O) w, [1 ?+ Y' h4 c
Finalize Gnocchi installation¶

    * @, L! t) J# \7 ?3 A1 d* u
  • Start the Gnocchi services and configure them to start when the system boots:
    # systemctl enable openstack-gnocchi-api.service \  openstack-gnocchi-metricd.service# systemctl start openstack-gnocchi-api.service \  openstack-gnocchi-metricd.service1 e5 t/ B. {+ M: t4 J
) F+ @3 ]. ~. W5 _( I
Install and configure components¶

    7 J: G8 {% G7 d- p0 N4 g: }+ }+ j
  • Install the Ceilometer packages:
    # yum install openstack-ceilometer-notification \  openstack-ceilometer-central
    " u* [7 z* ^) _8 r' c+ ?# z' ]4 `
    9 A2 D2 l' N. l
  • Edit the /etc/ceilometer/pipeline.yaml file and complete the following section:
    2 D4 N. D# a% z2 \2 M. j* m9 B3 e
      : E1 K, r8 @! b. c! f& Q4 r
    • Configure Gnocchi connection:
      publishers:    # set address of Gnocchi    # + filter out Gnocchi-related activity meters (Swift driver)    # + set default archive policy    - gnocchi://?filter_project=service&archive_policy=low
      3 y+ M( N# R7 |5 B+ m3 l4 F; _
  • Edit the /etc/ceilometer/ceilometer.conf file and complete the following actions:

    ! c' }% g4 b: ~2 S" J" S

      0 C# Z$ I7 x+ E& N; `9 J: [& ]8 P: [) x& g
    • In the [DEFAULT] section, configure RabbitMQ message queue access:
      [DEFAULT]...transport_url = rabbit://openstack:RABBIT_PASS@controller  n) \" {/ m2 a+ S, c
      ; P# D" p4 S, W6 w2 m
      Replace RABBIT_PASS with the password you chose for the openstack account in RabbitMQ.
    • In the [service_credentials] section, configure service credentials:
      [service_credentials]...auth_type = passwordauth_url = http://controller:5000/v3project_domain_id = defaultuser_domain_id = defaultproject_name = serviceusername = ceilometerpassword = CEILOMETER_PASSinterface = internalURLregion_name = RegionOne* K& ]1 V+ U5 _3 ^

      : x$ a. T6 |4 d+ e- b5 L! r
      Replace CEILOMETER_PASS with the password you chose for the ceilometer user in the Identity service.

      4 z! p* s& n% d( I" D! _2 c3 U
  • Create Ceilometer resources in Gnocchi. Gnocchi should be running by this stage:
    # ceilometer-upgrade
    6 i" z" q6 H7 h4 w

& }6 ~& f% J; |2 OFinalize installation¶
    5 X$ i$ y" |% k2 Y! B4 C, o
  • Start the Telemetry services and configure them to start when the system boots:
    # systemctl enable openstack-ceilometer-notification.service \  openstack-ceilometer-central.service# systemctl start openstack-ceilometer-notification.service \  openstack-ceilometer-central.service  y, G9 W! X$ l- I2 b1 f* ~: q

! v) V  u& M$ y5 k
/ @! [5 C) q4 G5 r/ c0 w
Telemetry uses notifications to collect Block Storage service meters. Perform these steps on the controller and Block Storage nodes.

+ |. a" R% S$ B
3 K+ O9 ?$ p8 y, ~. c1 INote
) V) I' A6 |% _+ Y
Your environment must include the Block Storage service.
4 ]5 C9 y9 \# ~7 Y
Configure Cinder to use Telemetry¶
Edit the /etc/cinder/cinder.conf file and complete the following actions:
  • In the [oslo_messaging_notifications] section, configure notifications:
    [oslo_messaging_notifications]...driver = messagingv2' g3 x! t8 `" ?5 t4 `
    : U  G9 g4 B8 i( Q
    - _$ [; p: @/ ^
  • Enable periodic usage statistics relating to block storage. To use it, you must run this command in the following format:
    $ cinder-volume-usage-audit  --start_time='YYYY-MM-DD HH:MM:SS' \  --end_time='YYYY-MM-DD HH:MM:SS' --send_actions
    & i1 w% y5 F% X, `9 M9 o! y# P! x' p7 F: P9 y. I2 k
    This script outputs what volumes or snapshots were created, deleted, or exists in a given period of time and some information about these volumes or snapshots.
    Using this script via cron you can get notifications periodically, for example, every 5 minutes:
    */5 * * * * /path/to/cinder-volume-usage-audit --send_actions& R2 Q7 }/ B% \0 F: y& V  u/ I

    6 }; v; s# I- f! L2 P; r4 E  e, E3 b& D8 J' f

9 C. w+ W& f) b, s8 xFinalize installation¶
  • Restart the Block Storage services on the controller node:
    # systemctl restart openstack-cinder-api.service openstack-cinder-scheduler.service8 t' }- g1 c. G$ q- \: U
    6 b* i8 u2 \+ \: @& k7 ^: c' ]; q
  • Restart the Block Storage services on the storage nodes:
    # systemctl restart openstack-cinder-volume.service
    : J3 C1 \, D  K7 s5 h; y2 Z! J9 Q5 y; l5 s; Z" [) H

    . L* U+ ~3 ~8 J5 ?

( S) J$ q1 |# }; S+ ]: j
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 01:01 , Processed in 0.018250 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表