Chapter 7. Ceph Operations and Maintenance

As a Ceph storage administrator, it will be quite useful for you to manage your enterprise Ceph cluster effectively. In this chapter, we will cover the following topics:

  • Ceph service management
  • Scaling out a Ceph cluster
  • Scaling down a Ceph cluster
  • Replacing a failed drive
  • Managing a CRUSH map

Ceph service management

As soon as you have your first Ceph cluster set up, you will need to manage it. As a Ceph storage administrator, one should know about Ceph services and how to use them. On Red Hat-based distributions, Ceph daemons can be managed in two ways, as a traditional sysvinit or as a service. Now, let's learn more about these methods of service management.

Running Ceph with sysvinit

sysvinit is a traditional, yet still recommended, method of managing Ceph daemons on RedHat-based systems as well as some older Debian/Ubuntu-based distributions. The general syntax to manage Ceph daemons using sysvinit is as follows:

/etc/init.d/ceph [options] [command] [daemons]

The Ceph options include:

  • --verbose (-v): Used for verbose logging
  • --allhosts (-a): Executes on all nodes mentioned in ceph.conf, otherwise on localhost
  • --conf (-c): Uses alternate configuration file

The Ceph commands include:

  • status: Shows the status of the daemon
  • start: Starts the daemon
  • stop: Stops the daemon
  • restart: Stops, and then starts the daemon
  • forcestop: Forces the daemon to stop; this is similar to kill -9

The Ceph daemons include:

  • mon
  • osd
  • mds
  • ceph-radosgw

Starting daemons by type

During your cluster administration, you might require to manage Ceph services by their types. In this section, we will learn how to start daemons by their types.

To start Ceph monitor daemons on localhost, execute Ceph with the start command:

# /etc/init.d/ceph start mon

To start all of the Ceph monitor daemons on local as well as remote hosts, execute Ceph with the start command and the -a option:

# /etc/init.d/ceph -a start mon

The -a option will perform the requested operation on all the nodes mentioned in the ceph.conf file. Have a look at the following screenshot:

Starting daemons by type

Similarly, you can start daemons of other types, such as mon and mds:

# /etc/init.d/ceph start osd
# /etc/init.d/ceph start mds

Note

If you are using the -a option while starting services of any type, make sure your ceph.conf file has all your Ceph hosts defined there. If the -a option is not used, the command will only be executed on localhost.

Stopping daemons by type

In this section, we will learn about stopping Ceph daemons by their types.

To stop Ceph monitor daemons on localhost, execute Ceph with the stop command:

# /etc/init.d/ceph stop mon

To stop Ceph monitor daemons on all hosts, execute Ceph with the stop command and the -a option:

# /etc/init.d/ceph -a stop mon

The -a option will perform the requested operation on all the nodes mentioned in the ceph.conf file. The following screenshot shows these commands in action:

Stopping daemons by type

Similarly, you can stop daemons of other types, such as mon and mds:

# /etc/init.d/ceph stop osd
# /etc/init.d/ceph stop mds

Tip

If you are using the -a option while starting services of any type, make sure your ceph.conf file has all your Ceph hosts defined there. If hosts are not defined in the ceph.conf file, the command will only be executed on localhost.

Starting and stopping all daemons

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:

# /etc/init.d/ceph -a start

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:

# /etc/init.d/ceph -a stop

Starting and stopping a specific daemon

To start a specific daemon for your Ceph cluster, execute Ceph with the start command and daemon ID:

# /etc/init.d/ceph start osd.0

To check the status of a specific daemon for your Ceph cluster, execute Ceph with the status command and daemon ID:

# /etc/init.d/ceph status osd.0

To stop a specific daemon for your Ceph cluster, execute Ceph with the stop command and daemon ID:

# /etc/init.d/ceph stop osd.0

This screenshot shows the output of the preceding commands:

Starting and stopping a specific daemon

Similarly, you can manage specific daemons for the monitor and mds of your Ceph cluster.

..................Content has been hidden....................

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