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

ceph 对接openstack mitaka

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2018-10-12 17:14:45 | 显示全部楼层 |阅读模式
创建存储池1 m: f5 P+ p6 R6 b

2 v+ R2 q5 h1 h& }7 \5 k# ceph osd pool create images 64
) w5 l# @+ j+ J# ^# ceph osd pool create compute 64/ l1 f6 d' ~" V# d2 F1 R( V
# ceph osd pool create volumes 64
: ^. b: Y% Q" w' w# ceph osd pool create backups 64
& ~& D5 w( g7 ^/ Q& ACreate Ceph User ceph  I2 l) b! J+ e2 v- s) G4 z3 n' q" \
7 B5 O6 j$ @: ?! \$ Q
# ceph auth get-or-create client.ceph mon 'allow r' osd 'allow class-read object_prefix rbd_children, \$ r+ C% e, L' R% }% J, J
allow rwx pool=images, allow rwx pool=compute, allow rwx pool=volumes, allow rwx pool=backups'
4 Q# t& {3 d' n2 _3 ]! ^[client.ceph]0 n$ o8 \$ [6 l& u: S
        key = AQDIistY4xELCxAAPkelu47q/fxM3R8B732jlw==
, F+ v# F+ ?4 E! |
* X; G! |) C3 F; t$ M4 |1 Kcopy user.keyring to glance-api node and cinder-volume node+ P2 @& k' P% K: o; z2 H
0 p! o1 F! x6 u
ceph-monitor # ceph auth get-or-create client.ceph >> ceph.client.ceph.keyring
. v* D- e1 `2 G" T. I& Z# scp ceph.client.ceph.keyring ceph.conf controller:/etc/ceph/5 \% ]0 z4 A" l  Y
# scp ceph.client.ceph.keyring ceph.conf cinder-volume:/etc/ceph/
; o; ^& V9 {& N& v5 ]+ u+ q) h& D/ I# k9 s' T' F$ O" i0 m
对接glance-api
1 ]# e- f5 q  c. e* ~7 h' I* d% Minstall rbd
6 O( \# h( E; v# M1 u, @2 w% X2 ]6 \% D

8 V) k) X% i. Q# yum install ceph-common python-rbd
9 a/ k( S" h# _1 F设置key权限$ @+ _) T4 a, `% z

