Ceph is an open-source storage platform that offers a highly scalable and robust solution for diverse data storage needs. This tutorial guides you step-by-step through the process of setting up and managing a software-defined storage using Ceph.
Setting Up and Configuring Ceph
Introduction to Ceph
Ceph delivers object, block, and file storage in a single, unified system. As a software-defined storage solution, Ceph allows a network of devices to be used as a coherent storage system. This enables enterprises to lower storage costs, streamline data management, and enhance scalability.
For more information about Ceph, visit their official documentation here.
Prerequisites
- At least three Ubuntu 20.04 LTS servers with SSH access and sudo privileges.
- Familiarity with Linux command line interface.
- Basic understanding of software-defined storage concepts.
Step 1: Setting Up the Environment
Firstly, ensure that your servers are updated. On each server, run:
sudo apt-get update
sudo apt-get upgrade
Step 2: Installing Ceph
To install Ceph, we’ll use the Cephadm deployment tool that simplifies the installation process. Run the following commands on each node:
curl --silent --remote-name --location https://github.com/ceph/ceph/raw/octopus/src/cephadm/cephadm
chmod +x cephadm
sudo ./cephadm add-repo --release octopus
sudo ./cephadm install
Step 3: Creating the Cluster
On your main (bootstrap) node, start the new Ceph cluster:
sudo ./cephadm bootstrap --mon-ip $MON_IP
Replace $MON_IP
with the IP of your main node.
Step 4: Adding Nodes to the Cluster
Add the remaining nodes to the cluster. On the main node, generate a keyring file:
sudo ./cephadm shell --fsid $FSID --name client.admin
ceph auth get client.bootstrap-osd -o bootstrap-osd.keyring
exit
Copy this keyring and the ceph.conf file to the new nodes:
scp /etc/ceph/ceph.conf root@node_IP:/etc/ceph/
scp /var/lib/ceph/bootstrap-osd/ceph.keyring root@node_IP:/var/lib/ceph/bootstrap-osd/
On the new node, add it to the cluster:
sudo ./cephadm shell --fsid $FSID --name client.admin
ceph orch host add node2
exit
Repeat these steps for each additional node.
Step 5: Managing the Ceph Storage
To check the status of your cluster, use the command:
ceph -s
To add a storage device:
ceph orch daemon add osd node1:/dev/sdb
Replace node1:/dev/sdb
with your node and device path.
In case you want to remove a storage device:
ceph orch osd rm 1
Replace 1
with your OSD ID.
Conclusion on Setting Up Ceph
Setting up and managing software-defined storage using Ceph might seem daunting, but with the right understanding and execution, it becomes a task that offers vast advantages to your storage needs.
Related Articles