找回密码
 注册
查看: 5601|回复: 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¶
    ! G& C( [. v$ \% L( R" e6 n
  • Install the packages:
    # yum install openstack-ceilometer-compute# yum install openstack-ceilometer-ipmi (optional)  V& V1 Z% r; o9 J, z4 G& f3 ~
    4 ]4 a7 [2 ~  F# N  K! R4 T# n/ M
  • Edit the /etc/ceilometer/ceilometer.conf file and complete the following actions:
    - D+ ~( _0 j& V% W7 Y$ c0 f+ o" H
      4 E- N/ I) }+ G/ j% e2 h# y. E
    • In the [DEFAULT] section, configure RabbitMQ message queue access:
      [DEFAULT]...transport_url = rabbit://openstack:RABBIT_PASS@controller( k8 x5 N# m# N" }0 k) s9 @$ c7 T) C* R% [
      2 C2 t. D* n3 [$ b2 x) [3 F
      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
      8 z! K7 T  v% x" D/ a
      0 M/ `) W+ m6 ]7 ?0 q) `, ~
      Replace CEILOMETER_PASS with the password you chose for the ceilometer user in the Identity service.

      0 z7 ]6 R+ B+ w( U

    8 @* z  g; x8 R4 @) q1 G2 ]6 M
' r) c# Y3 x; i! x2 N3 v
Configure Compute to use Telemetry¶
    & v! M7 ?5 U  u$ e
  • 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 = messagingv25 h9 }4 h: l3 d9 F& W- _

+ X; g9 t/ t" B5 g) M9 {8 e; ]Configure Compute to poll IPMI meters¶- P; w# k* I% h  ?9 v* L

. A' j) y0 d9 VNote" L$ O" E% S7 j6 V; T
To enable IPMI meters, ensure IPMITool is installed and the host supports Intel Node Manager.