, W, P$ v2 G1 S, P7 Q6 A( Y) f5 i
! S7 g1 O( W% X+ @+ X1 Z# chown glance:glance /etc/ceph/ceph.client.ceph.keyring
' [! E9 \% ?5 l8 s& g& medit /etc/glance/glance-api.conf
- L" u/ ^2 Q" T6 l( L! Q/ i% r3 C) ^' N

# g- E7 O6 X2 p, a[DEFAULT]7 ]8 z: r( Q' O5 h* E
...
' h- ^+ G6 Z. hdefault_store = rbd5 ?0 V. D6 l, H: w( U  k
.../ Q( B% ^2 }$ ^8 K, ~3 C6 k
[glance_store]! i# e. a4 T* C
stores = rbd# ?3 x! y* p( L% h3 s% p" R5 \1 h
rbd_store_pool = images7 D7 e% p4 |$ V# p
rbd_store_user = ceph* z  d5 u! O# }2 d5 u
rbd_store_ceph_conf = /etc/ceph/ceph.conf
! D+ [; b0 f6 z) d* a7 q& A: k( t  {rbd_store_chunk_size = 8: N& s; c, Q% S8 X; w
restart glance service
- p7 G3 G* H8 W1 M
" X& d* v! H; d$ ^7 Y7 x) q' Z' C- a, v- Q: B
# stemctl restart openstack-glance-api.service   openstack-glance-registry.service# Y) |$ C" C3 H' h5 Y' t- X

9 c7 @: e* v' t+ A# Z) k
/ r/ H9 p+ e; X, @, w$ t% v, x/ r对接cinder-volume2 n+ |" x8 Q7 t* t  ^
install ceph-common
4 F! w5 [0 P; Y; B" E
1 \( R" s3 a2 Y* h2 M/ l3 F6 z# yum install ceph-common   python-rbd
7 _9 A. j8 ]5 h9 q8 A设置key权限
/ b. \# k6 A9 t/ K+ a- X. r  I4 \/ p* S" B9 t- [$ p2 s

% e, h& t) \4 r/ `5 D8 T# }# chown cinder:cinder /etc/ceph/ceph.client.ceph.keyring8 R9 M1 {# b  v' n
edit /etc/cinder/cinder.conf0 G/ }+ L- t9 J- S0 w0 X# h6 Z
8 i1 X, s& l( j
[DEFAULT]) x! c) a) r# u" {
6 n1 P3 T4 r: m8 x+ i% \
enabled_backends = ceph
+ K1 _$ q0 |( f0 _# @
+ z  X4 K1 R8 i9 a" V9 |[ceph]
1 W, Z7 z* E! l( l  a6 q" g6 G* Q0 C8 p7 O. [) a+ b
volume_driver = cinder.volume.drivers.rbd.RBDDriver
* D4 v) u) |. g, j  J" \volume_backend_name = ceph
3 s& M5 c/ v  ?rbd_pool = volumes
  c( b* R4 i" P) U: Y5 Brbd_ceph_conf = /etc/ceph/ceph.conf
% x7 I8 |1 |6 x0 |  Orbd_flatten_volume_from_snapshot = false
6 J& {# b8 h4 `; G1 R& v/ R. }rbd_max_clone_depth = 5
$ z+ R; n' h: grbd_store_chunk_size = 4. |' k! |( _: o; O
rados_connect_timeout = -1# m- Q7 }0 h* N( E) n. q
glance_api_version = 2
  A  e* U: ]. H+ a& ^rbd_user = ceph
/ n9 M: B  n: Z- ?, @8 P4 \$ zrbd_secret_uuid = 791c2ef6-bc56-43b0-b2c7-0cd863621040
* ^/ P& P) p2 ?: Xrestart cinder-volume service. p+ E! I* R0 b% U0 @- Z* f

" i3 x3 o  |% r0 d: G# systemctl restart  openstack-cinder-volume.service
- ^! w" z8 ~) Z% k% j! m; G% E) n7 D8 X! |
9 i* I- X  M' c  j% o/ j6 `
7 t  X8 Y* z, j3 O' H
对接compute
4 ~# c+ i2 j7 Y& _9 |9 Z* A" winstall
1 K1 O5 u, D* x5 I4 q" Z& G, P" Y/ u0 `
# yum install ceph-common python-rbd* z( ?. q7 E0 n9 y/ y) c
edit nova config
' r+ J# m6 u; v: x* c+ Q2 o; {& X% r. q$ u7 O
[cinder]( x& F  ^( O7 d# a% n
os_region_name = RegionOne, j9 B( @' m% _* |( E- E  {

. C2 e. U  ~! W2 N* U[libvirt]5 \; V4 E0 L; R, M7 Y
images_type = rbd
6 I) J% R" J& k% r( G  g8 B9 uimages_rbd_pool = compute5 ^3 k& a0 h. Y2 O
images_rbd_ceph_conf = /etc/ceph/ceph.conf
& M. W  M$ B7 o9 r5 T, I+ Jdisk_cachemodes="network=writeback"0 I6 S- x0 X7 ~
rbd_user = ceph2 d4 ]% S- B3 ]& O+ Y
rbd_secret_uuid = 791c2ef6-bc56-43b0-b2c7-0cd8636210408 Z; j- Y; C( W; E+ s) {! g

- s: g$ v8 O' w+ ninject_password = false
& }: r3 p. }% X, u. \( jinject_key = false
. x, ~3 L  t3 w& K: U" t1 `inject_partition = -2
; x; p. [: b" r2 I& x
* \. w/ d$ }2 g5 `3 ?live_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST,VIR_MIGRATE_TUNNELLED"9 S3 i  g# b9 ^9 L& T) i
hw_disk_discard = unmap) ~6 O8 u" v/ m9 ]
5 p1 e" L+ w  H! H  G! a

* O4 r& v& l/ W0 s6 B" c( j0 K; A) m( ]
7 c) L9 k9 h! C& E/ _- c& @" ^% H
copy ceph config3 q$ ]* |0 t8 W' X& Q

" U) h) _) N8 w7 t# E% S* I; r7 e; u# scp ceph-node:/etc/ceph/ceph.conf /etc/ceph/ceph.client.ceph.keyring  /etc/ceph
( O9 s5 G* K. p6 `( Q# chown nova:nova /etc/ceph/ceph.conf  /etc/ceph/ceph.client.ceph.keyring9 R) p% q. I5 h8 W3 U
copy ceph user keyring
$ |. v3 a2 U/ n8 @1 L3 s5 W: r+ [
( J4 Z& Q4 t# G
2 A' L6 A# y4 N& S# m7 I[ceph-monitor]# ceph auth get-key client.ceph >> client.ceph.key" ^5 n: `+ Y: q
[ceph-monitor]# scp client.ceph.key compute:/etc/nova' U8 [1 w: K- U( n. [% a/ p3 q3 O
" T3 L0 P- X" ?  P% b- E- @) i

; q! J! l" H& P. V/ x, y) q/ ^# {/ K) @* T  ?
设置libvird" D! [7 O) F' p3 G3 h9 W0 A7 y  P

: |$ a7 j. ~8 }. A$ A# uuidgen 6 P: M" w" b# z; }8 J. J; y3 c# f! M( g
791c2ef6-bc56-43b0-b2c7-0cd863621040+ `0 h* u+ y" S
2 y* h& Y: R0 [; X, p+ A6 V) `
# cat > secret.xml <<EOF
7 O0 ^+ u1 ?6 |) h1 T, n$ e<secret ephemeral='no' private='no'>% g3 U. Q5 L& b  P  i+ J
  <uuid>791c2ef6-bc56-43b0-b2c7-0cd863621040</uuid>1 S( `) v7 |) ]' K+ B  R
  <usage type='ceph'>0 |9 [9 Z: W6 w' \% y* R4 e% w
    <name>client.cinder secret</name>$ B! M% W( @8 A
  </usage>9 a: b! ~, [+ n( e
</secret>% j5 I. }' Q" J. [6 f
EOF; X/ _, g/ U: u  r! B
4 B$ c$ u5 K4 |0 g9 ~( R6 [! f
# virsh secret-define --file secret.xml
& c  n+ H4 x' e& Y  LSecret 791c2ef6-bc56-43b0-b2c7-0cd863621040 created
$ _. H" O/ g( s9 @- z6 Y$ u- `- Q! o/ X5 o7 G/ v6 T
# virsh secret-set-value --secret 791c2ef6-bc56-43b0-b2c7-0cd863621040 --base64 $(cat client.ceph.key)                                    
0 H) [* k4 r9 S& Y% B& \2 _Secret value set
) g1 y) V5 a- l8 t6 Mrestart nova-compute" L$ D) a; I( }1 ^. Y& V
, O+ M* }" R7 S' w
systemctl restart openstack-nova-compute.service9 y% `# ^! [/ X' Y. L

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2018-10-13 11:07:34 | 显示全部楼层
创建存储池
2 B- L& Q+ l$ J& p" B
' g7 y9 p4 Y8 M$ ]: e1 W# ceph osd pool create images 64
/ k' ^( ^! j0 [/ L9 r# ceph osd pool create compute 64
3 ^; n5 j7 D3 d* H  ~. U3 r# ceph osd pool create volumes 64
' ^# `9 G6 s3 t3 \; d# A9 t# ceph osd pool create backups 64
1 H& v2 n; i  kCreate Ceph User ceph
( d4 |8 o7 N) Y! a% U. }* Y/ J2 s2 b% U  G2 G
# ceph auth get-or-create client.ceph mon 'allow r' osd 'allow class-read object_prefix rbd_children, \
; K: A6 C- U% H9 u  _6 Nallow rwx pool=images, allow rwx pool=compute, allow rwx pool=volumes, allow rwx pool=backups'+ w, c7 K: L1 V
[client.ceph]
3 c. Y" B* M* `7 v' r! [  j        key = AQDIistY4xELCxAAPkelu47q/fxM3R8B732jlw==* c. T5 y: R  s7 U- @: g3 c& @
( b) M( w1 y7 x! F; ^* v
copy user.keyring to glance-api node and cinder-volume node
! j. A8 M7 j5 @1 k  T/ U8 C4 s( ^2 a1 b6 ^2 m* c7 }
ceph-monitor # ceph auth get-or-create client.ceph >> ceph.client.ceph.keyring
: o( D6 k+ w+ \# scp ceph.client.ceph.keyring ceph.conf controller:/etc/ceph/6 I" C0 S% C2 I: t/ f
# scp ceph.client.ceph.keyring ceph.conf cinder-volume:/etc/ceph/5 t6 @2 h, Z' Z- a/ l1 Y

/ Z' i  ^6 L+ I0 T对接glance-api+ E/ L" H( e/ Q4 B0 g; K
install rbd% J' f& `! T. I& U

) Z1 R1 g% N1 Y
5 C# `% ~$ O1 l% V, r0 c# yum install ceph-common python-rbd
1 U1 Q" m% r5 l设置key权限' |' y5 X' E# y- j

+ U- G9 r  U2 ~3 N# q; t$ c
7 ?; U2 r- M3 [# chown glance:glance /etc/ceph/ceph.client.ceph.keyring! m6 f4 p# ^4 J$ Q/ X1 o
edit /etc/glance/glance-api.conf
7 \2 ]) @% }9 k
6 Y) N- M7 p8 B
, D! t$ w+ ^. R! U[DEFAULT]
/ l' {) O# ~$ Z6 K6 U% J...! ^( h. {* ?  T' L9 a3 z! Y
default_store = rbd& E7 P6 n8 V/ Z% h) |! t+ }  G% L
...2 z& E$ q! `) {; J- d, F
[glance_store]
3 g0 @& q) Y) }  H0 K1 P" R: H5 jstores = rbd' Y: p4 ~! D1 X( }3 k- ?
rbd_store_pool = images/ B6 c3 H- |+ N, X% n( a
rbd_store_user = ceph* n) p9 v" @) f% G# }& C2 ^( ]
rbd_store_ceph_conf = /etc/ceph/ceph.conf- Q1 y+ m* y+ x" E. V
rbd_store_chunk_size = 8
" i5 A2 t5 p& z& u+ ^restart glance service% T* w& ]+ p2 a, E$ N

7 B! C( R! E& t: I* f: h7 O; e" U( `# S* I
# stemctl restart openstack-glance-api.service   openstack-glance-registry.service8 c) F8 t% \  a/ l/ L
对接cinder-volume
0 i  {5 v5 D; Q9 `& [install ceph-common9 a% `, s0 _2 o. D, X& F
8 [! y9 }- ^; A* ^' r' @
# yum install ceph-common   python-rbd
0 n! H) D; x- \设置key权限9 w' `% c# L# B. A

