找回密码
 注册
查看: 6837|回复: 1

ceph 对接openstack mitaka

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2018-10-12 17:14:45 | 显示全部楼层 |阅读模式
创建存储池7 f& f  |& o! p- n# E0 j! E
% M  X$ u. d1 K" L4 e/ |. ~4 }
# ceph osd pool create images 64
1 I$ x3 n9 m$ X$ _5 ^# ceph osd pool create compute 64
. e: @( B3 [; R/ y$ Q7 X$ R1 d" f# ceph osd pool create volumes 64
: a, v/ ~/ Y5 O" m! _: D( B# ceph osd pool create backups 640 r: T5 M. L6 `+ y
Create Ceph User ceph
# G6 m8 f% u/ H# _4 {" i* b0 ~$ f& i6 ?( \( B; `
# ceph auth get-or-create client.ceph mon 'allow r' osd 'allow class-read object_prefix rbd_children, \6 e' V# a5 i" |: f: `- e4 x! F9 Q/ f3 X  `
allow rwx pool=images, allow rwx pool=compute, allow rwx pool=volumes, allow rwx pool=backups'2 U) y2 o' F: N
[client.ceph]: W; o: Q+ @; L/ O
        key = AQDIistY4xELCxAAPkelu47q/fxM3R8B732jlw==
5 q' ~6 t" a" X: T
+ H7 ^, V1 ~  M; fcopy user.keyring to glance-api node and cinder-volume node
1 e; F7 F! ?/ k% d
9 W0 k1 P' Y7 y  Kceph-monitor # ceph auth get-or-create client.ceph >> ceph.client.ceph.keyring* R. a$ ?# }, K$ {7 z
# scp ceph.client.ceph.keyring ceph.conf controller:/etc/ceph/
- X0 q/ K! P, @# m7 [# H# scp ceph.client.ceph.keyring ceph.conf cinder-volume:/etc/ceph/
1 F) ?" C" x2 u" L6 x
2 P: S- E" k2 V9 v+ W. O对接glance-api
3 C: e8 `: E2 i+ W" g5 Pinstall rbd% r5 H# H3 k$ q; R$ Z
  W  U: n: w  F* f  L
5 E+ w9 x& a; {! L- N
# yum install ceph-common python-rbd
! P; i- D' L2 Z设置key权限
: S) K2 i& D/ ~( c' K) r6 N. O2 p; d) U' f5 K- y

  h7 X$ n) Q( b6 s3 T, P# chown glance:glance /etc/ceph/ceph.client.ceph.keyring
8 A- |& R, x. e2 v7 ?( L$ vedit /etc/glance/glance-api.conf
) O# \* v/ b7 }9 \7 C% q2 ]% [3 l% C" j1 [
6 t2 R7 M/ T+ J4 d
[DEFAULT]
" [9 p' [* t! ?7 e...4 j1 Y5 \; {# _% x
default_store = rbd" P  p# j& X' G( E
...
3 M1 S5 u( Z! z! |" A8 X8 F# E[glance_store]
& L: q! ~( E4 i+ }stores = rbd
' \+ L. Q5 r, J4 yrbd_store_pool = images
! o" ~* I+ F/ l" S8 grbd_store_user = ceph
% H" h7 H5 ?9 D# }rbd_store_ceph_conf = /etc/ceph/ceph.conf
* x# \' x, y& H# x9 Brbd_store_chunk_size = 8
' B! m2 \, i$ P4 s+ _- }: ?& frestart glance service
' p& G0 Q' u. k, Y0 r1 v% P, {2 m0 v9 ?7 s, y
4 r, d9 M( o" \1 u4 c& c
# stemctl restart openstack-glance-api.service   openstack-glance-registry.service% e- \; \' M. G! w  ]) K
2 H  L3 V  @) H3 c
# k! B8 g8 `- i. c9 Y' C- o' }; {
对接cinder-volume, b+ v9 C, K) C3 T
install ceph-common+ g% t( v0 z6 |- _7 q. |0 e: S
4 l* X; X+ e' g) d
# yum install ceph-common   python-rbd
% q& f+ k3 s( o: t" _3 O设置key权限
7 D, f! r: F, J
3 y0 R- H) Q0 b9 r2 _
4 K; u# C! ~# J! o1 b7 T! n2 |# chown cinder:cinder /etc/ceph/ceph.client.ceph.keyring' t$ v7 J( x; F: V0 ], c+ t$ T
edit /etc/cinder/cinder.conf6 C. U$ Y; |" A0 h  S
4 _* s" V4 _- I. d+ t( p8 y) ~
[DEFAULT]
7 {7 M2 G/ ?6 o3 ~( T2 h8 j( j- t. S' v% A4 O% N7 ]
enabled_backends = ceph
  P8 J4 {3 O( m5 f: }5 K, t
4 ~8 W+ z4 N! ]" b8 n' i! d0 |# `[ceph]
; L" }* ?9 Z" o: _5 w$ ^4 |, D" y) ~3 Z/ Q9 t& J6 b
volume_driver = cinder.volume.drivers.rbd.RBDDriver' G( S1 d7 G; l3 {: V3 z5 b
volume_backend_name = ceph3 [8 s: i# g5 ~& f, F
rbd_pool = volumes9 D" n, ]2 @! }: Z4 Z
rbd_ceph_conf = /etc/ceph/ceph.conf
9 ~/ A* J: @# _2 \& Erbd_flatten_volume_from_snapshot = false
' O& j, U5 w( e% T$ t0 Prbd_max_clone_depth = 5, k+ F2 a) E7 ~4 k
rbd_store_chunk_size = 4
3 p( r/ l& c/ U9 T% crados_connect_timeout = -1, K8 w6 S6 o* N$ I
glance_api_version = 2
9 J; K2 l0 }9 k" s( \1 Jrbd_user = ceph
  P3 X5 s4 \. M6 w1 Jrbd_secret_uuid = 791c2ef6-bc56-43b0-b2c7-0cd863621040
' ~) o! U) W/ F; X: J: Rrestart cinder-volume service
- K5 m9 `9 m) b- H1 V: j; k8 H3 v6 M" N# c, [% C% y
# systemctl restart  openstack-cinder-volume.service$ z% |: o2 c4 l) B5 s0 b- V
) [3 E  U9 B, `* ^
- S: X3 o3 _! C9 D

8 o4 L! Y, a  b3 [, [对接compute% q# w( k# F# J5 N
install7 X3 F( A4 j& l6 o) h& a

7 n7 X- ^( T2 ^. ~% p8 i# yum install ceph-common python-rbd: I# e) }4 T/ Z1 [! s/ ?; @# m. ?
edit nova config5 T) `, w& P5 {" _- h1 l
( P' G# E: b( \" j# g- q
[cinder]/ P6 _! l5 h% N* j
os_region_name = RegionOne  [% K4 l& U/ B+ ?6 x! b
* g" T- ~' P2 s$ G# p+ x
[libvirt]
: z& R! A+ ^3 s3 Z8 E  g8 A/ oimages_type = rbd5 x+ q+ C( ~4 U+ Y$ q$ ^4 ?
images_rbd_pool = compute
$ t1 a8 R, R( F% v" fimages_rbd_ceph_conf = /etc/ceph/ceph.conf& t$ |2 |: ?2 O9 e$ y
disk_cachemodes="network=writeback"$ D- J& Q+ N9 S# l0 p9 j2 i
rbd_user = ceph
. Q1 m+ V  \2 J. n# Wrbd_secret_uuid = 791c2ef6-bc56-43b0-b2c7-0cd863621040
  g$ Q8 \. b9 K7 M3 C2 `
0 d  I, A4 w, y8 Winject_password = false
: g; @, a5 Z3 ]; {3 Y# s, sinject_key = false
$ ?& h( l- D: d; g0 \9 G. ginject_partition = -2$ V0 O- O/ q# C6 a) R5 x( A& n
. w. o, s/ |1 A6 c& w
live_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST,VIR_MIGRATE_TUNNELLED"
: J/ ?$ D" {7 m) I/ z. ohw_disk_discard = unmap. N  s8 V; |1 D6 n$ Y" Q2 I
7 u& ~( s+ o- D# o6 q

3 I8 M5 t" Q+ t# K) [" ?2 I1 G2 h- i# d, e# R7 q$ Q: h; ?' I/ l: A
0 V# ?: F  i& |4 ~: M+ x
copy ceph config
* q8 l" x# g- r3 o9 x# [
. _1 F0 M5 R" h4 W6 n  d7 c# scp ceph-node:/etc/ceph/ceph.conf /etc/ceph/ceph.client.ceph.keyring  /etc/ceph
7 u. K8 a0 F4 [. _! b1 R# chown nova:nova /etc/ceph/ceph.conf  /etc/ceph/ceph.client.ceph.keyring
) q4 T3 i& M, k5 ncopy ceph user keyring! |) k1 G2 s: x% q& i/ H$ w+ K

/ z7 W+ Y6 |) {$ q2 s2 J  n
- Z; q$ {. ^" L3 y5 `[ceph-monitor]# ceph auth get-key client.ceph >> client.ceph.key
3 c, l$ I9 T; \' l( Y" U8 h$ ^[ceph-monitor]# scp client.ceph.key compute:/etc/nova
1 v4 m% E; X/ ^) A! ~) K* w
. Z( y9 {) V  B! [) e3 |8 O+ [8 V6 V! C- x$ H" R

# v8 U; v  o0 ^: F4 j! u8 e2 A$ @设置libvird2 [0 a9 m- v4 N9 `7 D% H

& K/ ?! J1 D' W+ z$ a- Y# uuidgen * W) a$ t% s9 \7 |
791c2ef6-bc56-43b0-b2c7-0cd8636210406 v4 N( b0 w% [$ A# v2 ~" `

( p! u0 `# u" w6 A* [ # cat > secret.xml <<EOF
: a* @* o5 @# S<secret ephemeral='no' private='no'>
2 ?$ w" Z; O' [1 r  e0 d  <uuid>791c2ef6-bc56-43b0-b2c7-0cd863621040</uuid>
9 C, x5 x+ @/ U. E0 D7 x  <usage type='ceph'>
' _% t9 ?& a" r  H) U# c    <name>client.cinder secret</name>2 j% f8 a" D$ m* n! i2 d: M
  </usage>: k* D: q3 R- L, w
</secret>/ [% _& i* V! y
EOF* X% w7 _6 S# h/ }0 m

- E! Y0 e: c* {7 h0 L$ S/ j# virsh secret-define --file secret.xml
- Q  R& y; h# _: a6 G! gSecret 791c2ef6-bc56-43b0-b2c7-0cd863621040 created: m; G! E% E1 W8 j- ?; _& h1 K
$ A  n# @5 E# `8 a' z2 R/ `  P
# virsh secret-set-value --secret 791c2ef6-bc56-43b0-b2c7-0cd863621040 --base64 $(cat client.ceph.key)                                    
2 n2 O+ J) W. bSecret value set" c2 F: i9 ], V+ \' a& L! h& W7 d
restart nova-compute
- q% S% c: ^+ Q! m+ F6 a. d; X! z  C" k4 @4 {
systemctl restart openstack-nova-compute.service4 W/ ~7 n- Z# c, L1 ]! G

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2018-10-13 11:07:34 | 显示全部楼层
创建存储池3 X6 U! R5 {9 q
* h* }& C9 s+ t2 n/ b0 y/ Z, H
# ceph osd pool create images 64
* l/ W  @9 ~6 c+ x+ s& }# ceph osd pool create compute 641 j' M3 |, B3 N# f5 ~3 Z2 f
# ceph osd pool create volumes 64
2 A( |, Y: L1 l8 A  D# ceph osd pool create backups 64
- @; ~6 b% X1 ?; p" y: t; o7 L, a- jCreate Ceph User ceph, _4 z. p: j2 o1 o

3 s% U# D" b1 }& j0 ]. f+ Q# ceph auth get-or-create client.ceph mon 'allow r' osd 'allow class-read object_prefix rbd_children, \. z' i0 f* r) ~3 N8 y! O
allow rwx pool=images, allow rwx pool=compute, allow rwx pool=volumes, allow rwx pool=backups'/ g& r- {$ W6 P# O4 Y
[client.ceph]
+ b* g7 I2 S6 h        key = AQDIistY4xELCxAAPkelu47q/fxM3R8B732jlw==+ K4 ?( _( U! a5 S  F& D

, o; W  l$ T2 w3 B4 G) x: x5 z6 gcopy user.keyring to glance-api node and cinder-volume node8 u) J* D% G) |3 x. q- u
& Q9 Z. r( ?& G5 b  Z, w
ceph-monitor # ceph auth get-or-create client.ceph >> ceph.client.ceph.keyring
* ]" D6 _: s  C" p9 g! ?8 V# scp ceph.client.ceph.keyring ceph.conf controller:/etc/ceph/4 ]" {0 U' o* d8 ^1 D3 C/ m5 ]- B" M
# scp ceph.client.ceph.keyring ceph.conf cinder-volume:/etc/ceph/, w3 F; d% R/ i1 t: p
; e9 ]* H" y+ s0 \+ x  ^
对接glance-api3 G6 Y9 z$ F: [& f8 X
install rbd
, N. r& R8 U0 c- t, j- E+ f
" s; p5 {- X+ `; U
. w; B" `- F! e! R# yum install ceph-common python-rbd
, |0 O5 D. t6 O8 ?% s( _设置key权限2 M3 B0 U) O* _2 A! b

3 V4 x/ @# j2 Q" e4 j$ G1 F- z5 x. \7 |
# chown glance:glance /etc/ceph/ceph.client.ceph.keyring
+ p, |: ?& j$ y. S9 `edit /etc/glance/glance-api.conf' X3 x8 v: |! K$ ~) x: f7 i

7 q8 {$ D4 a9 _! i: k' G0 b4 _5 |1 W5 b0 i  w
[DEFAULT]
0 P! o; f5 Y/ @...5 S. L5 W# g2 ?+ l/ ?" z4 K' T& @4 n* I
default_store = rbd
3 w$ k5 s1 D+ }...
' w) @* M4 I7 ~7 D1 I[glance_store]
6 k  A' O; q8 mstores = rbd
8 [7 @" W% N7 [: I( |7 wrbd_store_pool = images
# K" V7 P' t9 s0 x& K/ prbd_store_user = ceph4 ?+ Q3 w5 h2 o9 P
rbd_store_ceph_conf = /etc/ceph/ceph.conf* k% y1 i4 Y& ]) h5 r
rbd_store_chunk_size = 8: T* C- u9 _2 C& w, o9 Z1 N
restart glance service
$ g; R% C% Z. |" Q3 k. Y$ ~8 s( q1 c4 J. [. n

, g2 B# C/ \6 m# v- F9 K# stemctl restart openstack-glance-api.service   openstack-glance-registry.service
% ?. D. q8 ?+ }  n对接cinder-volume% o1 Q, `* M7 T3 [! J$ v
install ceph-common
' d$ e# v2 ?( e, m; x& j3 \- }- F3 `- I
# yum install ceph-common   python-rbd& Y7 |1 C" X# k# ~6 y+ d- F
设置key权限) j1 ^9 w! o$ V& b( S/ [: C

: r8 b# {; ^) v$ Y5 A6 D4 V7 T3 X
3 q" U4 f" g7 |* _; ?# chown cinder:cinder /etc/ceph/ceph.client.ceph.keyring% |! e5 G$ M% s0 p- |. E
edit /etc/cinder/cinder.conf$ F* a: P- ]" G: k% P8 I' w
7 d: v: c  ?( m: Q! H
[DEFAULT]0 ~: t4 E6 s4 q; h

) W7 n3 s" S5 z! S6 Eenabled_backends = ceph
! H9 R) G) Z! R8 d% }
/ Q- ?/ A. h$ g[ceph]/ {! T3 {, v2 ~6 S/ y

' g' `1 V( C' ?; Lvolume_driver = cinder.volume.drivers.rbd.RBDDriver  s. D; O/ u6 t* R- g$ `5 _
volume_backend_name = ceph
8 ^8 C, H; \' d# O. R) xrbd_pool = volumes& v9 s, G. |9 B- z# i; f* R
rbd_ceph_conf = /etc/ceph/ceph.conf" ?0 n  c+ ~2 L% l- O
rbd_flatten_volume_from_snapshot = false1 r6 G# Z$ @4 [. x; [, ], R; Q% E
rbd_max_clone_depth = 53 Y, B  k- s2 R! |
rbd_store_chunk_size = 4
. b2 F% |; m7 Z: q, F4 T3 Zrados_connect_timeout = -1
, ?$ H! w" u8 Aglance_api_version = 2
7 b: K3 |8 {, i- Krbd_user = ceph0 {$ ?* B; Y# c6 C5 S
rbd_secret_uuid = 791c2ef6-bc56-43b0-b2c7-0cd863621040
( r2 A1 B7 {' T. L$ W9 wrestart cinder-volume service
( }, B+ h' H( o0 c, I& ]8 D
" Y# p$ D/ P5 M5 c+ g# systemctl restart  openstack-cinder-volume.service8 p& P- s8 W3 Y5 _
对接compute
" Q* G4 {0 ~! ]9 H1 b8 oinstall! {3 i% H4 h, y2 I/ |

- T: h% L. {+ y, r( R- y# yum install ceph-common python-rbd
0 g3 ^3 m9 {8 x* n! b! @) Cedit nova config& j% e" p  c  E2 ]7 M

  S4 F  R& B" L# t$ L6 o. ?[cinder]4 {8 o0 ]9 e6 A( ?
os_region_name = RegionOne2 i& C8 B+ _6 \3 {6 j; B

: `) l& Z9 Y' }; P1 W[libvirt]; N- E3 u' b! Z1 f
images_type = rbd
" K6 b1 S0 T* @5 F7 D9 {; s: @images_rbd_pool = compute
2 C( s, L/ {; k0 \images_rbd_ceph_conf = /etc/ceph/ceph.conf; u& D+ o3 J9 d% R) Q6 Z6 z! t
disk_cachemodes="network=writeback"
( w3 f% q: e/ @3 U5 E1 }7 yrbd_user = ceph
. ?$ P1 V- }% Mrbd_secret_uuid = 791c2ef6-bc56-43b0-b2c7-0cd863621040
8 n4 G- H' U) e5 [% k. D- X) P$ K4 W2 U/ H4 s
inject_password = false
& B' @" ~& X6 V3 Q( @% Kinject_key = false
" N6 F2 |& T: x+ o. `3 {inject_partition = -29 k8 a( x1 x8 @6 x2 V- v! @
$ w' M7 Z7 Q3 L6 F8 d: z
live_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST,VIR_MIGRATE_TUNNELLED"7 B4 f; V* C+ ^' J3 ~
hw_disk_discard = unmap0 h; z4 p0 o- d- V6 @( s" y
copy ceph config3 P, t- e( ?5 p% _

4 R( t% h1 z9 Q# ^& Q# scp ceph-node:/etc/ceph/ceph.conf /etc/ceph/ceph.client.ceph.keyring  /etc/ceph6 y0 L1 a+ k2 J  z
# chown nova:nova /etc/ceph/ceph.conf  /etc/ceph/ceph.client.ceph.keyring+ b6 i% N0 D" t$ E, H+ P7 F" l
copy ceph user keyring8 _; ~9 s) Z- b: r8 X  j

9 g( P1 }+ f" y' w; H9 j$ C0 Y
) F9 u6 g1 @0 u: K. k2 p4 E5 k[ceph-monitor]# ceph auth get-key client.ceph >> client.ceph.key
# d4 v7 T! X7 i* t2 }- H; v5 ~[ceph-monitor]# scp client.ceph.key compute:/etc/nova
; g7 P# f" o1 k  |设置libvird2 ]9 F0 |; O: h" ?7 b# H8 J4 d( X
, L9 ]/ B" V! P
# uuidgen 3 o8 H: g  Y6 O4 l! u2 p) |6 ~
791c2ef6-bc56-43b0-b2c7-0cd863621040# W: l- [1 v4 S' M9 T

4 a, C& a* I/ N # cat > secret.xml <<EOF
; C3 ~) x3 H  R* W<secret ephemeral='no' private='no'>7 y: e8 ~, {, V) L7 x
  <uuid>791c2ef6-bc56-43b0-b2c7-0cd863621040</uuid>
8 l9 e0 l1 }$ p# n4 n$ {  <usage type='ceph'>1 D' D4 M* B& q. c& D
    <name>client.cinder secret</name>
- n) A7 `# m2 _  </usage>4 V) }8 G8 ]! k0 U/ B* n
</secret>/ D6 `  u  k0 _, r" I4 F
EOF( X7 k6 t6 D2 c! K5 a4 r$ T4 q
5 ]7 N7 N" q1 l9 g/ k" L
# virsh secret-define --file secret.xml* U; @8 l$ e1 _% o2 g8 W5 l7 Q
Secret 791c2ef6-bc56-43b0-b2c7-0cd863621040 created
( d" ~2 ]9 g9 z9 M8 y: L
5 d( M" E. Q6 s) Y( J+ u0 j# virsh secret-set-value --secret 791c2ef6-bc56-43b0-b2c7-0cd863621040 --base64 $(cat client.ceph.key)                                     * a( Y1 W* h" W6 a0 J1 f
Secret value set
2 {: }8 n2 v0 V  ]restart nova-compute: R0 q  M, S9 Z9 w6 Y! r# o
( P3 Y' k: @2 T4 Y
systemctl restart openstack-nova-compute.service
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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