官术网_书友最值得收藏!

Installing and configuring Ceph

To deploy our first Ceph cluster, we will use the ceph-deploy tool to install and configure Ceph on all three virtual machines. The ceph-deploy tool is a part of the Ceph software-defined storage, which is used for easier deployment and management of your Ceph storage cluster. In the previous section, we created three virtual machines with CentOS7, which have connectivity with the Internet over NAT, as well as private host-only networks.

We will configure these machines as Ceph storage clusters, as mentioned in the following diagram:

Creating Ceph cluster on ceph-node1

We will first install Ceph and configure ceph-node1 as the Ceph monitor and the Ceph OSD node. Later recipes in this chapter will introduce ceph-node2 and ceph-node3.

How to do it…

  1. Install ceph-deploy on ceph-node1:
    # yum install ceph-deploy -y
    
  2. Next, we will create a Ceph cluster using ceph-deploy by executing the following command from ceph-node1:
    # mkdir /etc/ceph ; cd /etc/ceph
    # ceph-deploy new ceph-node1
    

    The new subcommand in ceph-deploy deploys a new cluster with ceph as the cluster name, which is by default; it generates a cluster configuration and keying files. List the present working directory; you will find the ceph.conf and ceph.mon.keyring files:

  3. To install Ceph software binaries on all the machines using ceph-deploy, execute the following command from ceph-node1:
    # ceph-deploy install ceph-node1 ceph-node2 ceph-node3
    

    The ceph-deploy tool will first install all the dependencies followed by the Ceph Giant binaries. Once the command completes successfully, check the Ceph version and Ceph health on all the nodes, as shown as follows:

    # ceph -v
    
  4. Create first the Ceph monitor in ceph-node1:
    # ceph-deploy mon create-initial
    

    Once the monitor creation is successful, check your cluster status. Your cluster will not be healthy at this stage:

    # ceph -s
    
  5. Create OSDs on ceph-node1:
    1. List the available disks on ceph-node1:
      # ceph-deploy disk list ceph-node1
      

      From the output, carefully select the disks (other than the OS partition) on which we should create the Ceph OSD. In our case, the disk names are sdb, sdc, and sdd.

    2. The disk zap subcommand would destroy the existing partition table and content from the disk. Before running this command, make sure that you are using the correct disk device name:
      # ceph-deploy disk zap ceph-node1:sdb ceph-node1:sdc ceph-node1:sdd
      
    3. The osd create subcommand will first prepare the disk, that is, erase the disk with a filesystem that is xfs by default, and then it will activate the disk's first partition as data partition and its second partition as journal:
      # ceph-deploy osd create ceph-node1:sdb ceph-node1:sdc ceph-node1:sdd
      
    4. Check the Ceph status and notice the OSD count. At this stage, your cluster would not be healthy; we need to add a few more nodes to the Ceph cluster so that it can replicate objects three times (by default) across cluster and attain healthy status. You will find more information on this in the next recipe:
      # ceph -s
      
主站蜘蛛池模板: 桃源县| 固安县| 乌鲁木齐县| 绥中县| 河西区| 榆社县| 北京市| 伊宁市| 锦屏县| 武隆县| 临清市| 九台市| 丰台区| 荔波县| 台安县| 盱眙县| 永济市| 潜江市| 满洲里市| 卢龙县| 潮安县| 梨树县| 夏河县| 成武县| 通江县| 英超| 赤壁市| 察隅县| 财经| 民勤县| 新巴尔虎右旗| 西吉县| 江阴市| 商丘市| 年辖:市辖区| 闵行区| 高邮市| 通河县| 仙桃市| 汤原县| 五河县|