ceph 扩容集群存储 - 添加osd
背景
ceph集群有个别单个磁盘均衡后也要超过百分之80的使用率(有一块盘超过,百分之90集群就会停止写入),现需要添加新的磁盘osd,使集群进行重新均衡数据,来达到降低个别磁盘的高使用率
操作
1.1 新添加的服务器进行安装基础的ceph源
sudo -i
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm
cat > /etc/yum.repos.d/ceph.repo << EOF
[Ceph]
name=Ceph packages for \$basearch
baseurl=http://mirrors.aliyun.com/ceph/rpm-nautilus/el7/\$basearch
gpgcheck=0
[Ceph-noarch]
name=Ceph noarch packages
baseurl=http://mirrors.aliyun.com/ceph/rpm-nautilus/el7/noarch
gpgcheck=0
[ceph-source]
name=Ceph source packages
baseurl=http://mirrors.aliyun.com/ceph/rpm-nautilus/el7/SRPMS
gpgcheck=0
EOF
yum -y install ceph-common
1.2 在新服务器做一下免密(主节点ceph 要通过ssh免密操作新服务器)
mkdir -p /root/.ssh
echo "ssh-rsa 主节点免密秘钥cat .ssh/id_rsa.pub root@ceph-master-1" >/root/.ssh/authorized_keys
2.1 主节点进入当时的ceph-deploy部署目录,进行操作
# 远程安装ceph所需包,并添加新节点
ceph-deploy install --no-adjust-repos new-ceph-1
ceph-deploy admin new-ceph-1
# 添加磁盘
ceph-deploy osd create --data /dev/sda new-ceph-1