Scaling up the Ceph cluster is one of the important tasks for the Ceph administrator. This includes adding more monitor and OSD nodes to your cluster. We recommend that you use an odd number of monitor nodes for high availability and quorum maintenance; however, this is not mandatory. Scaling up and scaling down operation for monitor and OSD nodes are absolute online operations and does not cost downtime. In our test deployment, we have a single node, ceph-node1, which acts as monitor and OSD nodes. Let's now add two more monitors to our Ceph cluster.
Proceed with the following steps:
# mkdir -p /var/lib/ceph/mon/ceph-ceph-node2 /tmp/ceph-node2
[mon.ceph-node2] mon_addr = 192.168.57.102:6789 host = ceph-node2
# ceph auth get mon. -o /tmp/ceph-node2/monkeyring
# ceph mon getmap -o /tmp/ceph-node2/monmap
# ceph-mon -i ceph-node2 --mkfs --monmap /tmp/ceph-node2/monmap --keyring /tmp/ceph-node2/monkeyring
# ceph mon add ceph-node2 192.168.57.102:6789
It is easy to scale up your cluster by adding OSDs on the fly. Earlier in this chapter, we learned to create OSD; this process is similar to scaling up your cluster for adding more OSDs. Log in to the node, which needs its disks to be added to cluster and perform the following operations:
# ceph-disk list
# parted /dev/sdb mklabel GPT # parted /dev/sdc mklabel GPT # parted /dev/sdd mklabel GPT
# ceph-disk prepare --cluster ceph --cluster-uuid 07a92ca3-347e-43db-87ee-e0a0a9f89e97 --fs-type xfs /dev/sdb # ceph-disk prepare --cluster ceph --cluster-uuid 07a92ca3-347e-43db-87ee-e0a0a9f89e97 --fs-type xfs /dev/sdc # ceph-disk prepare --cluster ceph --cluster-uuid 07a92ca3-347e-43db-87ee-e0a0a9f89e97 --fs-type xfs /dev/sdd
# ceph-disk activate /dev/sdb1 # ceph-disk activate /dev/sdc1 # ceph-disk activate /dev/sdd1
18.220.88.62