關于osd自動重啟
/etc/crontab里面每隔2分鐘會調用 /etc/cron.daily/keep_osd.sh
關閉osd
1 mv /etc/cron.daily/keep_osd.sh /etc/cron.daily/keep_osd.sh_back
2 systemctl stop ceph-osd@0.service
查看osd的參數
ceph daemon osd.0 config show |grep osd_op_num
動態修改osd的配置參數
ceph tell osd.* injectargs "--debug_kstore 20"ceph tell osd.0 injectargs "--debug_osd 20"ceph tell osd.* injectargs "--debug_rocksdb 0"ceph tell osd.0 injectargs "--debug_bluestore 20"ceph tell osd.339 injectargs "--debug_rocksdb 4"
查看osd里面bluestore的kv數據
1 先關閉osd
2 建立備份文件夾 mkdir -p /ceph-0/
3 把osd的sst文件導出: /usr/local/hstor/ceph_dir/bin/ceph-bluestore-tool bluefs-export --path /var/lib/ceph/osd/ceph-0 --out-dir /ceph-0/4 查看kv記錄/usr/local/hstor/ceph_dir/bin/ceph-kvstore-tool rocksdb /ceph-0/db/ list
查看rocksdb里面的kv
1 查看單個sst文件./sst_dump --file=/home/d11626_back/000043.sst --command=scan --read_num=5./sst_dump --file=/home/d11626_back/000043.sst --command=scan --read_num=5 --output_hex2 查看整個key的kv對./ldb --db=/tmp/rocksdb20 scan./ldb --db=/tmp/rocksdb20 scan --hex3 查看manifest/home/d11626_back/clionProjects/rocksdb-6.15.5/cmake-build-release/tools/ldb --db=/tmp/rocksdb8 manifest_dump
參考資料
https://wanghenshui.github.io/rocksdb-doc-cn/doc/Administration-and-Data-Access-Tool.html
查看集群都有哪些osd
ceph osd tree
查看集群都有哪些pool
ceph osd pool ls detail
可以看到存儲池對應的 crush_rule id
或者:
ceph osd pool ls
查看所有的pg
ceph pg stat
ceph pg dump
查看某個pool下都有哪些pg
ceph pg ls {pool_id}
ceph pg ls-by-pool {pool_name}
查看某個pg 在哪些osd上
ceph pg dump| grep ^9.77 |awk '{print $16}'
9.77 就是一個pgid
查看存儲池的詳細配置
cloud cluster pool rule display pool_name=fubenpool-2
fubenpool-2 是存儲池名稱
查看slow request
ceph daemon osd.23 dump_historic_ops_by_duration |head
ceph daemon osd.28 dump_historic_slow_ops
ceph daemon osd.28 dump_op_pq_state
查看有哪些buckets
radosgw-admin bucket list
查看某個bucket的詳細信息
radosgw-admin bucket stats --bucket=my-bucket
查看某個buckets下的文件列表
radosgw-admin bucket list --bucket=my-bucket
查看某個buckets下的索引對象
rados -p default.rgw.buckets.index ls | grep "a0313951-dde2-4282-a46e-27528af2b57f.1154186.1"
可能有多個.dir開頭的對象,因為對象也要分片
獲取 對象數據,寫入本地的indexfile文件
rados -p rados -p default.rgw.buckets.index get .dir.a0313951-dde2-4282-a46e-27528af2b57f.4972.1.57 indexfile
indexfile是空
查看某個索引對象下都包含了哪些文件
rados -p default.rgw.buckets.index listomapkeys .dir.a0313951-dde2-4282-a46e-27528af2b57f.1154186.1.57
在這個索引對象下,查看grub2.cfg這個文件的omap數據,寫入a.file
rados getomapval -p default.rgw.buckets.index .dir.a0313951-dde2-4282-a46e-27528af2b57f.1154186.1.57 grub2.cfg a.file
把a.file解析成json形式
ceph-dencoder type rgw_bucket_dir_entry import a.file decode dump_json
查看某個bucket索引分片對象下,都有哪些文件
seq 0 100 |xargs -I abc sh -c "echo {} ; rados -p default.rgw.buckets.index listomapkeys .dir.a0313951-dde2-4282-a46e-27528af2b57f.4972.1.abc"