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

安装ceilometer服务openstack

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2021-7-15 09:21:46 | 显示全部楼层 |阅读模式
Source the admin credentials to gain access to admin-only CLI commands:
. z3 C: d( e3 P, I% Z$ . admin-openrc, X" C: [  d" m/ ]) t
To create the service credentials, complete these steps:
3 M3 O$ [! \7 f1 A8 G8 `$ DCreate the ceilometer user:2 }; n/ H, {; g
$ openstack user create --domain default --password-prompt ceilometer
* Y$ X: {3 Q9 k) ~User Password:
/ @6 j3 |3 @* `" ?; K' jRepeat User Password:
) @+ q, v/ w1 M6 ~0 ]$ {- s  c9 H/ Q9 W+-----------+----------------------------------+
& V$ s4 L1 I, x( L$ D/ U5 F# k| Field     | Value                            |
' K3 u) q3 y& R+-----------+----------------------------------+, B& p$ q4 j$ A& a: n' I
| domain_id | e0353a670a9e496da891347c589539e9 |
4 w8 H" Z2 q# Z; P/ || enabled   | True                             |6 r  q% i8 f8 ]# P, j
| id        | c859c96f57bd4989a8ea1a0b1d8ff7cd |
" V5 C+ ^' o' _6 U& S; V| name      | ceilometer                       |% i( X7 C: Z6 d4 N9 W9 E
+-----------+----------------------------------+2 d# k% v: f# t0 E0 v
Add the admin role to the ceilometer user.
3 }" }$ c$ J- x6 f) y6 E$ openstack role add --project service --user ceilometer admin
4 S: ?/ \1 Z2 ?4 ?# D* w" Y Note
0 X, d2 }. z6 M- Z  m) F# aThis command provides no output.) _4 E! h  [" O4 Q- G0 f) P
Register Gnocchi service in Keystone:
* ~" x7 t! m/ M7 DCreate the gnocchi user:
! w+ N+ V0 X' j" R# A- S$ openstack user create --domain default --password-prompt gnocchi: c& \0 P& @" Z. i: p9 ^1 y
User Password:
! `% F3 D) M2 |7 Q5 oRepeat User Password:
3 J! L4 F& y$ z8 M$ v  |+-----------+----------------------------------+
. G* t3 A2 }1 L9 e| Field     | Value                            |
1 n& q1 G; H. o/ _4 `+-----------+----------------------------------+! g/ t4 t1 Q) M" R! U8 C0 e! K
| domain_id | e0353a670a9e496da891347c589539e9 |
1 V* S5 |- u1 Z8 ^' {$ N| enabled   | True                             |
6 m. P7 Y& b- T  S: o+ P& Q. p| id        | 8bacd064f6434ef2b6bbfbedb79b0318 |
4 _' ^" a/ Z; {9 b8 d( c# U5 o* q/ w| name      | gnocchi                          |
3 W" I; k# C( W  P; Z% e. \+-----------+----------------------------------+
0 b  S$ v7 m5 [% [$ r" oCreate the gnocchi service entity:9 N9 r$ h0 b# `( W/ Z4 }# t
$ openstack service create --name gnocchi \$ a% i( X; l' x
  --description "Metric Service" metric
% l% M$ _2 w: P; S2 O; D+-------------+----------------------------------+' U% _! M( h( b$ ?( Q- s
| Field       | Value                            |
/ U$ y" p9 `$ I1 y8 p  G+-------------+----------------------------------+. h9 T) e! G- ?- m9 k% }
| description | Metric Service                   |
  C+ f4 |/ h1 I$ g3 Z! S% T8 G| enabled     | True                             |
$ m% o/ ^. k1 _1 Y7 L/ B4 G( @| id          | 205978b411674e5a9990428f81d69384 |- A  i! R) u+ ^$ d2 t- A
| name        | gnocchi                          |
1 v1 p7 j6 w% e4 g3 x! m| type        | metric                           |
% {. v$ S. d$ o. d0 K. @. P+-------------+----------------------------------+( w; n/ h$ [% T( O8 |& X6 b8 {
Add the admin role to the gnocchi user./ X3 f+ j3 }- @) b( B: q9 S" B
$ openstack role add --project service --user gnocchi admin
0 A, p; O% r. n Note, E9 N% b: b) b* h; a$ F' Z' e. i
This command provides no output.
; \( w8 k$ R$ O% }  T4 H$ |" N  n3 eCreate the Metric service API endpoints:& A; w1 a: Q- q" i. \4 s
$ openstack endpoint create --region RegionOne \
" i* n) |! ~! m! Q  metric public http://controller:8041
! x% L0 ^  G+ h2 v$ B$ Q; ~9 p1 f- P& Q+--------------+----------------------------------+
% ^. \+ m# X0 F" ]' {' d| Field        | Value                            |
3 T  T/ n7 `7 h$ u+--------------+----------------------------------+
4 }' X# [* S" {" {( u. N| enabled      | True                             |
: p0 f" g$ ^, q! a0 J( y| id           | b808b67b848d443e9eaaa5e5d796970c |! L& F. }& j, V- f" H* ~8 d. h: Q
| interface    | public                           |
. m3 A4 ]- B  L| region       | RegionOne                        |
, o( l& G" D) J3 z* _  U3 A8 Y  H; m/ Y| region_id    | RegionOne                        |
8 o" l' @# w+ n. B2 }2 o| service_id   | 205978b411674e5a9990428f81d69384 |
$ m$ f! @8 g1 e' g- v; L; N$ L/ B9 Q| service_name | gnocchi                          |
( A( B' I! Z! t  J9 n; t| service_type | metric                           |6 F4 p5 D% e! g. P0 E, ]4 ~9 z
| url          | http://controller:8041           |
, Z. X" _/ u! D$ I/ V% \+--------------+----------------------------------+
0 p+ F) q& j/ J1 |+ ~% M: m# M$ openstack endpoint create --region RegionOne \: C, t4 d" E) K
  metric internal http://controller:8041, k: L8 v# V* R' Y9 @0 I" Q
+--------------+----------------------------------+( F2 n/ g+ f1 G  f
| Field        | Value                            |
% u' l& Z1 z" B8 V) U+--------------+----------------------------------+' u' S# C+ U# {3 x, `; X- e
| enabled      | True                             |
2 |* C$ K3 @! |* L" B( h| id           | c7009b1c2ee54b71b771fa3d0ae4f948 |
1 w) a8 d" k; N' q2 E9 ?9 p| interface    | internal                         |5 T, \6 g. `& c- L' h. l
| region       | RegionOne                        |
3 w+ |: E$ X7 G$ p7 z: y! G| region_id    | RegionOne                        |# x1 a7 s, x0 e1 p
| service_id   | 205978b411674e5a9990428f81d69384 |
+ f2 x. F' _  X4 ~! m| service_name | gnocchi                          |
0 p. j, X/ Z; f/ t& l7 X) ~' G  Z| service_type | metric                           |# m3 T, K$ _' f2 e/ t( {2 H
| url          | http://controller:8041           |
, R. A& @  m" ^$ L. R) W+--------------+----------------------------------+- D4 R  G. T! @- H5 I% {
$ openstack endpoint create --region RegionOne \
8 H2 X2 j2 Q; T) K  metric admin http://controller:8041" K( M( P/ `) q) F  Z+ y
+--------------+----------------------------------+
4 d$ H9 V" }+ B* G| Field        | Value                            |/ a. C. X7 m# D$ u
+--------------+----------------------------------+0 H* X: Z' g# z9 b6 M& o# ^$ j
| enabled      | True                             |) ]2 m9 R8 ?/ x0 t# E( i$ c
| id           | b2c00566d0604551b5fe1540c699db3d |' U9 x$ A! x4 x
| interface    | admin                            |
. l% q0 l% W3 {% Z. Y2 g8 _| region       | RegionOne                        |
/ i5 l% h& f# X/ k/ [2 ]  u| region_id    | RegionOne                        |: P8 C5 F2 M$ S5 H/ {0 y6 D& |5 b+ F
| service_id   | 205978b411674e5a9990428f81d69384 |5 p  l3 G1 O) `3 F
| service_name | gnocchi                          |3 p. s0 w+ |' }% o
| service_type | metric                           |
  c2 W: n2 X# P0 \| url          | http://controller:8041           |
/ ?3 {6 e+ }! g, \  L6 ~$ e+--------------+----------------------------------+1 ?4 p# g" ]$ d1 P+ C. V( |+ U
Install Gnocchi¶( N% J' m$ |  w& |6 Y
Install the Gnocchi packages. Alternatively, Gnocchi can be install using pip:
- }7 r! q5 |, h  W: t6 h! O# yum install openstack-gnocchi-api openstack-gnocchi-metricd \( M' i, w* E' [: W. H# e4 e5 }: H  d
  python-gnocchiclient
$ Y7 R( k5 s! y% H' _5 P. D Note
7 s2 l9 I) m4 U  H, u, j8 n$ \Depending on your environment size, consider installing Gnocchi separately as it makes extensive use of the cpu.
2 `0 F. [1 U. y7 v6 p, e) w* ACreate the database for Gnocchi’s indexer:% v$ a% i9 x' Q* G& y& T# S, H( j
Use the database access client to connect to the database server as the root user:4 p! |/ U! }/ F: F5 O
$ mysql -u root -p' y( w7 ~! }1 _7 S8 o  Q; ?) B
Create the gnocchi database:: p9 _- [+ U+ b/ N7 L0 h/ d
CREATE DATABASE gnocchi;4 i& o  F5 H% i  s
Grant proper access to the gnocchi database:% `7 b: ~- N+ z/ M% B7 m
GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'localhost' \$ d" n# ]/ z/ l* B9 f" N$ {1 ?9 R) ]
  IDENTIFIED BY 'GNOCCHI_DBPASS';
# O4 T7 V. p+ g0 q' PGRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'%' \
0 v' X" X: E- N" h) a/ \) i  IDENTIFIED BY 'GNOCCHI_DBPASS';
1 F; ]- f8 V$ n) _2 k8 R  e" ^, ~: ~Replace GNOCCHI_DBPASS with a suitable password.
% r) ]. }3 D8 K+ K6 ~* L  RExit the database access client.
9 n  L4 g! i2 F+ _Edit the /etc/gnocchi/gnocchi.conf file and add Keystone options:
: A& a  }6 Q0 E# G) g0 MIn the [api] section, configure gnocchi to use keystone:+ ?. {6 ?& _# Y0 I6 @. J1 `
[api]
# @" J; v8 T8 k( ~  [+ dauth_mode = keystone
5 Q2 ]2 A1 x9 A& E$ `# r# VIn the [keystone_authtoken] section, configure keystone authentication:
. \" I; ~9 X! o1 O9 ^[keystone_authtoken]4 I* ]8 J) z2 m( @" n7 x
...
5 K0 H/ {& V4 ?( Bauth_type = password! ^4 O$ j% l# N% h3 v, m: W
auth_url = http://controller:5000/v3
& j: Y- @5 c. v+ E/ ^project_domain_name = Default4 I, R5 Z2 J" t6 s) Z" W
user_domain_name = Default" H! `; s5 N) ?& [
project_name = service
) a1 a  S1 e+ d4 z4 f6 @username = gnocchi) y' k& Y# ?# ^* ]/ i+ |0 v
password = GNOCCHI_PASS
: c& w9 S0 P7 V; m1 h0 Kinterface = internalURL1 r9 i8 q% M6 K3 ?
region_name = RegionOne
+ N8 u  r6 U$ E8 QReplace GNOCCHI_PASS with the password you chose for the gnocchi user in the Identity service.- t! }, i4 J* G+ k3 k' b, j3 g2 e
In the [indexer] section, configure database access:
0 w+ j4 W( b1 Q7 d# G) u[indexer]
2 g% C- y$ d) \( J# |1 murl = mysql+pymysql://gnocchi:GNOCCHI_DBPASS@controller/gnocchi" C6 U+ y9 |! R
Replace GNOCCHI_DBPASS with the password you chose for Gnocchi’s indexer database.5 q( Q  F% K( ~5 v2 h8 N9 _) E
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:
9 d6 `* r8 R/ n6 K: s1 T[storage]; D; }" N5 E  A: ?& M5 ]
# coordination_url is not required but specifying one will improve; B8 [/ d& o& [1 ^/ Z* D
# performance with better workload division across workers.
4 ]% x) ~) |& lcoordination_url = redis://controller:63790 l. W/ z# B6 o# j
file_basepath = /var/lib/gnocchi$ j0 q0 C" ?# o( v8 ~7 D4 I
driver = file
5 n3 i) R% H8 b7 r5 a$ W0 dInitialize Gnocchi:
6 y3 f3 T/ t& ]& S8 ]0 Y! {. b( jgnocchi-upgrade
/ G+ E5 i. O; ?Finalize Gnocchi installation¶
& I4 N3 f% o6 x; Y% O6 uStart the Gnocchi services and configure them to start when the system boots:
1 m  z' Y5 M2 H5 d7 Q- g; R# systemctl enable openstack-gnocchi-api.service \3 F6 A  t: ^& K4 n$ V- P* L, y
  openstack-gnocchi-metricd.service
  `( ~3 a  X6 E# systemctl start openstack-gnocchi-api.service \3 T6 r4 t; G8 G' \' g! u, v
  openstack-gnocchi-metricd.service
. @, V7 r/ g( V5 BInstall and configure components¶
; P7 x' b* z- U7 cInstall the Ceilometer packages:
; \7 w' ^2 D- a6 P$ i2 s; r) {# yum install openstack-ceilometer-notification \& n/ S, e0 B* d3 ~
  openstack-ceilometer-central
4 @, r9 z9 l+ ^! n% X* oEdit the /etc/ceilometer/pipeline.yaml file and complete the following section:+ K- C) j5 `4 L* ]) ?' h  X
Configure Gnocchi connection:
) z) w6 ]! a8 y$ B, H/ W( \! Dpublishers:
& ?* b0 y% y& Y- |3 X& ^) z    # set address of Gnocchi
# G* M- e6 ^/ u$ R# e9 j    # + filter out Gnocchi-related activity meters (Swift driver)
: X& N) O% z+ ^6 }6 m    # + set default archive policy
$ }# Y+ [: A4 `" P& r# ^7 F    - gnocchi://?filter_project=service&archive_policy=low7 ]2 i1 T0 S* T' Q0 ?2 ~
Edit the /etc/ceilometer/ceilometer.conf file and complete the following actions:
7 C2 z. @2 [/ e* ~4 y6 L9 U* |In the [DEFAULT] section, configure RabbitMQ message queue access:2 _9 g( K2 d6 N$ r( v  X
[DEFAULT]; p2 e/ m9 X$ c! [
..." s) I; V8 O3 }+ }% P$ S* H4 w& x
transport_url = rabbit://openstack:RABBIT_PASS@controller
. \( @' Q7 B& N" V, V9 M! E3 A( v' W% a, h# u/ k
Replace RABBIT_PASS with the password you chose for the openstack account in RabbitMQ.
7 j5 \; n& n, i2 X# r8 OIn the [service_credentials] section, configure service credentials:$ f: x+ q& U9 `7 b0 z; |2 o
[service_credentials]2 x8 C3 {2 a1 e/ S; f0 z$ @
...
+ ]2 A; l+ B& I9 n$ hauth_type = password
2 K6 `/ G( W) v$ ^( iauth_url = http://controller:5000/v3- y* [0 t' E9 Z* }& h8 I2 ?0 A
project_domain_id = default6 D# t' K9 b* z$ u3 g, F& O$ F! P
user_domain_id = default3 _' @# t" L1 Z' w% Q* O0 `. I
project_name = service9 ~; D% k) _9 n$ G
username = ceilometer9 L7 @1 \! X* \
password = CEILOMETER_PASS
% O: B4 |/ A  q7 k# h# B" ninterface = internalURL* P+ O; x" q8 Q: i
region_name = RegionOne
) J( p: \& i$ d9 QReplace CEILOMETER_PASS with the password you chose for the ceilometer user in the Identity service.
  C: X9 B5 E6 k) w& }Create Ceilometer resources in Gnocchi. Gnocchi should be running by this stage:- V5 ^4 J! m4 Z1 p- E4 w; N. \
# ceilometer-upgrade
. S$ g2 N1 t8 r  K! ~  E, \Finalize installation¶
4 {# ]- W1 F- M: n! r6 kStart the Telemetry services and configure them to start when the system boots:
) S9 h0 _6 B0 K! _; o+ O2 g4 Y/ S# systemctl enable openstack-ceilometer-notification.service \9 E, l& x1 T" j; @
  openstack-ceilometer-central.service- g) O5 S* F  M9 l# L
# systemctl start openstack-ceilometer-notification.service \& T; p% u1 B* `0 \# M7 p
  openstack-ceilometer-central.service
0 \; W. D8 L% Q7 m# w* Z4 s9 U) N+ W9 a
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 02:04 , Processed in 0.017912 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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