|
|
创建存储池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
|
|