Ceph Storage - Ceph Deployment Preparation (part 4)

Category: myblog Written by Jiri Kanicky Hits: 3159

In this article we will prepare admin node for Ceph deployment.


Create CEPH admin on all nodes (or other dedicated ceph user who will be part of sudo group):

Skip this step if the user was created during Debian installation.

# useradd -d /home/cephadmin -m cephadmin -s /bin/bash
# passwd cephadmin
# adduser cephadmin sudo 

Give cephadmin passwordless sudo permissions:

# echo "cephadmin ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/cephadmin
# sudo chmod 0440 /etc/sudoers.d/cephadmin 

Enable password-less SSH

IMPORTANT: Execute only on the Admin node

IMPORTANT: Login with cephadmin and use this user from now on.

Generate a public key for the cephadmin user and install it on all ceph nodes

$ ssh-keygen
$ ssh-copy-id cephadmin@ceph2
$ ssh-copy-id cephadmin@ceph3
$ ssh-copy-id cephadmin@ceph4

Test: You should be able to ssh into any ceph node without entering password. Eg: “ssh cephadmin@ceph2”

Configure SSH access by editing the .ssh/config file.

The following example configuration will let you to avoid using --username{username} each time you execute ceph-deploy.

Host ceph2
   Hostname ceph2
   User cephadmin
Host ceph3
   Hostname ceph3
   User cephadmin
Host ceph4
   Hostname ceph4
   User cephadmin 

Add Ceph repository to your apt configuration

# echo deb http://ceph.com/debian-hammer/ $(lsb_release -sc) main | sudo tee /etc/apt/sources.list.d/ceph.list

 Install the trusted key with

# wget -q -O- 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc' | sudo apt-key add -

 Note: if you get the following error “ceph gpg: no valid OpenPGP data found.” it means wget version is too old and broken. The issue is fixed in Jessie wget version. Download the file manually and use “apt-key add <file>” manually. I used the wget command in Jessie, downloaded the file, copied it to Wheezy nodes and then used “apt-key add <file>” to install the trusted key.

 # sudo apt-get udpate


# apt-cache search ceph