当前位置:网站首页>Yyds dry goods inventory rapid establishment of CEPH cluster

Yyds dry goods inventory rapid establishment of CEPH cluster

2022-06-21 07:39:00 Feng, crazy

1.cpeh node

Both virtual machines and physical machines can

     ip

       name

     node

    192.168.11.1

ceph01

    master

    192.168.11.2

ceph02

     slave

    192.168.11.3

ceph03

     slave

      
      
192.168.11.1 ceph01
192.168.11.1 ceph02
192.168.11.3 ceph03

echo "192.168.11.1 ceph01" >> /etc/hosts &&
echo "192.168.11.2 ceph02" >> /etc/hosts &&
echo "192.168.11.3 ceph03" >> /etc/hosts

modify hostname Three machines are modified accordingly
hostnamectl set-hostname ceph01
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.

2. Replace yum Source ( All nodes )

      
      
yum install wget -y
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
&&
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
&&
wget -O /etc/yum.repos.d/ceph.repo https://raw.githubusercontent.com/aishangwei/ceph-demo/master/ceph-deploy/ceph.repo
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.

3.ssh Password free login settings (master node )

      
      
ssh-keygen
ssh-copy-id [email protected]
ssh-copy-id [email protected]
ssh-copy-id [email protected]

// Clear the secret free
ssh-keygen -R ceph01
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.

4. install ceph—deploy Follow ceph

      
      
yum install ceph-deploy ceph python-setuptools -y ( Master node )
yum install ceph python-setuptools -y (slave node )
ceph -v
  • 1.
  • 2.
  • 3.

Must ensure ceph Versions, , Otherwise, there will be problems in subsequent use ,

The latest version 13.2.10

#yyds Dry inventory # Quickly build ceph colony _ setup script


 5. establish mon(master node )

      
      
// Each node creates a directory , There is no creation , To exist is to enter
mkdir /etc/ceph
cd /etc/ceph
ceph-deploy new ceph01 ceph02 ceph03
ceph-deploy install ceph01 ceph02 ceph03 // Occurs during installation ca Certificate problem Look at my other article
ceph-deploy mon create-initial
ceph -s
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.

#yyds Dry inventory # Quickly build ceph colony _3c_02


6. establish osd(master node )

First create three disks to mount three machines , The physical machine is similar to the physical machine by creating a disk mount ( My virtual machine )

      
      
cd /home/vm/disk // There is no such Directory , Create yourself , Or change the directory
qemu-img create -f raw /home/vm/disk/vm1-d1.img 100G
qemu-img create -f raw /home/vm/disk/vm2-d1.img 100G
qemu-img create -f raw /home/vm/disk/vm3-d1.img 100G

//vm1 As an example of mounting (vm2、vm3 Same as )
// Shut down the virtual machine before mounting
virsh destroy vm1
virsh edit vm1
// Add the configuration
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='none'/>
<source file='/home/vm/disk/vm1-d1.img'/>
<target dev='vdb' bus='ide'/>
</disk>
virsh start vm1
// Sign in vm1(master node )
ssh vm1
fdisk -l
// Format disk
mkfs -t xfs /dev/sda
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
      
      
ceph-deploy osd create --data /dev/sda ceph01
ceph-deploy osd create --data /dev/sda ceph02
ceph-deploy osd create --data /dev/sda ceph03
ceph-deploy mgr create ceph01 ceph02 ceph03
  • 1.
  • 2.
  • 3.
  • 4.


7. see ceph state

      
      
ceph -s
ceph health detail
// There is a time problem , Please do time synchronization
// modify ntp Time
yum install ntpdate -y

ntpdate cn.pool.ntp.org
ntpdate ceph01
// restart mon service
systemctl restart ceph-mon.target &&
systemctl restart ceph-osd.target
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.

#yyds Dry inventory # Quickly build ceph colony _ setup script _03


8. Delete ceph 

In case of any problem that cannot be solved during installation, you can choose to reinstall

      
      
yum remove ceph-deploy ceph python-setuptools -y ( Master node )
yum remove ceph python-setuptools -y ( All nodes )
rm -rf /etc/ceph
  • 1.
  • 2.
  • 3.

9. Installation visualization interface

      
      
ceph config set mgr mgr/dashboard/ssl false
ceph config-key put mgr/dashboard/server_port 8080
ceph mgr services
  • 1.
  • 2.
  • 3.

#yyds Dry inventory # Quickly build ceph colony _python_04

See me for details dashboard This article

原网站

版权声明
本文为[Feng, crazy]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202221500013734.html