Book Image

Ceph: Designing and Implementing Scalable Storage Systems

By : Michael Hackett, Vikhyat Umrao, Karan Singh, Nick Fisk, Anthony D'Atri, Vaibhav Bhembre
Book Image

Ceph: Designing and Implementing Scalable Storage Systems

By: Michael Hackett, Vikhyat Umrao, Karan Singh, Nick Fisk, Anthony D'Atri, Vaibhav Bhembre

Overview of this book

This Learning Path takes you through the basics of Ceph all the way to gaining in-depth understanding of its advanced features. You’ll gather skills to plan, deploy, and manage your Ceph cluster. After an introduction to the Ceph architecture and its core projects, you’ll be able to set up a Ceph cluster and learn how to monitor its health, improve its performance, and troubleshoot any issues. By following the step-by-step approach of this Learning Path, you’ll learn how Ceph integrates with OpenStack, Glance, Manila, Swift, and Cinder. With knowledge of federated architecture and CephFS, you’ll use Calamari and VSM to monitor the Ceph environment. In the upcoming chapters, you’ll study the key areas of Ceph, including BlueStore, erasure coding, and cache tiering. More specifically, you’ll discover what they can do for your storage system. In the concluding chapters, you will develop applications that use Librados and distributed computations with shared object classes, and see how Ceph and its supporting infrastructure can be optimized. By the end of this Learning Path, you'll have the practical knowledge of operating Ceph in a production environment. This Learning Path includes content from the following Packt products: • Ceph Cookbook by Michael Hackett, Vikhyat Umrao and Karan Singh • Mastering Ceph by Nick Fisk • Learning Ceph, Second Edition by Anthony D'Atri, Vaibhav Bhembre and Karan Singh
Table of Contents (27 chapters)
Title Page
About Packt
Contributors
Preface
Index

Setting up a virtual infrastructure


To set up a virtual infrastructure, you will require open source software, such as Oracle VirtualBox and Vagrant, to automate virtual machine creation for you. Make sure you have the software installed and working correctly on your host machine. The installation processes of the software are beyond the scope of this book; you can follow their respective documentation in order to get them installed and working correctly.

Getting ready

You will need the following software to get started:

  • Oracle VirtualBox: This is an open source virtualization software package for host machines based on x86 and AMD64/Intel64. It supports Microsoft Windows, Linux, and Apple macOS X host operating systems. Make sure it's installed and working correctly. More information can be found at https://www.virtualbox.org.

Once you have installed VirtualBox, run the following command to ensure the installation was successful:

      # VBoxManage --version

  • Vagrant: This is software meant for creating virtual development environments. It works as a wrapper around virtualization software, such as VirtualBox, VMware, KVM, and so on. It supports the Microsoft Windows, Linux, and Apple macOS X host operating systems. Make sure it's installed and working correctly. More information can be found at https://www.vagrantup.com/. Once you have installed Vagrant, run the following command to ensure the installation was successful:
      # vagrant --version
  • Git: This is a distributed revision control system and the most popular and widely adopted version control system for software development. It supports Microsoft Windows, Linux, and Apple macOS X operating systems. Make sure it's installed and working correctly. More information can be found at http://git-scm.com/.

Once you have installed Git, run the following command to ensure the installation was successful:

 

       # git --version

How to do it...

Once you have installed the mentioned software, we will proceed with virtual machine creation:

  1. git clone Ceph-Designing-and-Implementing-Scalable-Storage-Sytems repository to your VirtualBox host machine:
      $ git clone https://github.com/PacktPublishing/Ceph-Designing-and-Implementing-Scalable-Storage-Systems
  1. Under the directory, you will find vagrantfile, which is our Vagrant configuration file that basically instructs VirtualBox to launch the VMs that we require at different stages of this book. Vagrant will automate the VM's creation, installation, and configuration for you; it makes the initial environment easy to set up:
      $ cd Ceph-Designing-and-Implementing-Scalable-Storage-Systems ; ls -l

_

  1. Next, we will launch three VMs using Vagrant; they are required throughout this chapter:
      $ vagrant up ceph-node1 ceph-node2 ceph-node3

Note

If the default Vagrant provider is not set to VirtualBox, set it to VirtualBox. To make it permanent, it can be added to user .bashrc file:# export VAGRANT_DEFAULT_PROVIDER=virtualbox# echo $VAGRANT_DEFAULT_PROVIDER

  1. Run vagrant up ceph-node1 ceph-node2 ceph-node3.
  2. Check the status of your virtual machines:
      $ vagrant status ceph-node1 ceph-node2 ceph-node3

Note

The username and password that Vagrant uses to configure virtual machine is vagrant, and Vagrant hassudorights. The default password for the root user isvagrant.

  1. Vagrant will, by default, set up hostnames as ceph-node<node_number> and IP address subnet as 192.168.1.X and will create three additional disks that will be used as OSDs by the Ceph cluster. Log in to each of these machines one by one and check whether the hostname, networking, and additional disks have been set up correctly by Vagrant:
      $ vagrant ssh ceph-node1
      $ ip addr show
      $ sudo fdisk -l
      $ exit

 

 

 

 

  1. Vagrant is configured to update hosts file on the VMs. For convenience, update the /etc/hosts file on your host machine with the following content:
      192.168.1.101 ceph-node1
      192.168.1.102 ceph-node2
      192.168.1.103 ceph-node3
  1. Update all the three VM's to the latest CentOS release and reboot to the latest kernel.
  2. Generate root SSH keys for ceph-node1 and copy the keys to ceph-node2 and ceph-node3. The password for the root user on these VMs is vagrant. Enter the root user password when asked by the ssh-copy-id command and proceed with the default settings:
      $ vagrant ssh ceph-node1
      $ sudo su -
      # ssh-keygen
      # ssh-copy-id root@ceph-node1
      # ssh-copy-id root@ceph-node2
      # ssh-copy-id root@ceph-node3
  1. Once the SSH keys are copied to ceph-node2 and ceph-node3, the root user from ceph-node1 can do an ssh login to VMs without entering the password:
      # ssh ceph-node2 hostname
      # ssh ceph-node3 hostname
  1. Enable ports that are required by the Ceph MON, OSD, and MDS on the operating system's firewall. Execute the following commands on all VMs:
      # firewall-cmd --zone=public --add-port=6789/tcp --permanent
      # firewall-cmd --zone=public --add-port=6800-7100/tcp --permanent
      # firewall-cmd --reload
      # firewall-cmd --zone=public --list-all
  1. Install and configure NTP on all VMs:
      # yum install ntp ntpdate -y
      # ntpdate pool.ntp.org
      # systemctl restart ntpdate.service
      # systemctl restart ntpd.service
      # systemctl enable ntpd.service
      # systemctl enable ntpdate.service