* B8 |* d5 a; R/ h" e& _5 a1 x6 J8 M( p8 v$ d# e- x
# chown cinder:cinder /etc/ceph/ceph.client.ceph.keyring# K, V1 m" F" Y
edit /etc/cinder/cinder.conf8 H" \  M2 P% ]9 Z

5 X* h* o; {+ Z# o- A4 a$ M[DEFAULT]
& M2 |! c3 D+ w, K
( J  y* E$ J1 f: _+ B4 venabled_backends = ceph
! O$ ]* l$ B  Y: V; Q" ?: b5 u. _1 [$ Q, @; Z$ m; L. J4 z1 G, V
[ceph]
6 g1 k& j4 R- d& d, I5 @- \$ h
. I3 R! w* V: d$ Yvolume_driver = cinder.volume.drivers.rbd.RBDDriver/ H- R7 B; v3 c2 j0 u1 p
volume_backend_name = ceph
+ o" [2 ]2 X4 Q; v& }rbd_pool = volumes8 x- R& Z& B! _' k9 S% I3 }3 r% s" }4 \$ A
rbd_ceph_conf = /etc/ceph/ceph.conf7 b# @/ h! P& y1 T% {/ ?
rbd_flatten_volume_from_snapshot = false, Z% v) o' S1 ^- h
rbd_max_clone_depth = 5
# _& ^/ h6 R+ D; y2 b" drbd_store_chunk_size = 4
& u* j& d+ }9 D3 l3 x7 Jrados_connect_timeout = -1
& C4 Q$ D% X9 C* g! [1 s) yglance_api_version = 2
7 v1 j2 F: U6 b# Srbd_user = ceph8 n4 N' J$ S+ D( n; j+ R0 m( x
rbd_secret_uuid = 791c2ef6-bc56-43b0-b2c7-0cd863621040
7 Y9 T5 r* }0 |- ?6 D  `5 Vrestart cinder-volume service
6 D7 X+ i% ?# Z* Y" s- y& c* c" g; Z( r
# systemctl restart  openstack-cinder-volume.service1 P! z. T$ E% H
对接compute. w2 ^, o2 r8 d
install
6 [7 I$ S5 o! p" i& {8 L, c
- o& V  ]# |0 X' l# yum install ceph-common python-rbd
3 n+ X! S' S" [; i0 U) e2 u5 U+ J8 e. Dedit nova config% F+ g2 \5 j3 @& S; O! }7 W

) Z4 G' y! V/ Q8 W0 {7 p1 R! H[cinder]
& w- s8 J! y! @( U  m" Y" Aos_region_name = RegionOne) @: v, ~! g9 K+ @8 [4 Q

9 Y8 ^* e+ x# j" c[libvirt]
0 _# g2 h5 m( W/ c; zimages_type = rbd
, w9 {0 z+ \" }& Fimages_rbd_pool = compute
6 P$ j" i/ I5 H/ _/ l3 `- I, ~& |images_rbd_ceph_conf = /etc/ceph/ceph.conf4 W6 i+ r$ \5 Z+ f- n7 `
disk_cachemodes="network=writeback"# ^( c: s1 n& {7 V$ {
rbd_user = ceph
" }7 h" j8 k3 t4 N9 Y9 H1 o2 Zrbd_secret_uuid = 791c2ef6-bc56-43b0-b2c7-0cd863621040
, u1 t9 z+ z# w( k2 \- B* O4 s) r2 e2 R# x8 W5 {* \3 b
inject_password = false
6 M! N; f( U# Y7 iinject_key = false
9 S/ D3 ~# k6 Kinject_partition = -2) m6 W7 n1 y4 S/ p3 y
3 P. P1 T/ p3 z0 N6 {; h- d1 Z
live_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST,VIR_MIGRATE_TUNNELLED"
( H2 x; t- x/ v6 Jhw_disk_discard = unmap- O; _# \6 M) Y" n, |
copy ceph config; g! w6 V# H+ ^5 T

8 J" q" w8 u# U4 F% F! z/ |: H# scp ceph-node:/etc/ceph/ceph.conf /etc/ceph/ceph.client.ceph.keyring  /etc/ceph! K; Y$ O* L0 ?* w$ R
# chown nova:nova /etc/ceph/ceph.conf  /etc/ceph/ceph.client.ceph.keyring; r: A0 T4 a( I: R, I
copy ceph user keyring
2 c( `( G) P5 _7 S7 J3 V5 X2 |3 y
' E3 ^, e& Z7 E" ?) N) |: Q, I9 M! d# ~8 d
[ceph-monitor]# ceph auth get-key client.ceph >> client.ceph.key, H( \; g# m: s2 [
[ceph-monitor]# scp client.ceph.key compute:/etc/nova
0 b# ?* ?5 I: a( {- F' i2 u设置libvird$ W8 t7 L8 k7 s5 A) q0 |' A
1 d/ e( I" G, i  r$ P
# uuidgen
& j( O/ J, i7 h$ P! ^$ ~791c2ef6-bc56-43b0-b2c7-0cd863621040+ C  f$ b- \4 v2 u! W' f8 T
% w2 ~, |1 h" u* t  F
# cat > secret.xml <<EOF
8 E! M' p7 M0 b: g+ M7 G  A<secret ephemeral='no' private='no'>
8 J5 B7 T" C* n0 d# |7 ?4 T) D5 T  @  <uuid>791c2ef6-bc56-43b0-b2c7-0cd863621040</uuid>
8 u: F5 ]8 _* ]2 [  <usage type='ceph'>
: {' I" [. ]8 |* ~6 k' P6 h    <name>client.cinder secret</name>6 o, Q0 P6 g4 Q7 r: z* g
  </usage>: ?: ]1 G( W9 Q) p- v
</secret>6 I) ^" w& @  d1 G) \3 \
EOF
! A. T0 }, o! Y, f9 X5 Y& z
2 u! ~) I- s7 O+ o/ a* T# virsh secret-define --file secret.xml
* G* \- }% N$ L1 FSecret 791c2ef6-bc56-43b0-b2c7-0cd863621040 created- c' q& H5 B0 ?/ F/ [

& ?3 ]. |' L, o- s7 A# virsh secret-set-value --secret 791c2ef6-bc56-43b0-b2c7-0cd863621040 --base64 $(cat client.ceph.key)                                    
( ?" U: E" b- N4 o& E% e) ?' U, KSecret value set& {3 e1 p& J. q# o7 i  j5 g0 W
restart nova-compute0 a. o# F- a$ L8 q
9 r4 @5 ^3 ^" ^" x4 b6 `% Z; U* N
systemctl restart openstack-nova-compute.service
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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