]> git.proxmox.com Git - ceph.git/blob - ceph/doc/rados/operations/operating.rst
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / doc / rados / operations / operating.rst
1 =====================
2 Operating a Cluster
3 =====================
4
5 .. index:: systemd; operating a cluster
6
7
8 Running Ceph with systemd
9 ==========================
10
11 For all distributions that support systemd (CentOS 7, Fedora, Debian
12 Jessie 8 and later, SUSE), ceph daemons are now managed using native
13 systemd files instead of the legacy sysvinit scripts. For example::
14
15 sudo systemctl start ceph.target # start all daemons
16 sudo systemctl status ceph-osd@12 # check status of osd.12
17
18 To list the Ceph systemd units on a node, execute::
19
20 sudo systemctl status ceph\*.service ceph\*.target
21
22 Starting all Daemons
23 --------------------
24
25 To start all daemons on a Ceph Node (irrespective of type), execute the
26 following::
27
28 sudo systemctl start ceph.target
29
30
31 Stopping all Daemons
32 --------------------
33
34 To stop all daemons on a Ceph Node (irrespective of type), execute the
35 following::
36
37 sudo systemctl stop ceph\*.service ceph\*.target
38
39
40 Starting all Daemons by Type
41 ----------------------------
42
43 To start all daemons of a particular type on a Ceph Node, execute one of the
44 following::
45
46 sudo systemctl start ceph-osd.target
47 sudo systemctl start ceph-mon.target
48 sudo systemctl start ceph-mds.target
49
50
51 Stopping all Daemons by Type
52 ----------------------------
53
54 To stop all daemons of a particular type on a Ceph Node, execute one of the
55 following::
56
57 sudo systemctl stop ceph-mon\*.service ceph-mon.target
58 sudo systemctl stop ceph-osd\*.service ceph-osd.target
59 sudo systemctl stop ceph-mds\*.service ceph-mds.target
60
61
62 Starting a Daemon
63 -----------------
64
65 To start a specific daemon instance on a Ceph Node, execute one of the
66 following::
67
68 sudo systemctl start ceph-osd@{id}
69 sudo systemctl start ceph-mon@{hostname}
70 sudo systemctl start ceph-mds@{hostname}
71
72 For example::
73
74 sudo systemctl start ceph-osd@1
75 sudo systemctl start ceph-mon@ceph-server
76 sudo systemctl start ceph-mds@ceph-server
77
78
79 Stopping a Daemon
80 -----------------
81
82 To stop a specific daemon instance on a Ceph Node, execute one of the
83 following::
84
85 sudo systemctl stop ceph-osd@{id}
86 sudo systemctl stop ceph-mon@{hostname}
87 sudo systemctl stop ceph-mds@{hostname}
88
89 For example::
90
91 sudo systemctl stop ceph-osd@1
92 sudo systemctl stop ceph-mon@ceph-server
93 sudo systemctl stop ceph-mds@ceph-server
94
95
96 .. index:: Upstart; operating a cluster
97
98 Running Ceph with Upstart
99 ==========================
100
101 Starting all Daemons
102 --------------------
103
104 To start all daemons on a Ceph Node (irrespective of type), execute the
105 following::
106
107 sudo start ceph-all
108
109
110 Stopping all Daemons
111 --------------------
112
113 To stop all daemons on a Ceph Node (irrespective of type), execute the
114 following::
115
116 sudo stop ceph-all
117
118
119 Starting all Daemons by Type
120 ----------------------------
121
122 To start all daemons of a particular type on a Ceph Node, execute one of the
123 following::
124
125 sudo start ceph-osd-all
126 sudo start ceph-mon-all
127 sudo start ceph-mds-all
128
129
130 Stopping all Daemons by Type
131 ----------------------------
132
133 To stop all daemons of a particular type on a Ceph Node, execute one of the
134 following::
135
136 sudo stop ceph-osd-all
137 sudo stop ceph-mon-all
138 sudo stop ceph-mds-all
139
140
141 Starting a Daemon
142 -----------------
143
144 To start a specific daemon instance on a Ceph Node, execute one of the
145 following::
146
147 sudo start ceph-osd id={id}
148 sudo start ceph-mon id={hostname}
149 sudo start ceph-mds id={hostname}
150
151 For example::
152
153 sudo start ceph-osd id=1
154 sudo start ceph-mon id=ceph-server
155 sudo start ceph-mds id=ceph-server
156
157
158 Stopping a Daemon
159 -----------------
160
161 To stop a specific daemon instance on a Ceph Node, execute one of the
162 following::
163
164 sudo stop ceph-osd id={id}
165 sudo stop ceph-mon id={hostname}
166 sudo stop ceph-mds id={hostname}
167
168 For example::
169
170 sudo stop ceph-osd id=1
171 sudo start ceph-mon id=ceph-server
172 sudo start ceph-mds id=ceph-server
173
174
175 .. index:: sysvinit; operating a cluster
176
177 Running Ceph with sysvinit
178 ==========================
179
180 Each time you to **start**, **restart**, and **stop** Ceph daemons (or your
181 entire cluster) you must specify at least one option and one command. You may
182 also specify a daemon type or a daemon instance. ::
183
184 {commandline} [options] [commands] [daemons]
185
186
187 The ``ceph`` options include:
188
189 +-----------------+----------+-------------------------------------------------+
190 | Option | Shortcut | Description |
191 +=================+==========+=================================================+
192 | ``--verbose`` | ``-v`` | Use verbose logging. |
193 +-----------------+----------+-------------------------------------------------+
194 | ``--valgrind`` | ``N/A`` | (Dev and QA only) Use `Valgrind`_ debugging. |
195 +-----------------+----------+-------------------------------------------------+
196 | ``--allhosts`` | ``-a`` | Execute on all nodes in ``ceph.conf.`` |
197 | | | Otherwise, it only executes on ``localhost``. |
198 +-----------------+----------+-------------------------------------------------+
199 | ``--restart`` | ``N/A`` | Automatically restart daemon if it core dumps. |
200 +-----------------+----------+-------------------------------------------------+
201 | ``--norestart`` | ``N/A`` | Don't restart a daemon if it core dumps. |
202 +-----------------+----------+-------------------------------------------------+
203 | ``--conf`` | ``-c`` | Use an alternate configuration file. |
204 +-----------------+----------+-------------------------------------------------+
205
206 The ``ceph`` commands include:
207
208 +------------------+------------------------------------------------------------+
209 | Command | Description |
210 +==================+============================================================+
211 | ``start`` | Start the daemon(s). |
212 +------------------+------------------------------------------------------------+
213 | ``stop`` | Stop the daemon(s). |
214 +------------------+------------------------------------------------------------+
215 | ``forcestop`` | Force the daemon(s) to stop. Same as ``kill -9`` |
216 +------------------+------------------------------------------------------------+
217 | ``killall`` | Kill all daemons of a particular type. |
218 +------------------+------------------------------------------------------------+
219 | ``cleanlogs`` | Cleans out the log directory. |
220 +------------------+------------------------------------------------------------+
221 | ``cleanalllogs`` | Cleans out **everything** in the log directory. |
222 +------------------+------------------------------------------------------------+
223
224 For subsystem operations, the ``ceph`` service can target specific daemon types
225 by adding a particular daemon type for the ``[daemons]`` option. Daemon types
226 include:
227
228 - ``mon``
229 - ``osd``
230 - ``mds``
231
232
233
234 .. _Valgrind: http://www.valgrind.org/
235 .. _initctl: http://manpages.ubuntu.com/manpages/raring/en/man8/initctl.8.html