; V4 c" a% b3 l4 S

      o( C# ?, \9 V6 F/ R+ z4 s7 ~
  • Edit the /etc/sudoers file and include:
    .. code-block:: ini
    1 I* D" U3 q/ \2 s/ O/ E6 i' v. g! |) E6 j+ E5 \/ Z
    ceilometer ALL = (root) NOPASSWD: /usr/bin/ceilometer-rootwrap /etc/ceilometer/rootwrap.conf *
    + z3 w" q+ H) k! b) s% N
  • Edit the /etc/ceilometer/polling.yaml to include the required meters, for example:
    .. code-block:: yaml  B' h2 ]; w; A9 _$ E* z* K6 u
    $ r8 @; ?$ Q: l
    2 o* a! I& K* i3 ^& w- C' ~

      % \: i1 U1 n( ?* O
    • name: ipmi interval: 300 meters:
      2 m$ v2 C# ~  ~# z$ E. ^3 W

        0 b& s/ q* \! m( C
      • hardware.ipmi.temperature2 T; l2 N. U0 M. b8 E9 ~0 Q

      0 Y* P2 d$ u% w+ f& A$ ~9 _( j8 [
      ; ~  |7 M: R8 [, }3 c/ C4 r

    4 O4 V- B( v6 K) X; X
    9 Q6 [$ ?. e5 m# x4 z

6 ?$ ]( z/ g" |) r+ T; R2 XFinalize installation¶
    / n' C" Y$ T8 d$ C  ?1 y+ U* u( K
  • 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
    9 G3 q% M6 ?) ~# t* ?- q
* W" h$ n4 F* Y; C

  j5 d$ z- ~4 ?6 a; e- h0 i1 z+ a
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.

    + n. N3 Q3 v; P( A1 ^
  • Source the admin credentials to gain access to admin-only CLI commands:
    $ . admin-openrc
  • To create the service credentials, complete these steps:
    9 q$ T3 K6 e4 P8 @

      : r* \! k- Q; z9 M& {0 A
    • 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* Z# z: e" }- U( u- l! U3 p( j. ?8 f

      $ f: a/ ~# Y: j$ P( M- e" m8 R
      + \$ M7 n" ~4 |% b
      9 }/ _! c$ j# T: b6 x% [Note
      ) B0 k+ ~: n& M9 n  \
      This command provides no output.

      1 L' D* I, V1 n8 ?! C* L! P- {
  • Register Gnocchi service in Keystone:

    6 b, m$ n# t$ k% t( n
      ' W1 w" w. V. w
    • 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
      9 l6 u% D* s/ r; {0 w9 O7 p
      6 o$ ^. I: c2 T9 p6 D( _  A2 N; W0 N! @+ J7 g; O' Q

      ' H- J; B3 n; y; {: ^( p2 b# m( LNote
      + e0 V( @( ^& `
      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           |+--------------+----------------------------------+8 h2 x0 s" |* C5 [# F
    & b- @7 v5 m8 n5 ^; s

5 C& k: k- z+ T6 [# R. ~. _Install Gnocchi¶
    6 b, Y: O9 B8 k+ F1 b
  • Install the Gnocchi packages. Alternatively, Gnocchi can be install using pip:
    # yum install openstack-gnocchi-api openstack-gnocchi-metricd \  python-gnocchiclient
    * }' v$ H' b$ E4 M) E: t: g; s) x  w& `  D

    9 l0 g' P8 E8 |9 p( Y- p: U! N9 w& Q% [7 ?4 Y. r6 Y$ }
    Note% X  |6 {; [* M5 K4 S! }9 x
    Depending on your environment size, consider installing Gnocchi separately as it makes extensive use of the cpu.

    % I5 P! D" p& ]" p+ Y" L2 ]. q

    6 y4 ]1 Y- ~* r
  • Create the database for Gnocchi’s indexer:
    $ ^9 a2 H$ X5 l) w3 c0 d
      ' H, h, p* ^, ^0 z, {; P- v
    • 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';
      5 O9 G. B3 H# |* A7 q
      7 N' f3 _6 ?3 O7 G1 {
      Replace GNOCCHI_DBPASS with a suitable password.
    • Exit the database access client.

      + @' @7 [# c( d- d
  • Edit the /etc/gnocchi/gnocchi.conf file and add Keystone options:
    6 e$ W- |. S. _2 S

      % D* y2 A% |% c2 X1 B: o
    • 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 = RegionOne6 b- e3 E9 K' p* s7 _% U* L

      , s. Q( x" d! o+ B5 O6 B
      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/gnocchi4 `% I% Q& m+ T: K8 n# C/ a

      $ n1 f7 ?2 K9 v6 {( G
      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
      8 Y! g# `8 z  s: j% h1 z2 U! u
  • Initialize Gnocchi:
    gnocchi-upgrade; y2 o+ p! w, ?) n, R4 l3 {
, @0 n9 o0 b' r' m
Finalize Gnocchi installation¶
    0 C1 E9 x; t0 g* z* 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.service
    2 q. W5 r' [+ f8 v- }/ }% g- p7 N
9 n6 y/ k( M! H; b1 O
Install and configure components¶
    # F! C9 ~) n- z( Z* E4 d3 j0 E9 u
  • Install the Ceilometer packages:
    # yum install openstack-ceilometer-notification \  openstack-ceilometer-central7 V( m4 J) C* v

    4 {! p! `+ ?: W* v2 X" s& {
  • Edit the /etc/ceilometer/pipeline.yaml file and complete the following section:
    % v; U# q+ q7 D1 Q3 v2 j
      & Q- C( \& `2 T$ H. i* @( X! _1 j
    • 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" Q: ^+ b  d9 k
  • Edit the /etc/ceilometer/ceilometer.conf file and complete the following actions:
    ! H- Y( H8 G  r6 G% x4 U% l
      ; N6 l/ ^+ {( c4 I
    • In the [DEFAULT] section, configure RabbitMQ message queue access:
      [DEFAULT]...transport_url = rabbit://openstack:RABBIT_PASS@controller  ^2 i# n  L: Y- t; C; c. b
      * l( A* j9 ], e
      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; T0 R5 e  [( y( s! k% F" I6 ]: h( i- n# a7 J
      Replace CEILOMETER_PASS with the password you chose for the ceilometer user in the Identity service.

      / e% u) v$ y) S# M
  • Create Ceilometer resources in Gnocchi. Gnocchi should be running by this stage:
    # ceilometer-upgrade
    " Q& O: I4 C" z# Z* |* V% W5 T8 c

! U" R3 I' Y# z2 R/ c; `0 A- b" G# I2 v6 JFinalize installation¶
    5 m0 T) u# |( }: [1 d8 W, |
  • 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
    7 {* ]! p4 J) g/ k; `8 c0 Q
0 Q' j' E' \9 G7 W
) ~8 T$ s- n" Z3 A3 B
Telemetry uses notifications to collect Block Storage service meters. Perform these steps on the controller and Block Storage nodes.
: g7 z9 j) h  g! V  a
  s6 l. a& ]) l
Note
2 h* }' f& i/ G2 d( a
Your environment must include the Block Storage service.
9 x5 x2 n; T! `  ?( K
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- z) W: n+ |5 \, Z9 G

    ) n3 b$ L  Y/ D
    ) L* q& W( [) b! r
  • 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
    ( T0 }& e2 Q! x9 I( G5 ]! N( k7 X& V- c4 t
    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
    5 y7 V2 I4 T" B4 E$ Q  j. f! [* n& L  O
    % q7 W6 A) N* j
8 W; c3 }% D( U, L8 @* {2 X6 w& {
Finalize installation¶
  • Restart the Block Storage services on the controller node:
    # systemctl restart openstack-cinder-api.service openstack-cinder-scheduler.service4 h" K5 m7 |5 y# x2 w) b" e; `8 l
    4 h# g* e9 A+ X- R/ n. g1 \
  • Restart the Block Storage services on the storage nodes:
    # systemctl restart openstack-cinder-volume.service
    6 |8 {, y: M  U4 w1 ~% V$ e; }* [  S$ d

    2 i5 r- I  h) a$ S+ ]) n

1 \+ X- n$ v% a& |. i
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 00:03 , Processed in 0.016013 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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