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

ceph 对接openstack mitaka

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2018-10-12 17:14:45 | 显示全部楼层 |阅读模式
创建存储池5 ]( B3 q# \  y% ~: t

  ~. Y! ?1 `0 ?# f# ceph osd pool create images 645 h2 C8 g- f; ^( y
# ceph osd pool create compute 64
% ?7 L$ @8 S' }2 f# ceph osd pool create volumes 64( _# U9 N% k# f  Q4 S( b; O! _
# ceph osd pool create backups 64' [8 ?8 a! e, c
Create Ceph User ceph, S/ Y7 R7 v7 S5 \& _

+ F# s5 J; ~% ^8 t0 u, L# ceph auth get-or-create client.ceph mon 'allow r' osd 'allow class-read object_prefix rbd_children, \8 I- V, W8 H! j* {6 K* O5 X: X% K$ y
allow rwx pool=images, allow rwx pool=compute, allow rwx pool=volumes, allow rwx pool=backups'
  y: t- b; d( Q[client.ceph]' q5 @9 n: j% S; x* p/ x
        key = AQDIistY4xELCxAAPkelu47q/fxM3R8B732jlw==
3 R0 G# T4 `) ~% b$ w: o+ d' M9 e# G( o* d" q, l
copy user.keyring to glance-api node and cinder-volume node6 Z+ V2 C7 U3 T- U

  S( |" u" I9 A/ r6 R. `5 {ceph-monitor # ceph auth get-or-create client.ceph >> ceph.client.ceph.keyring  H# e4 h2 C$ v
# scp ceph.client.ceph.keyring ceph.conf controller:/etc/ceph/
* h: ?, n$ w/ R8 n: ~5 q. e! B: M# scp ceph.client.ceph.keyring ceph.conf cinder-volume:/etc/ceph/
, m7 Z% ?5 Q& \2 I. N6 Q1 k# b# ?, f9 e. z$ v& k, {2 z5 a
对接glance-api1 l2 G% I* V$ [  b2 e7 H. s
install rbd% s1 v$ R$ p$ A0 f: x
; ]3 O# Y0 K/ S9 C4 v
; a% y, U1 L1 P* W) o7 X# k
# yum install ceph-common python-rbd
5 k4 z& `5 ~: L5 W设置key权限8 ?% @9 G: y; k& U4 S- V
2 F& p. v1 G$ a1 j$ o9 v. s

9 b6 M* @. d- i% s5 l/ b% x! _( Q# chown glance:glance /etc/ceph/ceph.client.ceph.keyring3 V  Y" w" {5 j3 c
edit /etc/glance/glance-api.conf
+ v( H7 O; u0 s# z5 m5 ^. `' K# c( D
1 Z/ g, J  u% q8 S7 o4 g  y+ x
[DEFAULT]/ x$ Y0 ~5 o# a$ G1 L0 Y
...
" D, h9 y$ x, B; X# }. edefault_store = rbd; _/ @) {2 e! ~$ c8 c' g* t4 Z
...
) A3 c# p9 B+ [  t2 a( M, K[glance_store]
0 ]  I$ w, h* B2 lstores = rbd. L# B6 Z* A) |" k# p$ M
rbd_store_pool = images% Y. `  X7 [( {
rbd_store_user = ceph
, g+ R" ^+ w  L  Q, d2 G6 ~rbd_store_ceph_conf = /etc/ceph/ceph.conf
  ]  T  r! s$ M3 |rbd_store_chunk_size = 8: h* U8 s5 y* R# y" q5 b
restart glance service
7 J) Q! Q! ]# \! ]- V
" X* V) z) G' n  V% x$ f  }
0 U3 i( w3 c) L+ G# stemctl restart openstack-glance-api.service   openstack-glance-registry.service6 M9 K! h0 z" y; y8 c/ L& j8 \
& `& v) r+ P+ L! {( A- e

  ?4 {1 k+ C1 I: W/ M- E对接cinder-volume
* @3 \0 t8 L) w; Einstall ceph-common) ]( m) h( d! Q1 e6 f  Y
& ?2 a' u5 ~8 F3 ]  }, o
# yum install ceph-common   python-rbd' P+ k, ~+ F. }% Y6 }  R9 [, s6 h
设置key权限
# o: F) w, s3 q4 G' U1 \
4 N4 e" S- P- j
$ V: @; w% s1 g" s3 a7 j: D# S# chown cinder:cinder /etc/ceph/ceph.client.ceph.keyring
0 \$ e% f3 O9 x& M" xedit /etc/cinder/cinder.conf
! V# c* r- A& e, K
# s9 }& h4 F/ n0 ?" ?/ H[DEFAULT]
& Q9 ^' S. ~5 e* s9 e& ?; R7 Z5 a! ?7 x6 |" D
enabled_backends = ceph8 n* w6 t3 a% n2 _

# c4 H9 E6 a/ f6 [[ceph]6 ^. u7 h. w! ]) t
  t2 A! C8 W$ m/ F) Q# K7 }! b
