How to Install Ceph on Debian Latest
This tutorial will guide you through the process of installing Ceph, an open source distributed storage system, on Debian Latest.
Prerequisites
Before installing Ceph, ensure that your system meets the following requirements:
- Debian Latest installed on all nodes
- At least one physical or virtual machine to act as the Ceph monitor node
- At least two physical or virtual machines to act as Ceph OSD nodes
Step 1: Add the Ceph repository
First, you need to add the Ceph repository to your system. Open a terminal window and run the following command:
sudo wget -q -O- 'https://download.ceph.com/keys/release.asc' | sudo apt-key add -
Next, add the Ceph repository to your system's sources list by running the following command:
echo "deb https://download.ceph.com/debian-luminous/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/ceph.list
Step 2: Install Ceph
Next, update your system's package list and install the Ceph packages by running the following commands:
sudo apt-get update
sudo apt-get install ceph
Repeat the above two commands on all the nodes, including the Ceph monitor and OSD nodes.
Step 3: Configure the Ceph Monitor
On the Ceph monitor, open the /etc/ceph/ceph.conf file and add the following content:
[global]
mon_initial_members = {monitor-hostname}
mon_host = {monitor-ip-address}
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx
[mgr]
mgr/cephadm/repo_url = https://download.ceph.com/rpm-luminous/el7
Replace {monitor-hostname} and {monitor-ip-address} with the hostname and IP address of the Ceph monitor node.
Next, create a new Ceph user for authentication purposes by running the following command:
ceph auth get-or-create mon. -o /etc/ceph/ceph.mon.keyring
Step 4: Configure the Ceph OSD Nodes
On each Ceph OSD node, open the /etc/ceph/ceph.conf file and add the following content:
[global]
osd journal size = 1024
filestore merge threshold = 40
osd pool default size = 2
osd pool default min size = 1
osd pool default pg num = 128
osd pool default pgp num = 128
ping pong interval = 3
public network = {public-network}
cluster network = {cluster-network}
[osd]
osd crush chooseleaf type = 1
Replace {public-network} and {cluster-network} with the appropriate IP address ranges for your network setup.
Next, create a new Ceph user for authentication purposes by running the following command:
ceph auth get-or-create client.bootstrap-osd -o /var/lib/ceph/bootstrap-osd/ceph.keyring
Step 5: Initialize Ceph
On the Ceph monitor, initialize a new Ceph cluster by running the following command:
ceph-deploy new {monitor-hostname}
Replace {monitor-hostname} with the hostname of your Ceph monitor node.
Next, deploy Ceph to all the OSD nodes by running the following command:
ceph-deploy install {osd-hostname1} {osd-hostname2} ...
Replace {osd-hostname1}, {osd-hostname2} with the hostnames of all your Ceph OSD nodes.
Next, initialize the monitor by running the following command:
ceph-deploy mon create-initial
Finally, deploy the OSDs by running the following command on each OSD node:
ceph-deploy osd create {osd-hostname}
Replace {osd-hostname} with the hostname of the current OSD node.
Step 6: Verify the Ceph cluster status
To verify that the Ceph cluster is running successfully, log in to the Ceph monitor node and run the following command:
ceph status
This will generate a status report for your Ceph cluster.
Congratulations! You have successfully installed and configured Ceph on Debian Latest. You can now use this distributed storage system to store and manage your data.