|
|
楼主 |
发表于 2022-4-12 09:28:21
|
显示全部楼层
16 Operating Ceph Services REPORT DOCUMENTATION BUG#EDIT SOURCE/ O7 k7 t% l0 R" K
16.1 Operating Ceph Cluster Related Services Using systemd8 b2 K8 y6 ^ j
16.2 Restarting Ceph Services Using DeepSea" E7 P, \9 z6 t# p$ I& M
16.3 Shutdown and Start of the Whole Ceph Cluster
1 b$ ~) B# ^. _, z9 aYou can operate Ceph services either using systemd or using DeepSea.
; i7 O% ^6 h* ?0 a; y1 c$ g6 R
16.1 Operating Ceph Cluster Related Services Using systemd REPORT DOCUMENTATION BUG#EDIT SOURCE' h4 x. L5 o) P8 I( |% p; V
Use the systemctl command to operate all Ceph related services. The operation takes place on the node you are currently logged in to. You need to have root privileges to be able to operate on Ceph services./ ?. v \1 @: w+ v; B6 p [
; V9 l2 l& N# E' @- `' Q. W$ h
16.1.1 Starting, Stopping, and Restarting Services Using Targets REPORT DOCUMENTATION BUG#EDIT SOURCE! t/ p% e" z7 I
To simplify starting, stopping, and restarting all the services of a particular type (for example all Ceph services, or all MONs, or all OSDs) on a node, Ceph provides the following systemd unit files:
3 V# N7 w9 m1 `% N/ T- K! j
/ l K, s) O; p# R+ |. Uls /usr/lib/systemd/system/ceph*.target' |' w+ s. |7 a# g1 W3 u) R
ceph.target- b- a. M/ R p$ C
ceph-osd.target
4 u1 n P; S( H/ }* E1 ^5 qceph-mon.target
' f$ Q/ j4 ? |ceph-mgr.target! Z6 ^2 I! g/ d% u! P# I
ceph-mds.target. r! \5 H. p R: c/ u2 A2 a
ceph-radosgw.target T) R! D9 H7 r0 f# G+ x8 F+ u& g
ceph-rbd-mirror.target
. a8 k" I+ z, @6 n% `COPY
" W" I! _( d3 ?: H0 Z5 f2 \" nTo start/stop/restart all Ceph services on the node, run:8 M/ f0 D& l7 F6 {4 J: h
. r0 | Z" y+ `# n0 x3 Qsystemctl start ceph.target
6 {6 h1 N% c f$ O: p" v3 wsystemctl stop ceph.target
$ c5 N4 n; i' ]( u3 b5 Asystemctl restart ceph.target/ l2 A, d2 a6 l3 h
COPY$ c6 Y* j6 N5 o) ]4 ~, d
To start/stop/restart all OSDs on the node, run:
" \; L, ~5 }9 h$ U
. t% B- s8 {& u7 Psystemctl start ceph-osd.target
& ]2 o* Z5 t6 d) R* Q& w: fsystemctl stop ceph-osd.target. \0 C1 Z2 K" G+ p8 R m
systemctl restart ceph-osd.target
4 t( k: x. F5 a9 v- DCOPY
9 h; F: [$ @7 {( b( {0 ]Commands for the other targets are analogous.
7 Y4 u4 m- U2 |+ L7 U$ I% P p9 a; m' n A3 o* _: p5 m! l
16.1.2 Starting, Stopping, and Restarting Individual Services REPORT DOCUMENTATION BUG#EDIT SOURCE% [; d* @, ]6 X
You can operate individual services using the following parameterized systemd unit files:$ J' _4 D& g# N' D0 r4 Y
. }2 `, D$ a# E+ l- Mceph-osd@.service
' l1 F4 M, j, s& ?' Yceph-mon@.service2 d& T; |0 D+ U, }& H1 G% j
ceph-mds@.service/ d6 B$ z6 t6 O' O/ h D
ceph-mgr@.service
, x+ D+ a" c, @* J" {ceph-radosgw@.service
; E E; j) `$ Gceph-rbd-mirror@.service
; P9 s7 h0 I+ ]COPY" v3 \5 t! j0 J* C4 N3 S: E0 R, W/ t' i
To use these commands, you first need to identify the name of the service you want to operate. See Section 16.1.3, “Identifying Individual Services” to learn more about services identification.
% n7 C5 r. B6 o2 m5 ?5 F5 |0 u W# B# ~% o" x ^' O/ |/ t0 _! g
To start, stop or restart the osd.1 service, run:& x! z+ \5 A a, \' i' R# Y, I" u) M
; }3 O) q6 y [
systemctl start ceph-osd@1.service
+ n$ `$ q6 f3 \# V$ K8 W+ S" \systemctl stop ceph-osd@1.service- l# O& `4 ^% n0 F( b) I" c/ A) t
systemctl restart ceph-osd@1.service
$ i- \* O' h) J' KCOPY1 |* ?1 [& Q7 \- R: n: N1 Q. e3 c
Commands for the other service types are analogous.0 [+ r& n1 }+ u0 [
- K) d" ?5 o0 K8 K# z
16.1.3 Identifying Individual Services REPORT DOCUMENTATION BUG#EDIT SOURCE
9 ~4 _5 r$ x7 G3 aYou can find out the names/numbers of a particular type of service in several ways. The following commands provide results for ceph* services. You can run them on any node of the Ceph cluster.
* U7 O: N. l0 \! g! o* b. W9 E z9 ?1 A/ E
To list all (even inactive) services of type ceph*, run:- \% t% Q; B4 C! Q; s, V B, R+ {
$ l+ j, t3 k+ s9 J# g' T3 asystemctl list-units --all --type=service ceph*/ Y I. M' r. w% N/ a- q1 ~
COPY
) d& y6 T1 E+ o& `5 D; v+ W- |To list only the inactive services, run:+ f. f. O& P# W
+ m% B% z6 K4 t+ y" j
systemctl list-units --all --state=inactive --type=service ceph*$ R) X. A2 P/ f& e
COPY
& W3 `5 A; ]3 d# d$ ~6 JYou can also use salt to query services across multiple nodes:0 r- f, y, y8 z: C+ }6 U( e# U2 E
, V, g% z j K. ?# h8 |, B
salt TARGET cmd.shell \
& K, k4 E1 M+ Y "systemctl list-units --all --type=service ceph* | sed -e '/^$/,$ d'" m5 X) p0 R4 p1 d( `; W( N/ U
COPY
W: n/ E1 U% N& x4 r$ qQuery storage nodes only:
1 ?& s% c6 b. E) R; G* a5 j/ p; d% B( ]1 y! R8 B7 u- a, [3 H
salt -I 'roles:storage' cmd.shell \. l+ a( ]8 L. T, R
'systemctl list-units --all --type=service ceph*'* G$ M, a4 y8 w9 k3 \* N6 J
COPY
, N( J3 `/ ~. j16.1.4 Service Status REPORT DOCUMENTATION BUG#EDIT SOURCE
" e9 Y5 f2 Y. m4 _! X3 i0 H5 vYou can query systemd for the status of services. For example:, }0 e$ r" z! e
0 A2 y/ N# Z1 p! o. H4 w8 vsystemctl status ceph-osd@1.service
+ `% ?0 `' p6 d& G: l0 x2 v) u* H) fsystemctl status ceph-mon@HOSTNAME.service2 I: G, O8 a1 X6 q" D
COPY6 d7 J8 M* |8 P7 W8 X3 t! E) N$ ~
Replace HOSTNAME with the host name the daemon is running on.0 h! L# w0 X( J( v8 X! D" P1 Q9 }
) [: h8 Y; v+ l* ?# R( rIf you do not know the exact name/number of the service, see Section 16.1.3, “Identifying Individual Services”./ C; ]% n$ T6 i4 G
* l$ x _4 a Z+ E r8 y8 J* f5 v16.2 Restarting Ceph Services Using DeepSea REPORT DOCUMENTATION BUG#EDIT SOURCE V( O( f! z5 W& A K( [
After applying updates to the cluster nodes, the affected Ceph related services need to be restarted. Normally, restarts are performed automatically by DeepSea. This section describes how to restart the services manually.- `( `( x. s1 p h6 F
* l+ ?2 m. a" E+ d& S7 g: s& e9 M: QTipTip: Watching the Restart
2 E5 f1 N9 D4 b& q0 OThe process of restarting the cluster may take some time. You can watch the events by using the Salt event bus by running:5 F& f2 o8 F$ a4 p. ~
g! u* \! G- B. L6 I
salt-run state.event pretty=True1 }5 v2 o: h$ `, `. v% N9 r
COPY
1 u8 z) L7 L& }8 m4 J3 ?3 f3 IAnother command to monitor active jobs is
+ W, ?! d, h( e) s Z `6 @$ O5 X# m7 k& j& g7 O e* W) \2 j
salt-run jobs.active5 t) w( w1 s5 @& s; Y
COPY8 I5 k/ I- Q9 E2 o& u2 ^/ f
16.2.1 Restarting All Services REPORT DOCUMENTATION BUG#EDIT SOURCE. A. |7 ^) x: Q: T; a) [
WarningWarning: Interruption of Services4 i) K' u h4 V: K+ f
If Ceph related services—specifically iSCSI or NFS Ganesha—are configured as single points of access with no High Availability setup, restarting them will result in their temporary outage as viewed from the client side.
9 U2 E7 E! {- B( {% Q' r; Z1 K- [, Q4 u4 M* M
TipTip: Samba Not Managed by DeepSea; M5 H/ v8 S7 N. q6 x
Because DeepSea and the Ceph Dashboard do not currently support Samba deployments, you need to manage Samba related services manually. For more details, see Chapter 29, Exporting Ceph Data via Samba.
7 ~( r7 `- N3 w$ `" F+ T8 [
6 C2 W l# V7 TTo restart all services on the cluster, run the following command:7 ]# n' T9 Y/ h) {
6 P8 H3 R5 o: \, ^ ^% c; s
salt-run state.orch ceph.restart
/ l. a* X7 x$ x8 s+ sCOPY
- {, U$ j+ G ?; n1 {2 n3 z( x# f: M+ CFor DeepSea prior to version 0.8.4, the Metadata Server, iSCSI Gateway, Object Gateway, and NFS Ganesha services restart in parallel.
1 C0 K2 b- X+ V4 K7 ]. B
u: P: n4 f# N* ~For DeepSea 0.8.4 and newer, all roles you have configured restart in the following order: Ceph Monitor, Ceph Manager, Ceph OSD, Metadata Server, Object Gateway, iSCSI Gateway, NFS Ganesha. To keep the downtime low and to find potential issues as early as possible, nodes are restarted sequentially. For example, only one monitoring node is restarted at a time.8 Z3 h& v" p5 z& `7 B
7 g' ?2 M% c2 k' K* G: }/ m8 P" ~The command waits for the cluster to recover if the cluster is in a degraded, unhealthy state.
5 q; b2 a) i# v- X
4 A* {) V0 x. S16.2.2 Restarting Specific Services REPORT DOCUMENTATION BUG#EDIT SOURCE- E' L& V- H% x- I: p/ [
To restart a specific service on the cluster, run:) h1 K! X, Z. |8 j4 Z
$ F; {3 L* s' N( b% h) k Vsalt-run state.orch ceph.restart.service_name3 }. V) P9 L' _, z
COPY
+ k- I0 O) e& e# E' C" s8 v: KFor example, to restart all Object Gateways, run:
8 p2 i" `. H! f4 G( [! _
4 z0 j T. L! `* u! |: I. ]! ^salt-run state.orch ceph.restart.rgw
) o7 G+ }( M/ kCOPY
( ?/ l0 b0 s) D/ P% o+ ]1 ?You can use the following targets:7 G! V# A, A- A# H1 @: Z2 N8 k3 C
" O' ^& g9 v7 Y. |3 O
salt-run state.orch ceph.restart.mon9 Y% H( N% D+ R }
COPY- v" U6 ]) y1 ]& _4 k% _2 O$ ?, r
salt-run state.orch ceph.restart.mgr2 J$ _9 | b& B! ?
COPY
. B7 \: h( H' B" }/ Jsalt-run state.orch ceph.restart.osd- {; e% U5 h$ z4 \& q: J
COPY. N$ y/ Z8 @7 ?" H
salt-run state.orch ceph.restart.mds
. L( m1 v5 t, p: @6 Q/ l3 KCOPY
0 m; {' N3 Y/ p9 N2 osalt-run state.orch ceph.restart.rgw' B' g, Y! k; O8 u4 b) r: Z# d0 D
COPY
, d, h0 p" q$ Usalt-run state.orch ceph.restart.igw9 v& ]" u! G. H" r; X& C8 U+ M
COPY
. i$ O- g, l3 i' A/ ]9 G, r0 Lsalt-run state.orch ceph.restart.ganesha' I% _( z* i& G$ G/ a6 B( [
COPY
! R; W/ i( H& WThe restart orchestration checks if the installated binary is newer than the current one, or if configuration changes exist for this daemon and only restarts in those cases. If you run the above command and nothing happens, this is due to these conditions. See Section 16.1.2, “Starting, Stopping, and Restarting Individual Services” for more information.
\: r1 o3 J! p# J, d# y* ?, \! N& k: e7 C
16.3 Shutdown and Start of the Whole Ceph Cluster REPORT DOCUMENTATION BUG#EDIT SOURCE1 U) W3 Z W! |7 z8 P- X
There are occasions when you need to stop all Ceph related services in the cluster in the recommended order, and then be able to simply start them again. For example, in case of a planned power outage.( X) {, F- q6 w/ p
M: U; ~" }' Z$ @) E$ u: j! `PROCEDURE 16.1: SHUTTING DOWN THE WHOLE CEPH CLUSTER REPORT DOCUMENTATION BUG#) d$ ?* P9 @; |, f' {5 o+ y
Shut down or disconnect any clients accessing the cluster.4 V5 S6 X6 A; ^3 X
7 ~! }. ~+ M/ v, t1 w6 kTo prevent CRUSH from automatically rebalancing the cluster, set the cluster to noout:
1 y* X' _6 F/ A) G* q$ ~% t4 g- ^7 Z g$ I* P% ~
ceph osd set noout4 X# e0 X/ @& S9 Z) F
COPY
# N$ b6 t7 j& c' S* v0 hDisable safety measures and run the ceph.shutdown runner:
t# R7 B- z8 y2 o4 D9 {. t1 [0 `! U y* u0 r9 j" ]
salt-run disengage.safety4 e( L8 ~* X( N$ I3 H! i
salt-run state.orch ceph.shutdown
3 e! J7 a- ]6 o& N! DCOPY6 F$ ^# O% c- ~ C$ l7 e
Power off all cluster nodes:
# e) ]2 }& |+ p$ L: W* D
! H# @% Z3 E4 y, M {; u/ }( E( asalt -C 'G@deepsea:*' cmd.run "shutdown -h"# U/ \' r Z, r1 c
COPY" X; `+ r5 T' K2 v1 n& M. ^
PROCEDURE 16.2: STARTING THE WHOLE CEPH CLUSTER REPORT DOCUMENTATION BUG#
/ R: j/ r) n* w6 T7 M/ p4 GPower on the Admin Node.' d' v+ D" C7 ~% p5 q( _, D
1 u9 y: y! Y4 f2 J+ B( R
Power on the Ceph Monitor nodes.7 R8 m$ n* O/ E
- `; t- u/ W$ D9 ^) | k
Power on the Ceph OSD nodes.
$ J6 e$ {- P6 D" D s7 d3 O
$ S, o$ Y$ v& a. ~. fUnset the previously set noout flag:
3 a0 B" u* q# W, ~& U/ x0 C- x! V* ?2 s0 e, d b; u( G% c8 N
ceph osd unset noout
/ f( ]$ I& ^+ [5 T9 x8 n/ R5 PCOPY
J, H7 E1 o* X$ e' DPower on all configured gateways.
% C$ J) W k9 Q! s3 L$ b% e# @1 t/ e D2 C7 w8 N
Power on or connect cluster clients. |
|