Create and setup a Ceph Storage cluster in using very easy step.


          Ceph is a widely used open source storage platform. It provides high performance, reliability, and scalability. The Ceph free distributed storage system provides an interface for object, block, and file-level storage. Ceph is build to provide a distributed storage system without a single point of failure.
A Ceph cluster requires these Ceph components:

    Ceph OSDs (ceph-osd) - Handles the data store, data replication and recovery. A Ceph cluster needs at least two Ceph OSD servers. I will use three CentOS 7 OSD servers here.
    Ceph Monitor (ceph-mon) - Monitors the cluster state, OSD map and CRUSH map. I will use one server.
    Ceph Meta Data Server (ceph-mds) - This is needed to use Ceph as a File System.

For a new learner of ceph, it is a bigger challange to install and setup ceph cluster. I am telling you a very simple way how you can setup a ceph storage cluster by performing few steps only.

SETUP:-
In my setup i have 3 centos 7 VM
IP
ceph1.mylab.local    192.168.1.21
ceph2.mylab.local    192.168.1.22
ceph3.mylab.local    192.168.1.23

and one laptop running fedora from where i will run ansible playbook

Note- configure your dns as per above or make entries in hosts file.

I have two disk attached in all three VM
50GB  for OS
100GB for OSD or storage
Install Centos 7 minimum on all three node
Once centos 7 installation finished on all three node
--- Steps to perform on Laptop or your workstation from where you will run ansible playbooks
1) install ansible 2.8
  # yum install https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.8.8-1.el7.ans.noarch.rpm -y
 Generate ssh-key
 # ssh-keygen
 copy ssh public to all ceph node
 # ssh-copy-id root@ceph1
 # ssh-copy-id root@ceph2
 # ssh-copy-id root@ceph3

create ansible host inventory file
# vim /etc/ansible/hosts

[all:vars]
ansible_ssh_user=root
[grafana-server]
ceph1
[mons]
ceph1
[mgrs]
ceph1
[osds]
ceph1
ceph2
ceph3


save and exit

2) clone ceph ansible git repo
# git clone https://github.com/ceph/ceph-ansible
3) edit the groupvars files
# cd ceph-ansible/group_vars/
# vim all.yaml
# create new
ceph_origin: repository
ceph_repository: community
ceph_repository_type: cdn
ceph_stable_release: nautilus

fetch_directory: ~/ceph-ansible-keys

# set network interface for monitoring
monitor_interface: ens3
# specify your public network
public_network: 192.168.1.0/22
# specify cluster network
# if it's the same with public network, set like follows
# if not the same, specify your cluster network
cluster_network: "{{ public_network }}"
-- Please take care of your network interface name and network subnet

# vim osds.yml

devices:
  - /dev/sda
save and exit.

4) Now rename site.yml.sample  file

# cd ..
# mv site.yml.sample site.yml

5) Now you can run the ansible playbook.

# ansible-playbook site.yml

Installation will be complete with bellow msg

INSTALLER STATUS **********************************
Install Ceph Monitor           : Complete (0:00:17)
Install Ceph Manager           : Complete (0:01:26)
Install Ceph OSD               : Complete (0:00:52)
Install Ceph Dashboard         : Complete (0:00:23)
Install Ceph Grafana           : Complete (0:01:04)
Install Ceph Node Exporter     : Complete (0:01:36)

Done !

Comments

Popular posts from this blog

Running web ssh client on port 443 /80 with nginx as reverse proxy

Running cockpit behind nginx reverse proxy with nginx ssl and cockpit non ssl

Setup VOD streaming server with nginx using RTMP on Ubuntu 18.04