]> git.proxmox.com Git - ceph.git/blob - ceph/doc/rados/operations/operating.rst
update ceph source to reef 18.1.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 In all distributions that support systemd (CentOS 7, Fedora, Debian
12 Jessie 8 and later, and SUSE), systemd files (and NOT legacy SysVinit scripts)
13 are used to manage Ceph daemons. Ceph daemons therefore behave like any other daemons
14 that can be controlled by the ``systemctl`` command, as in the following examples:
15
16 .. prompt:: bash $
17
18 sudo systemctl start ceph.target # start all daemons
19 sudo systemctl status ceph-osd@12 # check status of osd.12
20
21 To list all of the Ceph systemd units on a node, run the following command:
22
23 .. prompt:: bash $
24
25 sudo systemctl status ceph\*.service ceph\*.target
26
27
28 Starting all daemons
29 --------------------
30
31 To start all of the daemons on a Ceph node (regardless of their type), run the
32 following command:
33
34 .. prompt:: bash $
35
36 sudo systemctl start ceph.target
37
38
39 Stopping all daemons
40 --------------------
41
42 To stop all of the daemons on a Ceph node (regardless of their type), run the
43 following command:
44
45 .. prompt:: bash $
46
47 sudo systemctl stop ceph\*.service ceph\*.target
48
49
50 Starting all daemons by type
51 ----------------------------
52
53 To start all of the daemons of a particular type on a Ceph node, run one of the
54 following commands:
55
56 .. prompt:: bash $
57
58 sudo systemctl start ceph-osd.target
59 sudo systemctl start ceph-mon.target
60 sudo systemctl start ceph-mds.target
61
62
63 Stopping all daemons by type
64 ----------------------------
65
66 To stop all of the daemons of a particular type on a Ceph node, run one of the
67 following commands:
68
69 .. prompt:: bash $
70
71 sudo systemctl stop ceph-osd\*.service ceph-osd.target
72 sudo systemctl stop ceph-mon\*.service ceph-mon.target
73 sudo systemctl stop ceph-mds\*.service ceph-mds.target
74
75
76 Starting a daemon
77 -----------------
78
79 To start a specific daemon instance on a Ceph node, run one of the
80 following commands:
81
82 .. prompt:: bash $
83
84 sudo systemctl start ceph-osd@{id}
85 sudo systemctl start ceph-mon@{hostname}
86 sudo systemctl start ceph-mds@{hostname}
87
88 For example:
89
90 .. prompt:: bash $
91
92 sudo systemctl start ceph-osd@1
93 sudo systemctl start ceph-mon@ceph-server
94 sudo systemctl start ceph-mds@ceph-server
95
96
97 Stopping a daemon
98 -----------------
99
100 To stop a specific daemon instance on a Ceph node, run one of the
101 following commands:
102
103 .. prompt:: bash $
104
105 sudo systemctl stop ceph-osd@{id}
106 sudo systemctl stop ceph-mon@{hostname}
107 sudo systemctl stop ceph-mds@{hostname}
108
109 For example:
110
111 .. prompt:: bash $
112
113 sudo systemctl stop ceph-osd@1
114 sudo systemctl stop ceph-mon@ceph-server
115 sudo systemctl stop ceph-mds@ceph-server
116
117
118 .. index:: sysvinit; operating a cluster
119
120 Running Ceph with SysVinit
121 ==========================
122
123 Each time you start, restart, or stop Ceph daemons, you must specify at least one option and one command.
124 Likewise, each time you start, restart, or stop your entire cluster, you must specify at least one option and one command.
125 In both cases, you can also specify a daemon type or a daemon instance. ::
126
127 {commandline} [options] [commands] [daemons]
128
129 The ``ceph`` options include:
130
131 +-----------------+----------+-------------------------------------------------+
132 | Option | Shortcut | Description |
133 +=================+==========+=================================================+
134 | ``--verbose`` | ``-v`` | Use verbose logging. |
135 +-----------------+----------+-------------------------------------------------+
136 | ``--valgrind`` | ``N/A`` | (Dev and QA only) Use `Valgrind`_ debugging. |
137 +-----------------+----------+-------------------------------------------------+
138 | ``--allhosts`` | ``-a`` | Execute on all nodes listed in ``ceph.conf``. |
139 | | | Otherwise, it only executes on ``localhost``. |
140 +-----------------+----------+-------------------------------------------------+
141 | ``--restart`` | ``N/A`` | Automatically restart daemon if it core dumps. |
142 +-----------------+----------+-------------------------------------------------+
143 | ``--norestart`` | ``N/A`` | Do not restart a daemon if it core dumps. |
144 +-----------------+----------+-------------------------------------------------+
145 | ``--conf`` | ``-c`` | Use an alternate configuration file. |
146 +-----------------+----------+-------------------------------------------------+
147
148 The ``ceph`` commands include:
149
150 +------------------+------------------------------------------------------------+
151 | Command | Description |
152 +==================+============================================================+
153 | ``start`` | Start the daemon(s). |
154 +------------------+------------------------------------------------------------+
155 | ``stop`` | Stop the daemon(s). |
156 +------------------+------------------------------------------------------------+
157 | ``forcestop`` | Force the daemon(s) to stop. Same as ``kill -9``. |
158 +------------------+------------------------------------------------------------+
159 | ``killall`` | Kill all daemons of a particular type. |
160 +------------------+------------------------------------------------------------+
161 | ``cleanlogs`` | Cleans out the log directory. |
162 +------------------+------------------------------------------------------------+
163 | ``cleanalllogs`` | Cleans out **everything** in the log directory. |
164 +------------------+------------------------------------------------------------+
165
166 The ``[daemons]`` option allows the ``ceph`` service to target specific daemon types
167 in order to perform subsystem operations. Daemon types include:
168
169 - ``mon``
170 - ``osd``
171 - ``mds``
172
173 .. _Valgrind: http://www.valgrind.org/
174 .. _initctl: http://manpages.ubuntu.com/manpages/raring/en/man8/initctl.8.html