[yzyu@dlp ceph-cluster]$ pwd ##当前目录必须为ceph的安装目录位置 /home/yzyu/ceph-cluster [yzyu@dlp ceph-cluster]$ ssh-keygen -t rsa ##主节点需要远程管理mon节点,需要创建密钥对,并且将公钥复制到mon节点 [yzyu@dlp ceph-cluster]$ ssh-copy-id dhhy@dlp [yzyu@dlp ceph-cluster]$ ssh-copy-id dhhy@node1 [yzyu@dlp ceph-cluster]$ ssh-copy-id dhhy@node2 [yzyu@dlp ceph-cluster]$ ssh-copy-id root@ceph-client [yzyu@dlp ceph-cluster]$ cat <<END >>/home/dhhy/.ssh/config Host dlp Hostname dlp User yzyu Host node1 Hostname node1 User yzyu Host node2 Hostname node2 User yzyu END [yzyu@dlp ceph-cluster]$ chmod 644 /home/yzyu/.ssh/config [yzyu@dlp ceph-cluster]$ ceph-deploy new node1 node2 ##初始化节点
[yzyu@dlp ceph-cluster]$ cat <<END >>/home/yzyu/ceph-cluster/ceph.conf osd pool default size = 2 END [yzyu@dlp ceph-cluster]$ ceph-deploy install node1 node2 ##安装ceph
配置Ceph的mon监控进程
[yzyu@dlp ceph-cluster]$ ceph-deploy mon create-initial ##初始化mon节点
注解:node节点的配置文件在/etc/ceph/目录下,会自动同步dlp管理节点的配置文件;
配置Ceph的osd存储
配置node1节点的osd1存储设备:
[yzyu@node1 ~]$ sudo fdisk /dev/sdc...sdc ##格式化硬盘,转换为GPT分区 [yzyu@node1 ~]$ pvcreate /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 /dev/sdg1 /dev/sdh1 /dev/sdi1 /dev/sdj1 /dev/sdk1 /dev/sdl1 /dev/sdm1 /dev/sdn1 /dev/sdo1 /dev/sdp1 /dev/sdq1 /dev/sdr1 /dev/sds1 /dev/sdt1 /dev/sdu1 /dev/sdv1 /dev/sdw1 /dev/sdx1 /dev/sdy1 /dev/sdz1 ##创建pv [yzyu@node1 ~]$ vgcreate vg1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 /dev/sdg1 /dev/sdh1 /dev/sdi1 /dev/sdj1 /dev/sdk1 /dev/sdl1 /dev/sdm1 /dev/sdn1 /dev/sdo1 /dev/sdp1 /dev/sdq1 /dev/sdr1 /dev/sds1 /dev/sdt1 /dev/sdu1 /dev/sdv1 /dev/sdw1 /dev/sdx1 /dev/sdy1 /dev/sdz1 ##创建vg [yzyu@node1 ~]$ lvcreate -L 130T -n lv1 vg1 ##划分空间 [yzyu@node1 ~]$ mkfs.xfs /dev/vg1/lv1 ##格式化