找回密码
 注册
查看: 5600|回复: 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¶

    . o- h/ S& j( K- S, R! ?  F7 s6 ]/ w
  • Install the packages:
    # yum install openstack-ceilometer-compute# yum install openstack-ceilometer-ipmi (optional)
    " L3 {# r) j+ y9 A+ n$ @3 b

      J2 Z0 X* a, k% j- q
  • Edit the /etc/ceilometer/ceilometer.conf file and complete the following actions:
    - o' x6 ~: C8 R, K  B1 p2 O  a+ {

      $ F) Y) x$ Z; d3 P+ W9 f
    • In the [DEFAULT] section, configure RabbitMQ message queue access:
      [DEFAULT]...transport_url = rabbit://openstack:RABBIT_PASS@controller
      1 I  Z* A' n; m) C4 N* [& u
        c$ R- q+ \3 l; R
      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 = RegionOne3 I: v# V/ G, H- Y! U# ^, H
      # V  q7 E4 ?8 ?: _  R; U. C. q! L
      Replace CEILOMETER_PASS with the password you chose for the ceilometer user in the Identity service.
      & a+ f9 y" N) |' I+ s5 J

    $ H/ x+ m. t& r8 \

$ h  {+ }% D; `, N9 rConfigure Compute to use Telemetry¶
    ( f! Q" f, f6 \( y0 p
  • 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 = messagingv28 E) R0 W6 n3 M' N, ]

7 K* _( l6 R# k& j" @Configure Compute to poll IPMI meters¶
7 i% l* c) E! N6 |9 c% Z/ x+ G
/ X, X7 m" f2 Z( bNote
4 r. h8 v: I, m: y+ P- V
To enable IPMI meters, ensure IPMITool is installed and the host supports Intel Node Manager.
" W6 r8 x0 N9 U  S, t
    1 x# x0 o% C6 y: g: c, ~* [; B
  • Edit the /etc/sudoers file and include:
    .. code-block:: ini) e. ?% t3 ]# W, l
    ( I& M" q" t6 |0 t9 R: N5 d8 K
    ceilometer ALL = (root) NOPASSWD: /usr/bin/ceilometer-rootwrap /etc/ceilometer/rootwrap.conf *

    7 T, f# R9 Q& T1 C4 {
  • Edit the /etc/ceilometer/polling.yaml to include the required meters, for example:
    .. code-block:: yaml
    * h$ s/ L2 @' t. X2 e1 V  w3 g- z* \+ H
    7 _, h9 [' t+ w+ D+ y7 m

      / ?0 P$ r+ B: P+ N
    • name: ipmi interval: 300 meters:

      $ h/ B* C! e7 G

        & w4 z5 A$ [$ ^3 d1 G. k8 b7 [
      • hardware.ipmi.temperature
        # _. |0 r- u! A. B# N# L

      & J; l; T4 s- l) p: D

      1 r& _+ w8 |! }2 ^4 q' V6 g6 c2 m

    ( P( E9 g; d% f

    6 O, b* z* |- _

/ \4 `) _" i( ^! ~Finalize installation¶

    0 ]- x! Z$ i) a' @* O' V
  • 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& [2 B9 y. ~7 J/ \+ u

) Z. R& x; b, a0 L, h. ^1 w1 n( U) y. K4 j2 Z