volume_driver = cinder.volume.drivers.rbd.RBDDriver
' q  j  c$ ^( {# dvolume_backend_name = ceph* e' ~! o! L" s6 a  z6 ]% }9 s
rbd_pool = volumes8 m1 f- Y$ C6 o' n4 G5 v. p
rbd_ceph_conf = /etc/ceph/ceph.conf9 X7 I  ^+ G9 z  K. g' T1 w
rbd_flatten_volume_from_snapshot = false0 k$ o; D& D5 d3 P
rbd_max_clone_depth = 5; v* W3 V& s3 n0 a7 z
rbd_store_chunk_size = 49 K* k9 u. Z3 C/ s. M/ B
rados_connect_timeout = -1
2 K5 V4 h: E7 P$ L. j* Oglance_api_version = 2
4 N: B; E* C% Z/ b! Frbd_user = ceph
/ K% }; G, A" F+ X, O/ ^rbd_secret_uuid = 791c2ef6-bc56-43b0-b2c7-0cd863621040
# j4 j. I( T, K6 f% v. _restart cinder-volume service, P/ Q# E4 g* E! c1 U$ `
8 B2 F2 v. A8 K
# systemctl restart  openstack-cinder-volume.service! G4 C; s" i8 }* A9 K. {# q; G

/ V# C, h, ^7 o" H* l% k. H; k3 e) c3 f$ j0 S
& v* d8 F2 z4 Z+ w& G
对接compute
0 z$ _! `# D" f" J+ d) |install
- O2 g& O# A6 N  U, ~' @% c8 D8 u2 s+ h- r! j
# yum install ceph-common python-rbd9 K6 g- e. F! J
edit nova config
. f9 ]4 j* Y( ]7 C2 a; H1 R
" q6 k# P4 S) L( W: r[cinder]: o& I* O- H+ \# X& w+ L  t9 j
os_region_name = RegionOne
9 Q6 W7 U2 Y) X' {. Y7 `; L) F! I) |0 ~- ]0 Q7 _7 p/ n
[libvirt]
* R( C5 ?8 [  V- y0 ^( gimages_type = rbd
* i; k: Q  G$ D! U- y0 T# `: ~images_rbd_pool = compute
* `  T) d# ?# }) K" C5 Yimages_rbd_ceph_conf = /etc/ceph/ceph.conf- k+ ?( {4 _( W& G  f2 g2 p* f: p2 P
disk_cachemodes="network=writeback"
8 l7 B+ Y( j3 H1 H  m; D: x: E8 zrbd_user = ceph8 ~+ U" Q) I! q! \$ {$ k
rbd_secret_uuid = 791c2ef6-bc56-43b0-b2c7-0cd863621040. ^1 D' _, c- y7 F

4 R, a! D8 ^0 q! D+ Q7 {+ dinject_password = false2 b- T4 m) e# t: W. s- }6 J# r
inject_key = false
. M8 C% b/ y$ f( B  A- Iinject_partition = -2# Y9 L% P$ c8 s! A% ]8 a4 a

1 [8 N2 k/ X" e  j7 q! }% Hlive_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST,VIR_MIGRATE_TUNNELLED"
7 N  m0 p. Z) J* J/ N. r( uhw_disk_discard = unmap
! V3 [6 i- e4 }" D  U
, J# m0 w) x0 T' I4 z
7 Z0 i0 ~! q$ {( \/ p. Z; X7 }+ f+ e
4 ^! ?* g$ d. @, \: ?) ]
copy ceph config  g! V6 x8 ]2 u  t

5 a2 J7 F5 g/ y# scp ceph-node:/etc/ceph/ceph.conf /etc/ceph/ceph.client.ceph.keyring  /etc/ceph
' |* X8 H# g7 _. ]4 c# chown nova:nova /etc/ceph/ceph.conf  /etc/ceph/ceph.client.ceph.keyring
& X( X( Y5 `+ j- t# y2 J8 Jcopy ceph user keyring) P, e8 K* u8 Z: F, k3 g' \
: \3 w1 k  P8 W8 {+ }
; e. m. k' }9 w* p3 x
[ceph-monitor]# ceph auth get-key client.ceph >> client.ceph.key0 }9 W4 L. _; H  V- j$ R5 G
[ceph-monitor]# scp client.ceph.key compute:/etc/nova- Y5 y) f- `& w) h

) C# \5 y# q: l& f$ F, q& s6 o0 f, f9 t! O0 r7 u9 ]

# Z# X8 K, f' [+ f" |& M8 G% k设置libvird! W3 }3 B9 j  i# H, l5 Z" z/ Q

& S4 O5 W8 L8 e- |" v# uuidgen ) C- ^0 l, M# A* V3 T. G) O
791c2ef6-bc56-43b0-b2c7-0cd863621040( g8 v) u- j+ X5 S  Y3 n" x3 m3 s5 E7 V
# i' E" h9 t" `6 X
# cat > secret.xml <<EOF
( |* o+ \/ G1 G- _<secret ephemeral='no' private='no'>" B1 A5 J1 {$ A4 A0 Q# w
  <uuid>791c2ef6-bc56-43b0-b2c7-0cd863621040</uuid>
6 ]" a& U' ?( N( b  <usage type='ceph'>1 f& z8 n; c8 {" {! r( _
    <name>client.cinder secret</name>0 z+ u% b4 U1 }; W0 r; Y8 ^$ m9 o& D
  </usage>
: q3 G0 a$ R& H9 Q7 _</secret>1 t* W8 v  ]( \1 x, m
EOF
& S% \( s5 D8 s: d  F' k/ z) J% v9 j$ }; M' l" ~6 Y
# virsh secret-define --file secret.xml
% t. S, |  P# t  i( v& ^Secret 791c2ef6-bc56-43b0-b2c7-0cd863621040 created
. E' v' u9 z% c" P% |7 y
, |5 ]0 m4 M) F, O! m# virsh secret-set-value --secret 791c2ef6-bc56-43b0-b2c7-0cd863621040 --base64 $(cat client.ceph.key)                                     # i# M- L. H6 }" l* ]% o
Secret value set1 d* K$ P: v  d9 L; h$ E" d7 A
restart nova-compute8 _5 g& X! t- _1 q
3 L& ]$ Y& A# d9 T* u' M7 @
systemctl restart openstack-nova-compute.service
$ Q" {& a5 V9 S. u$ p3 ]% m

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2018-10-13 11:07:34 | 显示全部楼层
创建存储池
3 J; V3 b! z6 a* }& u1 @3 U4 p# N: J. M0 ^8 O- D
# ceph osd pool create images 64
* J5 L- c& ~- e0 P+ i# ceph osd pool create compute 64
5 Z# w. b' A& a9 n; K# ceph osd pool create volumes 64
, I& q; p0 ]) U! O% A9 o) F# ceph osd pool create backups 648 E6 S0 ^* T% {( ]8 F4 ^  _4 i
Create Ceph User ceph
$ B4 Z' ^% H7 t
4 q5 W4 W: k2 @+ y) K# ceph auth get-or-create client.ceph mon 'allow r' osd 'allow class-read object_prefix rbd_children, \
+ C! }3 d- Z0 ], }* h( f# Aallow rwx pool=images, allow rwx pool=compute, allow rwx pool=volumes, allow rwx pool=backups'% M  h/ v2 x, R
[client.ceph]" P" `  t! e% d% T
        key = AQDIistY4xELCxAAPkelu47q/fxM3R8B732jlw==2 p: z# T( E) ~/ u; C+ y
+ A) s8 H' G& `& u' s9 N; \
copy user.keyring to glance-api node and cinder-volume node3 ?# ~; n( F. j6 H# @& G
7 d) z0 E, M  |2 E
ceph-monitor # ceph auth get-or-create client.ceph >> ceph.client.ceph.keyring2 l+ L- U1 c5 ~9 t  O# t% N
# scp ceph.client.ceph.keyring ceph.conf controller:/etc/ceph/, x$ b; ^( g5 ]
# scp ceph.client.ceph.keyring ceph.conf cinder-volume:/etc/ceph/
: X, _9 M$ |: s; _1 b! G+ W7 |4 A6 A5 ^6 n: |, \
对接glance-api
0 \' e& f2 m5 X) v& e: a; C6 finstall rbd
  c$ z. m3 ?) `" C' ^  @. \6 w8 H  L+ e) Z
& g: W: ~+ I7 C; K* V4 C7 A
# yum install ceph-common python-rbd
' S% {5 G, ^* \. @' z6 v$ W设置key权限) d4 j9 g2 X4 D* h; e" D
6 D1 ~' z+ h8 }# U/ s" H7 @& D

2 a+ {* g& x; E+ Q0 D4 U# chown glance:glance /etc/ceph/ceph.client.ceph.keyring
! p/ P5 n9 k' \+ R: uedit /etc/glance/glance-api.conf5 V% K  D6 b  g8 ~. Q

9 {. q+ @# e: W! V
: A7 n2 V2 g8 ^1 m7 [/ l[DEFAULT]
) \- ~1 D! D' m$ i. F...# M( |* h) F9 T/ ^$ V
default_store = rbd
9 D) d  b4 _! [1 ~..., z: U! T$ f8 }2 @- g
[glance_store]
1 A2 [8 Z; u9 j' D" \+ mstores = rbd# Y" T4 m* ]( Y2 K( J
rbd_store_pool = images, c: ^& P9 M& v* M, E9 w
rbd_store_user = ceph8 ?! ^0 U9 c6 `% z
rbd_store_ceph_conf = /etc/ceph/ceph.conf
. U6 W4 V) i  srbd_store_chunk_size = 84 t, H, h: j. ]
restart glance service
) J$ F% P9 k) Y! |) y: \7 |3 P3 _# _- @8 B8 V

