Running Ceph as a service

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]

Starting and stopping all daemons

To start or stop all Ceph daemons, perform the following set of commands.

How to do it…

Let's see how to start and stop all Ceph daemons:

  1. To start your Ceph cluster, execute Ceph with the 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
    
  2. To stop your Ceph cluster, execute Ceph with the 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
    

Starting and stopping all daemons by type

To start or stop all Ceph daemons by their types, perform the following set of commands.

How to do it…

Let's see how to start and stop daemons by type.

Starting daemons by type

  1. To start the Ceph monitor daemons on localhost, execute the Ceph service with the start command followed by the daemon type:
    # service ceph start mon
    
  2. To start the Ceph monitor daemons on all the hosts, execute the same command with the -a option:
    # service ceph -a start mon
    
  3. Similarly, you can start daemons of other types, that is, osd, mds, and ceph-radosgw:
    # service ceph start osd
    # service ceph start mds
    # service ceph start ceph-radosgw
    

Stopping daemons by type

  1. To stop the Ceph monitor daemons on localhost, execute service ceph with the stop command followed by the daemon type:
    # service ceph stop mon
    
  2. To stop the Ceph monitor daemons on all the hosts, execute the same command with the -a option:
    # service ceph -a stop mon
    
  3. Similarly, you can stop daemons of other types, that is, osd, mds, and ceph-radosgw:
    # service ceph stop osd
    # service ceph stop mds
    # service ceph stop ceph-radosgw
    

Starting and stopping a specific daemon

To start or stop a specific Ceph daemon, perform the following set of commands.

How to do it…

Let's see how to start and stop specific daemons.

Starting a specific daemon

To start a specific daemon on localhost, execute Ceph with the start command followed by {daemon_type}.{instance}, for example:

  1. Start the mon.0 daemon:
    # service ceph start mon.ceph-node1
    
  2. Similarly, you can start other daemons and their instances:
    # service ceph start osd.1
    # service ceph -a start mds.ceph-node2
    # service ceph start ceph-radosgw.gateway1
    

Stopping a specific daemon

To stop a specific Ceph daemon on localhost, execute Ceph with the stop command followed by {daemon_type}.{instance}, for example:

  1. Stop the mon.0 daemon:
    # service ceph start mon.ceph-node1
    
  2. Similarly, you can stop other daemons and their instances:
    # service ceph stop osd.1
    # service ceph -a stop mds.ceph-node2
    # service ceph stop ceph-radosgw.gateway1
    
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.57.126