找回密码
 注册
查看: 5602|回复: 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¶
    ! m  c3 u2 Z' T4 t& M1 S) E6 h& E
  • Install the packages:
    # yum install openstack-ceilometer-compute# yum install openstack-ceilometer-ipmi (optional)& Q3 X1 @* c! [3 r
      D8 [+ f" D* _& T; K
  • Edit the /etc/ceilometer/ceilometer.conf file and complete the following actions:
    4 i3 S+ d) [3 `- ^; R

      , F$ f. e& P. d% @  f' j
    • In the [DEFAULT] section, configure RabbitMQ message queue access:
      [DEFAULT]...transport_url = rabbit://openstack:RABBIT_PASS@controller+ m8 E, A9 L) C2 Z1 B

      1 r0 h7 @: b( i7 ?; h! {9 o
      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! p3 J7 Y/ H( ?: W

      # e* I- G- a( t& k! Z
      Replace CEILOMETER_PASS with the password you chose for the ceilometer user in the Identity service.
      . u/ e5 u7 S; ]# H3 ]) V1 K

    $ p9 s& J+ k- e% r0 ~3 C, h! ]' u

% e" [$ f! x# o! f# U7 DConfigure Compute to use Telemetry¶

    , D( n& T) Q6 m5 J8 M
  • 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; A" D4 D+ _/ S5 s

3 H5 j& g  }- wConfigure Compute to poll IPMI meters¶% `) b% P9 H7 u

4 q- i0 g- i3 l8 H! KNote0 ]. K  j. H0 W+ Q
To enable IPMI meters, ensure IPMITool is installed and the host supports Intel Node Manager.
1 E6 I# \" z& I* F

    * u# r5 A) G- E! P6 W" ]
  • Edit the /etc/sudoers file and include:
    .. code-block:: ini
    ' Z% r6 n0 p$ K1 e( ~' }
    6 e( x+ S8 `0 z8 l: E4 @$ O+ ]
    ceilometer ALL = (root) NOPASSWD: /usr/bin/ceilometer-rootwrap /etc/ceilometer/rootwrap.conf *
    ( \* _  N- ^9 _: _7 q
  • Edit the /etc/ceilometer/polling.yaml to include the required meters, for example:
    .. code-block:: yaml
    ) x) u5 h! {& I' \$ R/ T1 l7 D/ Y$ n/ \. p1 A
    3 u6 ~( B, |& Q' J' e0 d- g+ t9 \

      . V  Q. t1 A. |
    • name: ipmi interval: 300 meters:

      1 M. x7 L- T2 y- l1 I9 L

        0 _4 v; n1 u/ A0 q/ B: H1 H+ Z
      • hardware.ipmi.temperature8 p0 @& P0 n) U- O# g
      / P6 J7 o- ~, M$ n4 l
      0 @8 u8 G# `+ w9 L+ Y- D

    . n% Q) F% |) U9 [, I9 @
    # ]! r0 N* N" A0 r7 k2 u
+ T# z. @" S; A2 f
Finalize installation¶
    . p5 @6 N) a& d' a7 f8 i# V! A
  • 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 V& x# i( J& ^9 q( `& L9 j7 e

9 Y" F+ {3 O$ I6 H' Q2 \6 b+ g1 H

