Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Dynamic Adjustment method of Ceph Cluster

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

这篇文章主要介绍"Ceph集群的动态调整方法",在日常操作中,相信很多人在Ceph集群的动态调整方法问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答"Ceph集群的动态调整方法"的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

1.新增/删除MONITORS1.1新增MONITOR

命令:

ceph-deploy mon create {host-name [host-name]...}

示例:

ceph-deploy mon create osnode17:172.17.23.4

1.2删除MONITOR

命令:

ceph-deploy mon destroy {host-name [host-name]...}

示例:

ceph-deploy mon destroy osnode17

2.新增/删除OSDS2.1列举磁盘

命令:

ceph-deploy disk list {node-name [node-name]...}

示例:

ceph-deploy disk list osnode19

2.2清理磁盘

命令:

ceph-deploy disk zap {osd-server-name}:{disk-name} #注意:该命令会删除相应磁盘数据

示例:

ceph-deploy disk zap osnode19: /dev/sdh osnode19: /dev/sdi

2.3准备OSDS

命令:

ceph-deploy osd prepare {node-name}:{data-disk}[:{journal-disk}]

示例:

ceph-deploy osd prepare osnode19:/dev/sdh osnode19: /dev/sdi

2.4激活OSDS

命令:

ceph-deploy osd activate {node-name}:{data-disk-partition}[:{journal-disk-partition}]

示例:

ceph-deploy osd activate osnode19:/dev/sdh2 osnode19:/dev/sdi1

2.5创建OSDS

命令:

ceph-deploy osd create {node-name}:{disk}[:{path/to/journal}] #注意:该命令为ceph-deploy osd prepare和ceph-deploy osd activate命令的集合

示例:

ceph-deploy osd create osnode19:/dev/sdj osnode19:/dev/sdk

2.6删除OSDS

命令:

#注意:ceph-deploy暂未提供删除OSDS的命令,因而只能手动执行

ceph osd out {osd-num} #将OSD移除ceph集群

ceph stop osd.{osd-num} #停止OSD服务

ceph osd crush remove {osd-num} #移除crush map中的信息

ceph auth del {osd-num} #移除OSD认证

ceph osd rm {osd-num} #移除OSD

umont /var/lib/ceph/osd/ceph-{osd-num} #移除OSD挂载

rm -rf /var/lib/ceph/osd/ceph-{osd-num} #删除OSD的数据目录

示例:

ceph osd out 18

service ceph stop osd.18

ceph osd crush remove osd.18

ceph auth del osd.18

ceph osd rm 18

umont /var/lib/ceph/osd/ceph-18

rm -rf /var/lib/ceph/osd/ceph-18

脚本:

vi osd-remove.sh

#!/bin/sh

for arg in "$@"

do

ceph osd out $arg

service ceph stop osd.$arg

ceph osd crush remove osd.$arg

ceph auth del osd.$arg

ceph osd rm $arg

umount /var/lib/ceph/osd/ceph-$arg

rm -rf /var/lib/ceph/osd/ceph-$arg

done

chmod +x osd-remove.sh

alias osd-remove=./osd-remove.sh

到此,关于"Ceph集群的动态调整方法"的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注网站,小编会继续努力为大家带来更多实用的文章!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report