[LINUX] Construction of Ceph (Octopus) (setting mon node)

__ Introduction __

As the title suggests, this article aims to build __ceph (octopus) __, which is the latest at the moment (2021.01). Also, since it also serves as a memorandum of the procedure you built yourself, there may be mistakes in the details.

Basically, the official DOCUMENTATION covers everything you need, so it's a good idea to read it. Since some knowledge of Linux is required, it is advisable to grasp the basics in advance on other sites and books.

Please refer to the related article for the preparation etc.

Related article

Building Ceph (Octopus) (Preparation Hardware) Building Ceph (Octopus) (Preparation Software) Construction of Ceph (Octopus) (common to settings) Construction of Ceph (Octopus) (setting mon node) This article

SSH Generate an ssh key to set each node from the mon node.

ssh-keygen -t rsa

I want to automate each work using shellscript, so I also include sshpass.

yum -y install epel-release
yum -y install sshpass

ceph

Check ceph repository (ceph-mon01 only)

Repository This time the OS is Centos 7 and the hardware is x86_64 https://download.ceph.com/rpm-octopus/el7/x86_64/ceph-15.2.7-0.el7.x86_64.rpm I chose. If you are not sure, you may be able to find out or choose noarch for the time being.

Repository registration (ceph-mon01 only)

Be careful not to make a mistake in the URL. Create a new file.

vi /etc/yum.repos.d/ceph.repo

[ceph-noarch] name=Ceph noarch packages baseurl=https://download.ceph.com/rpm-octopus/el7/x86_64 enabled=1 gpgcheck=1 type=rpm-md gpgkey=https://download.ceph.com/keys/release.asc

cephadm (ceph-mon01 only)
yum -y install cephadm
Create ceph directory (ceph-mon01 only)
mkdir -p /etc/ceph
Bootstrap (ceph-mon01 only)

When you bootstrap, the docker image will be pulled automatically. Therefore, you need to be connected to the Internet at the very beginning. However, if you can store the required docker image in advance, it may not be necessary. I didn't know how to do it, so I quietly connected to the internet. It seems that the docker image that pulls is different when running a node as mon and mgr and when running it as mds or osd. Also, this time I wanted to run the ceph cluster in a closed environment, so I took the following roundabout method. I think there is a smarter way to do it ...

  1. Pull the docker image from the Internet with bootstrap
  2. Delete the created cluster leaving only the docker image
  3. Change to a closed IP address and execute bootstrap again (--skip-pull)

When pulling an image


cephadm bootstrap --mon-ip 192.168.1.101

If you do not pull the image


cephadm bootstrap --mon-ip 192.168.1.101 --skip-pull

docker image when a node is set as mon and mgr 01.PNG docker image when setting a node as mds or osd 02.PNG

Disable automatic expansion of mon and mgr (ceph-mon01 only)

After this, each node is added to the created cluster, but the node cannot have the intended role unless automatic deployment is disabled. (Mon is expanded without permission.) I'm grateful that it will be done automatically, but this time I will disable it because the role is decided for each node.

cephadm shell
  ceph orch apply mon --unmanaged
  ceph orch apply mgr --unmanaged

samba In order to use cephFS like a file server, you need to take the following steps.

  1. Mount cephFS
  2. Share the mounted cephFS

This is the package you need to mount cephFS. If I didn't install epel-release, it didn't work because of a dependency error. If you did not put it in the above sshpass, you need to put it here.

yum -y install ceph-common

It is a package to publish the mounted cephFS as a shared folder.

yum -y install samba

in conclusion

That's all you need to do for the mon node. There is more work on only the first one to run the bootstrap. The second and subsequent mon nodes will be added with the ceph orch command instead of bootstrap. I will post the cephFS mount method and samba settings in another article.

Recommended Posts

Construction of Ceph (Octopus) (setting mon node)
Construction of Ceph (Octopus) (Preparation hardware)
Construction of Ceph (Octopus) (preparation software)
Construction of Ceph (Octopus) (common to settings)