3 j- e2 X/ d1 w# stemctl restart openstack-glance-api.service   openstack-glance-registry.service# O" b! j, y) j# {' z' y
对接cinder-volume' Z) t- w3 p# R, Y
install ceph-common
+ |1 G' g6 c4 H, s* Q4 {" P, R5 _* y, k' \
# yum install ceph-common   python-rbd$ ]* o; ]  k$ ]4 ^; V# j1 e+ M
设置key权限0 o8 [& E% X, U& \6 z2 i
  m1 l( Z6 W  R6 A; R7 a$ B4 U& G7 S
; v/ Z9 L( l% @) z) p
# chown cinder:cinder /etc/ceph/ceph.client.ceph.keyring
5 w" o  j' {( p$ a1 medit /etc/cinder/cinder.conf
& Q* v8 Y; I- \4 z8 x
0 D4 Y- b! I! }9 w/ ]" Z[DEFAULT]
6 x; @+ @) D, G$ `* Z% V( m% ^9 w+ t8 a& w7 [
enabled_backends = ceph4 l5 B9 Z' M6 u) v

4 q  e3 A& F4 F, G* W; n! ^9 m[ceph]* `' f( H) Y' A9 w

5 h8 S: K: ]+ y4 w$ O" c! g; jvolume_driver = cinder.volume.drivers.rbd.RBDDriver
# z& V) K0 [- kvolume_backend_name = ceph" c" k8 B3 E2 e! M! A) [
rbd_pool = volumes! L+ T0 H+ l, w, y
rbd_ceph_conf = /etc/ceph/ceph.conf
5 r+ ?4 i% a0 h1 ~. P1 e  }* Crbd_flatten_volume_from_snapshot = false/ `# r" O' A: g( N1 x1 r0 ?
rbd_max_clone_depth = 5
: G* a& |" ]0 J9 lrbd_store_chunk_size = 4
; V0 |5 z0 S9 h6 d+ Grados_connect_timeout = -1* y( Q. ?' g6 U4 ?/ l
glance_api_version = 2
6 p' h3 g: h% C1 yrbd_user = ceph
9 z2 u1 X7 `9 ]. |. arbd_secret_uuid = 791c2ef6-bc56-43b0-b2c7-0cd863621040# T3 x$ T8 g3 m9 Q8 A3 V/ L+ ^
restart cinder-volume service. W3 Z4 {" y& i- D7 [% }: G

3 J6 \$ c$ A& j8 B# systemctl restart  openstack-cinder-volume.service
4 y4 n7 j0 M2 N! o对接compute
4 ]) O! ?3 V  @9 ~0 E8 c, X! [install+ L1 _7 [! Y1 X' \! L

: W- \: }) C1 [; ?9 z4 z# yum install ceph-common python-rbd
) R/ G% t" e: T0 Redit nova config5 [  o  u# a. ]* G; }, A, ]/ H
5 s9 y9 c  a& r3 [! S% Q
[cinder]6 u' C9 D& V+ v: o9 J& v
os_region_name = RegionOne
$ w6 P' Y: K: D  j' i1 P
& I3 \6 ~" h) H% c[libvirt]
5 _9 F% q/ \( \9 W/ E' {# R: ?; l9 n6 O" Ximages_type = rbd, s2 D4 T$ o/ \
images_rbd_pool = compute
3 z- {9 o$ d, c% y' ^: Yimages_rbd_ceph_conf = /etc/ceph/ceph.conf
" [) ?; q3 ^8 Tdisk_cachemodes="network=writeback"4 v6 N$ p$ Z  _8 R0 d7 q8 p" ?
rbd_user = ceph' r  R' e  Q" K2 O5 g  J4 H0 q
rbd_secret_uuid = 791c2ef6-bc56-43b0-b2c7-0cd863621040
4 B# `) S0 }" B0 Q/ [3 Q+ I6 F/ v( G% {
inject_password = false8 J+ c$ A3 o; s9 T! e: J+ N* m: I
inject_key = false
/ S1 f' l! Y$ p( Linject_partition = -2( {, r2 o( t: I" j

# ]  i8 Q: ?: \) j4 Zlive_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST,VIR_MIGRATE_TUNNELLED"% d$ n6 r) I. S8 \7 O5 b4 L6 N- d
hw_disk_discard = unmap
& A( Z7 p3 Q3 T& }6 m: n' M& ]copy ceph config
9 u2 R9 _0 @2 f3 j! N7 {" j' R* A0 x8 a/ ?) G/ J" p0 S
# scp ceph-node:/etc/ceph/ceph.conf /etc/ceph/ceph.client.ceph.keyring  /etc/ceph
: m9 W$ Z. x2 d0 a2 H" S  d7 c# chown nova:nova /etc/ceph/ceph.conf  /etc/ceph/ceph.client.ceph.keyring
; @3 |0 c4 W4 Z) _# b0 l4 {5 x  Ycopy ceph user keyring9 |4 d" Y# o! ^0 P8 T" Y. i
  d2 o; D8 N- Q6 X: I
& }7 L) m9 l# b- D
[ceph-monitor]# ceph auth get-key client.ceph >> client.ceph.key8 [1 |. A' _: g# l+ y; B
[ceph-monitor]# scp client.ceph.key compute:/etc/nova
4 O2 N6 i# H  J- |设置libvird& t) V+ s* y/ K# M
4 s3 B# i: ^  a) U8 Z4 V
# uuidgen & u, z0 [. j  n/ |. D6 X) f
791c2ef6-bc56-43b0-b2c7-0cd863621040( h, A4 l# z. V) P* S# y
/ q0 ?( A/ T: D" o+ B
# cat > secret.xml <<EOF% Z0 A! h# o% `- c: `1 l+ X6 S
<secret ephemeral='no' private='no'>
0 ]1 ^) i% J2 L4 ]$ }+ [  <uuid>791c2ef6-bc56-43b0-b2c7-0cd863621040</uuid>
- |% ~* z9 Z  p1 l  <usage type='ceph'>
) m& S  i3 g% \    <name>client.cinder secret</name>
& q9 E1 ^4 s9 C) X  </usage>2 G" p$ ?; ~+ H9 ]
</secret>9 N0 ^  ?# d7 W( A, c9 {  V9 T- z# k
EOF, O$ r+ z0 i( Y" ~" _

7 b0 b, e0 J$ ]' _9 i3 F2 S# virsh secret-define --file secret.xml
4 {/ K  l, o% i9 G" CSecret 791c2ef6-bc56-43b0-b2c7-0cd863621040 created" P5 e1 b2 ]! ]3 h4 p" m

: z# f) S; E$ o$ _: p/ f6 w1 v# virsh secret-set-value --secret 791c2ef6-bc56-43b0-b2c7-0cd863621040 --base64 $(cat client.ceph.key)                                    
2 u7 l6 |6 g+ h1 ~& a( jSecret value set
# O6 z! l  [' I4 n0 U# rrestart nova-compute) R9 Y  S5 q$ D2 M6 S& P+ S" n

7 q* G% ]) A" Y- c% ~/ [9 ~systemctl restart openstack-nova-compute.service
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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