千家信息网

ceph中rbd-cache日志如何配置

发表于:2025-02-08 作者:千家信息网编辑
千家信息网最后更新 2025年02月08日,这篇文章主要介绍了ceph中rbd-cache日志如何配置,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。1.配置客户端ceph.con
千家信息网最后更新 2025年02月08日ceph中rbd-cache日志如何配置

这篇文章主要介绍了ceph中rbd-cache日志如何配置,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

1.配置客户端ceph.conf

#vim /ect/ceph/ceph.conf

在[client]添加:

admin socket=/var/run/ceph/rbd-$pid.asoklog file = /var/log/ceph/ceph.client.admin.logrbd cache = truerbd cache size = 134217728

备注:貌似在ceph0.80.7,rbd-cache 默认打开。

2.定义disk.xml

备注:在使用rbd-cache,需要显示的指出:

cache='writeback'

以防止rbd-cache数据丢失。

3.将设备热插拔到虚拟机

# virsh attach-device ubuntu device.xml -persistent

5. 重启虚拟机

在/tmp/qemu-rbd.log找到rbdcache的调试信息

2015-03-12 09:48:51.734444 7fbb2a3c6700 11 objectcacher flusher 2048 / 134217728: 0 tx, 0 rx, 2048 clean, 0 dirty (16777216 target, 25165824 max)2015-03-12 09:48:52.734553 7fbb2a3c6700 11 objectcacher flusher 2048 / 134217728: 0 tx, 0 rx, 2048 clean, 0 dirty (16777216 target, 25165824 max)2015-03-12 09:48:53.734657 7fbb2a3c6700 11 objectcacher flusher 2048 / 134217728: 0 tx, 0 rx, 2048 clean, 0 dirty (16777216 target, 25165824 max)2015-03-12 09:48:54.734796 7fbb2a3c6700 11 objectcacher flusher 2048 / 134217728: 0 tx, 0 rx, 2048 clean, 0 dirty (16777216 target, 25165824 max)2015-03-12 09:48:55.734958 7fbb2a3c6700 11 objectcacher flusher 2048 / 134217728: 0 tx, 0 rx, 2048 clean, 0 dirty (16777216 target, 25165824 max)2015-03-12 09:48:56.576418 7fbb296c0700 20 librbd: aio_read 0x7fbb447d5d60 completion 0x7fbad001b280 [0,512]2015-03-12 09:48:56.576476 7fbb296c0700 20 librbd: ictx_check 0x7fbb447d5d602015-03-12 09:48:56.576523 7fbb296c0700 20 librbd: oid rb.0.dff3.2ae8944a.000000000000 0~512 from [0,512]2015-03-12 09:48:56.576542 7fbb296c0700 10 objectcacher readx extent(rb.0.dff3.2ae8944a.000000000000 (0) in @12 0~512 -> [0,512])2015-03-12 09:48:56.576559 7fbb296c0700 10 objectcacher.object(rb.0.dff3.2ae8944a.000000000000/head) map_read rb.0.dff3.2ae8944a.000000000000 0~5122015-03-12 09:48:56.576573 7fbb296c0700 20 objectcacher.object(rb.0.dff3.2ae8944a.000000000000/head) map_read hit bh[ 0x7fbb447da690 0~2048 0x7fbb447da400 (2048) v 0 clean firstbyte=88] waiters = {}2015-03-12 09:48:56.576590 7fbb296c0700 10 objectcacher readx hit bh bh[ 0x7fbb447da690 0~2048 0x7fbb447da400 (2048) v 0 clean firstbyte=88] waiters = {}2015-03-12 09:48:56.576600 7fbb296c0700 10 objectcacher readx rmap opos 0: bh[ 0x7fbb447da690 0~2048 0x7fbb447da400 (2048) v 0 clean firstbyte=88] waiters = {} +0 frag 0~512 +0~5122015-03-12 09:48:56.576624 7fbb296c0700 10 objectcacher readx has all buffers2015-03-12 09:48:56.576633 7fbb296c0700 10 objectcacher readx adding buffer len 512 at 02015-03-12 09:48:56.576641 7fbb296c0700 10 objectcacher readx result is 5122015-03-12 09:48:56.576649 7fbb296c0700 20 objectcacher readx done 0x7fbad0035580 5122015-03-12 09:48:56.576667 7fbb296c0700 10 objectcacher trim start: bytes: max 134217728 clean 2048, objects: max 138 current 12015-03-12 09:48:56.576677 7fbb296c0700 10 objectcacher trim finish: max 134217728 clean 2048, objects: max 138 current 12015-03-12 09:48:56.576689 7fbb296c0700 20 librbd::AioRequest: should_complete 0x7fbad0035440 rb.0.dff3.2ae8944a.000000000000 0~512 r = 5122015-03-12 09:48:56.576699 7fbb296c0700 10 librbd::AioCompletion: C_AioRead::finish() 0x7fbad001b3e0 r = 5122015-03-12 09:48:56.576707 7fbb296c0700 10 librbd::AioCompletion: got {} for [0,512] bl 5122015-03-12 09:48:56.576725 7fbb296c0700 20 librbd::AioCompletion: AioCompletion::complete_request() 0x7fbad001b280 complete_cb=0x7fbb43c94c50 pending 12015-03-12 09:48:56.576738 7fbb296c0700 20 librbd::AioCompletion: AioCompletion::finish_adding_requests 0x7fbad001b280 pending 02015-03-12 09:48:56.576748 7fbb296c0700 20 librbd::AioCompletion: AioCompletion::finalize() 0x7fbad001b280 rval 512 read_buf 0x7fbad005f400 read_bl 02015-03-12 09:48:56.576762 7fbb296c0700 20 librbd::AioCompletion: AioCompletion::finalize() copied resulting 512 bytes to 0x7fbad005f4002015-03-12 09:48:56.735107 7fbb2a3c6700 11 objectcacher flusher 2048 / 134217728: 0 tx, 0 rx, 2048 clean, 0 dirty (16777216 target, 25165824 max)2015-03-12 09:48:57.735222 7fbb2a3c6700 11 objectcacher flusher 2048 / 134217728: 0 tx, 0 rx, 2048 clean, 0 dirty (16777216 target, 25165824 max)2015-03-12 09:48:58.735321 7fbb2a3c6700 11 objectcacher flusher 2048 / 134217728: 0 tx, 0 rx, 2048 clean, 0 dirty (16777216 target, 25165824 max)2015-03-12 09:48:59.735391 7fbb2a3c6700 11 objectcacher flusher 2048 / 134217728: 0 tx, 0 rx, 2048 clean, 0 dirty (16777216 target, 25165824 max)2015-03-12 09:49:00.735481 7fbb2a3c6700 11 objectcacher flusher 2048 / 134217728: 0 tx, 0 rx, 2048 clean, 0 dirty (16777216 target, 25165824 max)

通过日志加源码就很容易理解rbd-cache的实现了。

感谢你能够认真阅读完这篇文章,希望小编分享的"ceph中rbd-cache日志如何配置"这篇文章对大家有帮助,同时也希望大家多多支持,关注行业资讯频道,更多相关知识等着你来学习!

0