( K& t, I% g2 l
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.
    $ V" h' [% Q) S+ O8 C5 t& O5 a
  • Source the admin credentials to gain access to admin-only CLI commands:
    $ . admin-openrc
  • To create the service credentials, complete these steps:

    2 B: e  r# q) u: \$ ]- t) E

      4 R; b8 p* v9 E1 H; L# t
    • 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 admin
      ; v: R- J0 C9 o5 P/ S" T4 s& u
      2 A1 h$ I0 t* G! p( r1 w. w1 U2 y2 Z; ~
      ) u# A" e$ ~! [: h) `, A
      Note
      6 O" e0 O" }. Q' X( e  G8 n' M
      This command provides no output.
      * V+ T; W. ^4 H
  • Register Gnocchi service in Keystone:

    ; H: ?/ I+ x- u/ C
      ! o/ ]0 J' S6 ^  K( S3 `* L( c5 ?
    • 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
      # G6 _% v3 O/ R/ k9 o( ~  u6 o& _  s1 `+ l" w5 o1 w8 K
      1 t5 d  f' H% L* z

      $ b0 c; a( |4 T" Y% A" F0 H: J" V9 UNote. }4 Y) m  N3 [/ N/ X4 d+ i. s7 A
      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           |+--------------+----------------------------------+
      - i2 T/ w# v! O9 G* o
    ' n3 T! k6 I* W0 j

# z1 H% r7 o& c+ u: m% @1 @Install Gnocchi¶
    9 ^# g& e( b# K1 m: M( L" D- C
  • Install the Gnocchi packages. Alternatively, Gnocchi can be install using pip:
    # yum install openstack-gnocchi-api openstack-gnocchi-metricd \  python-gnocchiclient
    5 }3 N+ O, v- n7 B8 q7 d) E
    ; D) A; {8 A: ~' b. k2 [1 K/ T9 W$ _1 {( @% p
    : b. I4 u9 S" s4 i6 k5 W/ i
    Note( [( E2 l0 \: L! p/ F0 w
    Depending on your environment size, consider installing Gnocchi separately as it makes extensive use of the cpu.
    6 c* U8 K/ B( e3 y6 Z5 H  y
    ! z% ?1 c) {) G" C7 U3 j" n7 x% ]
  • Create the database for Gnocchi’s indexer:
    * d1 g' `3 g+ A. I0 ~  S% [& v

      . W, i( g2 U+ ~% ~' p6 ]! S
    • 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';) q. N- Z/ r0 d) _7 e' ?5 V; s0 ?
      $ t% d' x4 L/ Q" w+ n
      Replace GNOCCHI_DBPASS with a suitable password.
    • Exit the database access client.
      8 s0 n( w' x1 c! y& x3 j
  • Edit the /etc/gnocchi/gnocchi.conf file and add Keystone options:

    " q" O2 _5 [  U* `/ U
      % e4 B/ J( Q3 K( \# Y9 d/ f
    • 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
      9 g+ J' _1 b& ?1 V. Y3 D" L
      " G, l! o4 I9 O5 C" y; l6 a% J
      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
      6 h! M4 ^, M- @  c4 v: f
      . v# Z/ Q* l$ A3 a5 R( g. j
      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
      2 I+ A4 v( ]( W/ g. C
  • Initialize Gnocchi:
    gnocchi-upgrade# b9 e6 l9 U1 E# V$ W3 q$ Z
% b. k$ F8 y6 `; c* q; q+ m
Finalize Gnocchi installation¶

    7 L) |. a7 u0 h0 C, q
  • 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.service
    7 S$ J/ ~8 i0 @0 ^; i& g$ s
& v$ L4 S' z+ ]; h( ?- ]; `
Install and configure components¶
    % G/ J4 x' g9 ^; o) }* v" p% |
  • Install the Ceilometer packages:
    # yum install openstack-ceilometer-notification \  openstack-ceilometer-central
    7 f, {- |( x) M$ U* M% b

    ! _) y2 }, x) X3 M) m/ t7 {
  • Edit the /etc/ceilometer/pipeline.yaml file and complete the following section:

    ' |: g; e' R" {: |; ]1 L
      0 A0 d7 e5 ]$ W5 z. b" b3 b
    • 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. O& a" L* ], J- ?. m" w/ }
  • Edit the /etc/ceilometer/ceilometer.conf file and complete the following actions:
    2 X: @) \$ L* @

      . \9 L$ Z/ A, N; @5 v; X
    • In the [DEFAULT] section, configure RabbitMQ message queue access:
      [DEFAULT]...transport_url = rabbit://openstack:RABBIT_PASS@controller
      ! ~- q- C: Q; @6 u+ G" U4 e+ a) D4 ]4 F7 ~& m( N
      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 = RegionOne9 m  M8 B. q) A+ j( A4 n

      ( t3 A6 x( \8 E, o* W* L1 E  H# t
      Replace CEILOMETER_PASS with the password you chose for the ceilometer user in the Identity service.

      8 {3 t  y8 ^, D( K/ v3 Q
  • Create Ceilometer resources in Gnocchi. Gnocchi should be running by this stage:
    # ceilometer-upgrade, h& X. c+ t, t8 V) B

6 }# U" ~0 A0 oFinalize installation¶
    # b# W. \8 g3 R2 W/ I1 y2 Q
  • 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" |" |- r1 P9 _+ [5 E/ c
7 b; ?3 {4 p: e' y) f

8 g. ]3 d( @3 }/ u, `
Telemetry uses notifications to collect Block Storage service meters. Perform these steps on the controller and Block Storage nodes.
2 @9 D) u, o6 P2 ]  v* n

0 x) R3 g2 M) @8 ^1 ^; T0 X& bNote
  q7 T: e$ n" p" f
Your environment must include the Block Storage service.

7 P& L4 Z& l* n* A+ c8 dConfigure 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- z* l% ~+ ^7 f4 G7 R& O2 k

    & ^' q2 E$ u  I! G5 q. L
    $ n6 w1 o( p3 g4 U3 n! I3 C
  • 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, O: {! E( c9 u) X$ ?
    + V. Q/ K1 k# @, F8 `/ J4 Z$ A
    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) |0 m" j3 {/ U! m7 w6 F$ g
    & |! X7 {, D- p6 r
    ( Z; @6 \$ }3 f- L2 z- I% F+ V
7 U' r6 v- X( g' I0 i( r. _
Finalize installation¶
  • Restart the Block Storage services on the controller node:
    # systemctl restart openstack-cinder-api.service openstack-cinder-scheduler.service% B4 J% F0 s+ u# I* H

    & w9 Y1 q4 R6 A. A$ @
  • Restart the Block Storage services on the storage nodes:
    # systemctl restart openstack-cinder-volume.service
    6 j  B9 h7 g0 q- p( g, a  ?6 Z# E! ]8 p9 y

    8 B9 m  K& ]4 u) v0 j' }
' {& d9 K+ W4 D) R; {
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 00:01 , Processed in 0.019891 second(s), 24 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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