In the last recipe, we learned about Ceph service management using sysvinit
; in this recipe, we will understand managing Ceph as a service, that is, using the Linux service
command. Starting from the Ceph Argonaut release, we can manage Ceph daemons using the Linux service
command with the following syntax:
service ceph [options] [command] [daemons]
To start or stop all Ceph daemons, perform the following set of commands.
Let's see how to start and stop all Ceph daemons:
start
command. This command will start all Ceph services that you have deployed for all the hosts mentioned in the ceph.conf
file. Once you start Ceph with the -a
option, Ceph should begin operating:# service ceph -a start
stop
command. This command will stop all Ceph services that you have deployed for all the hosts mentioned in the ceph.conf
file. Once you stop Ceph using the -a
option, Ceph should shut down:# service ceph -a stop
To start or stop all Ceph daemons by their types, perform the following set of commands.
Let's see how to start and stop daemons by type.
start
command followed by the daemon type:# service ceph start mon
-a
option:# service ceph -a start mon
osd
, mds
, and ceph-radosgw
:# service ceph start osd # service ceph start mds # service ceph start ceph-radosgw
service ceph
with the stop
command followed by the daemon type:# service ceph stop mon
-a
option:# service ceph -a stop mon
osd
, mds
, and ceph-radosgw
:# service ceph stop osd # service ceph stop mds # service ceph stop ceph-radosgw
Let's see how to start and stop specific daemons.
To start a specific daemon on localhost, execute Ceph with the start
command followed by {daemon_type}.{instance}
, for example:
mon.0
daemon:# service ceph start mon.ceph-node1
# service ceph start osd.1 # service ceph -a start mds.ceph-node2 # service ceph start ceph-radosgw.gateway1
To stop a specific Ceph daemon on localhost, execute Ceph with the stop
command followed by {daemon_type}.{instance}
, for example:
mon.0
daemon:# service ceph start mon.ceph-node1
# service ceph stop osd.1 # service ceph -a stop mds.ceph-node2 # service ceph stop ceph-radosgw.gateway1
3.15.235.188