9 p: |# B& Y7 ^8 P/ ?
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.

    $ G! w5 t% K- ?6 m. Q+ C5 q# j
  • Source the admin credentials to gain access to admin-only CLI commands:
    $ . admin-openrc
  • To create the service credentials, complete these steps:
      N! }/ l# U( W: D; k" t/ `

      7 Z6 r2 u" m# H7 `4 z: g
    • 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
      6 J+ B( }/ p  g/ p& M7 I8 E% \4 T1 l4 ?
      - c# A. {3 G, F4 I6 \

      8 B) o* L9 \# q( Z( qNote
      , i( i' |( N: ]- s; w
      This command provides no output.

      ! ^1 K8 i; p6 _( Z; ]- q4 w
  • Register Gnocchi service in Keystone:
    / k) z: P' _; Z

      , V- B. v! u2 \4 D6 Z
    • 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
      3 i$ _! j4 p/ N
      , y6 B; v$ x2 p. d- C5 b: |- n5 H) E
      ' z, b' M, f, C# h
      Note; j0 r" t( P$ u7 C$ G
      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           |+--------------+----------------------------------+
        s+ ~8 X: F# V/ V9 y- X& s

    . V2 o* b) _9 [( N/ J
, [4 c- T! K( T# }$ s, M
Install Gnocchi¶

    ! D4 y6 \3 A. o" M
  • Install the Gnocchi packages. Alternatively, Gnocchi can be install using pip:
    # yum install openstack-gnocchi-api openstack-gnocchi-metricd \  python-gnocchiclient! L( w0 W/ `0 o
    - y$ g% Z, k6 f8 Z$ u4 @3 N! H& K

    ) K- K4 [- f, F2 \, o8 y
    1 ^& l  B4 Q6 o; H- wNote! e5 ~' u' E( v* U+ G- n5 [
    Depending on your environment size, consider installing Gnocchi separately as it makes extensive use of the cpu.
    + B9 O  t! N1 O# X, d$ ?( W2 D! k& q( j
    * e7 m! p; ?5 M: _* ?; x5 S/ i- V
  • Create the database for Gnocchi’s indexer:
    / y+ u; l# n( _* d  {& i  c

      3 U5 R! E7 B# r1 ?3 o5 n8 t4 ^
    • 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 w* _' z5 V* i, ?8 U3 j& j  i* T3 _6 X$ t
      Replace GNOCCHI_DBPASS with a suitable password.
    • Exit the database access client.
      7 z! X# I% U. H, Y9 g* e0 m& g
  • Edit the /etc/gnocchi/gnocchi.conf file and add Keystone options:
    : g! n3 U( _) S+ t: Z$ X5 u

      % a8 b' m4 D* y: b# t. \
    • 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# p, {3 C8 |$ @  b2 j' ~" v) d. Q  Z

      + L" D' ?5 `- x
      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/gnocchi3 }# f) J3 v# W  S
      5 J) i$ H9 Q% l; ]
      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
      % p7 ?" L  @. i* n7 l7 `
  • Initialize Gnocchi:
    gnocchi-upgrade
    ' K# }" J8 G3 D; j. d0 y2 t
; U1 _$ q+ n$ q" l: w) I" B2 a
Finalize Gnocchi installation¶
    ) ^% F% O% [3 G
  • 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: [( z% v2 ]* O% ]
3 N8 c7 h8 a6 D
Install and configure components¶

    ! O8 o- C- ?+ {0 I% V' p  @
  • Install the Ceilometer packages:
    # yum install openstack-ceilometer-notification \  openstack-ceilometer-central
    & i) _/ Z& @: F- q$ k* ]

    , i5 K! d3 l8 A2 X& D9 o% y
  • Edit the /etc/ceilometer/pipeline.yaml file and complete the following section:
    ! J* v- M7 n, D

      ) d9 {& F/ F2 v* p: Y( U
    • 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
      9 y/ @( c7 ^: V# }% r& T
  • Edit the /etc/ceilometer/ceilometer.conf file and complete the following actions:
    & E) ^6 ~" [4 [& s

      ' r3 O& s3 n5 u7 h+ c- k: L9 G/ a# z
    • In the [DEFAULT] section, configure RabbitMQ message queue access:
      [DEFAULT]...transport_url = rabbit://openstack:RABBIT_PASS@controller, Y- Y$ M6 k) Y9 Y4 m
      ( F) A# L% D' g4 H
      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 = RegionOne0 I' r/ ^/ B1 V$ ]
      ' T" ~# Z. B! v5 s& z, o
      Replace CEILOMETER_PASS with the password you chose for the ceilometer user in the Identity service.

        y2 p- ]) D/ d
  • Create Ceilometer resources in Gnocchi. Gnocchi should be running by this stage:
    # ceilometer-upgrade
    3 }) v& A$ [" a7 j5 u
, j; v5 q# T$ Q4 _
Finalize installation¶
    5 W! n/ b' _% w: Z
  • 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 u- @" o' Q( h* l/ ^

9 O0 s/ ]& E  z. q! H9 ^3 k5 s8 M$ V" d/ [4 L( z. p
Telemetry uses notifications to collect Block Storage service meters. Perform these steps on the controller and Block Storage nodes.

- w. g/ q3 H" G& i  J
- }& g- I$ F. Q% m7 SNote5 {6 J  ~9 @7 t4 i7 J8 c3 x
Your environment must include the Block Storage service.

( I  }5 J# }$ {% I2 V1 MConfigure 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% @8 m* O5 ?( G8 n1 F; R5 v
    ; n# s9 [- x( S" j" Y& u( y) }
    1 y3 u% T% `" u. 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
    1 O$ u3 o: H/ P- c% f1 ^7 n& X* t% _$ S" L* `- c
    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
    , j2 }  D" e0 @
    * a, t- H2 Q! l" s2 r4 e  X
    - a) e4 H% F5 ~; t& z, w
9 Z5 p1 e6 D% A5 ]5 L6 v  P! f' g
Finalize installation¶
  • Restart the Block Storage services on the controller node:
    # systemctl restart openstack-cinder-api.service openstack-cinder-scheduler.service
    $ Y; K" Y* O/ i: z/ ^" M9 h/ F6 n. r) e9 p4 j+ j% @
  • Restart the Block Storage services on the storage nodes:
    # systemctl restart openstack-cinder-volume.service; T! Q( v3 V+ U# w( M# y9 {8 p
    : c$ w; X' R  Z7 C* v

    - H) b) Y" I7 g0 J* y5 y+ P, \, a* |

" I% V, l0 M9 j. ~2 @/ O) U
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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