目标
- 1.已存在Ceph集群
- 2.添加node1盘 /dev/nvme1n1 /dev/nvme2n1进入ceph集群
步骤
- 1.格式化磁盘
shell
ceph-deploy disk zap node1 /dev/nvme1n1 /dev/nvme2n1
- 2.添加磁盘到osd
shell
ceph-deploy osd create --data /dev/nvme1n1 node1
ceph-deploy osd create --data /dev/nvme2n1 node1
- 3.修改存储规则
bash
#!/bin/bash
DATE=$(date +%Y-%m-%d-%H-%M-%S)
ceph osd getcrushmap -o /etc/ceph/crushmap-$DATE
crushtool -d /etc/ceph/crushmap-$DATE > /etc/ceph/decrushmap-$DATE
vi /etc/ceph/decrushmap-$DATE
crushtool -c /etc/ceph/decrushmap-$DATE -o /etc/ceph/newcrushmap-$DATE
ceph osd setcrushmap -i /etc/ceph/newcrushmap-$DATE
- 4.查看是否生效
shell
ceph osd tree