5 .. index:: systemd; operating a cluster
8 Running Ceph with systemd
9 =========================
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:
18 sudo systemctl start ceph.target # start all daemons
19 sudo systemctl status ceph-osd@12 # check status of osd.12
21 To list all of the Ceph systemd units on a node, run the following command:
25 sudo systemctl status ceph\*.service ceph\*.target
31 To start all of the daemons on a Ceph node (regardless of their type), run the
36 sudo systemctl start ceph.target
42 To stop all of the daemons on a Ceph node (regardless of their type), run the
47 sudo systemctl stop ceph\*.service ceph\*.target
50 Starting all daemons by type
51 ----------------------------
53 To start all of the daemons of a particular type on a Ceph node, run one of the
58 sudo systemctl start ceph-osd.target
59 sudo systemctl start ceph-mon.target
60 sudo systemctl start ceph-mds.target
63 Stopping all daemons by type
64 ----------------------------
66 To stop all of the daemons of a particular type on a Ceph node, run one of the
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
79 To start a specific daemon instance on a Ceph node, run one of the
84 sudo systemctl start ceph-osd@{id}
85 sudo systemctl start ceph-mon@{hostname}
86 sudo systemctl start ceph-mds@{hostname}
92 sudo systemctl start ceph-osd@1
93 sudo systemctl start ceph-mon@ceph-server
94 sudo systemctl start ceph-mds@ceph-server
100 To stop a specific daemon instance on a Ceph node, run one of the
105 sudo systemctl stop ceph-osd@{id}
106 sudo systemctl stop ceph-mon@{hostname}
107 sudo systemctl stop ceph-mds@{hostname}
113 sudo systemctl stop ceph-osd@1
114 sudo systemctl stop ceph-mon@ceph-server
115 sudo systemctl stop ceph-mds@ceph-server
118 .. index:: sysvinit; operating a cluster
120 Running Ceph with SysVinit
121 ==========================
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. ::
127 {commandline} [options] [commands] [daemons]
129 The ``ceph`` options include:
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 +-----------------+----------+-------------------------------------------------+
148 The ``ceph`` commands include:
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 +------------------+------------------------------------------------------------+
166 The ``[daemons]`` option allows the ``ceph`` service to target specific daemon types
167 in order to perform subsystem operations. Daemon types include:
173 .. _Valgrind: http://www.valgrind.org/
174 .. _initctl: http://manpages.ubuntu.com/manpages/raring/en/man8/initctl.8.html