Ceph运维操作

  • CRUSH Controlled Replication Under Scalable Hashing 可扩展哈希的受控副本分布算法
  • PG Placement Group
  • PG到OSD的映射,需要CRUSH规则和Hash一起设置
  • Scrub机制负责数据正确性与一致性
  • PGP Placement Group Placement
  • PG-UPMAP 支持显示调整pg到osdmap的关系

ceph操作

  • systemct/sysvinit集群操作
 #检查ceph状态
 systemctl status ceph\*.service ceph\*.target
  • 监控检查
ceph health detail
ceph tell mon.\* sessions
ceph -s
ceph df [detail]
ceph osd 
ceph osd pool set <poolname>
ceph report |jq -c ''
#bluefs可用空间
ceph daemon osd.* bluestore bluefs available
#device_health
ceph device info <device-id>
ceph health detail
ceph tell <pgid> query
ceph pg scrub <pgid>
ceph crash ls-new
ceph crash info <crash-id>
  • 监控集群
ceph health
ceph status/ -s
ceph quorum_status
ceph mon stat
ceph -c /path/to/conf -k /path/to/keyring health
#日志查看 /var/log/ceph/ceph.log
ceph -w
ceph log last [n]
ceph daemon /var/run/ceph/ceph-mgr.x.asok dump_osd_network 0
ceph health mute <code>
ceph health mute OSD_DOWN
#USAGE STATS
ceph df 
#OSD STATS
ceph osd stat
ceph osd dump
ceph osd tree
#MONITOR STATUS
ceph mon stat
ceph mon dump
ceph quorum_status
# ADMIN SOCKET
ceph daemon {daemon-name} [help]
ceph daemon {path-to-socket-file}
#PG SETS
ceph pg dump
ceph osd pool get {pool-name} pg_num
ceph pg map {pg-num}
ceph pg stat
ceph pg {poolnum}.{pg-id} query
ceph osd pool scrub {pool-name}
ceph pg dump -o {filename} --format=json
#FINDING AN OBJECT LOCATION
ceph osd map {poolname} {object-name} [namespace]
rados -p data ls
rados put {object-name} {file-path} --pool=data
ceph osd map {pool-name} {object-name}
#POOLS
ceph osd lspools
ceph osd pool autoscale-status
#BALANCER
ceph balancer status
ceph balancer off
  • pg-upmap
-ceph balancer off
-ceph osd set-require-min-compat-client luminous
-ceph features
ceph osd getmap -o om

-CRUSH

ceph osd crush rule ls
ceph osd crush rule dump
ceph osd crush tree --show-shadow
ceph osd getcrushmap -o {compiled-crushmap-filename}

-DEVICE MANAGEMENT

ceph device ls
ceph device ls-by-daemon <daemon>
ceph device ls-by-host <host>
ceph device info <devid>
ceph device monitoring on
ceph device monitoring off
ceph device scrape-health-metrics <device-id>
ceph device scrape-daemon-health-metrics <who>
ceph device get-health-metrics <devid> [sample-timestamp]
ceph device check-health

-元数据

ceph osd metadata $ID |grep osd_objectstore
ceph osd count-metadata osd_objectstore
ceph osd out $ID
ceph-volume lvm create --bluestore --data $DEVICE --osd-id $ID

-LOGGING AND DEBUGGING

/var/log/ceph
ceph daemon {daemon-name} config show |less 
ceph daemon osd.0 config show | less

-ceph-volume

ceph-volume lvm list
ceph-volume lvm new-wal --osd-id 1 --osd-fsid 55BD4219-16A7-4037-BC20-0F158EFCC83D --target vgname/new_wal
ceph-volume lvm new-db --osd-id 1 --osd-fsid 55BD4219-16A7-4037-BC20-0F158EFCC83D --target vgname/new_db

-三种块设备
Slow、DB、WAL
sgdisk -p /dev/sdb
lsblk lsscsi

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 本文借鉴了ceph官方资料,以及网络公开可查的技术文档或者图片,非绝对原创,向开源领域的贡献者和传播者致敬。 架构...
    hcci阅读 2,902评论 0 7
  • 初识ceph ceph功能介绍 直接进入主题,ceph目前提供对象存储(RADOSGW)、块存储RDB以及 Cep...
    star120120阅读 1,810评论 1 1
  • 1.说明 1.1介绍 pool是ceph存储数据时的逻辑分区,它起到namespace的作用。其他分布式存储系统,...
    lihanglucien阅读 3,974评论 0 0
  • 1. Ceph架构简介及使用场景介绍 1.1 Ceph简介 Ceph是一个统一的分布式存储系统,设计初衷是提供较好...
    lihanglucien阅读 83,873评论 6 92
  • 集群管理 每次用命令启动、重启、停止Ceph守护进程(或整个集群)时,必须指定至少一个选项和一个命令,还可能要指定...
    Arteezy_Xie阅读 19,920评论 0 19

友情链接更多精彩内容