温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

ceph中rbd-cache日志如何配置

发布时间:2021-12-07 14:21:52 来源:亿速云 阅读:483 作者:小新 栏目:云计算

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

1.配置客户端ceph.conf

#vim /ect/ceph/ceph.conf

在[client]添加:

admin socket=/var/run/ceph/rbd-$pid.asok
log file = /var/log/ceph/ceph.client.admin.log
rbd cache = true
rbd cache size = 134217728

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

2.定义disk.xml

<disk type='network' device='disk'>
<driver name='qemu' cache='writeback'/>
<auth username='libvirt'>
<secret type='ceph' uuid='2d833661-e55a-de95-bf0e-6d7d30e329c7'/>
</auth>
<source protocol='rbd' name='libvirt-pool/new-libvirt-image:debug_rbd=20:debug_objectcacher=20:log_file=/tmp/qemu-rbd.log'>
<host name='10.20.15.156' port='6789'/>
</source>
<target dev='vda' bus='virtio'/>
<shareable/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</disk>

备注:在使用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 0x7fbb447d5d60
2015-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~512
2015-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~512
2015-03-12 09:48:56.576624 7fbb296c0700 10 objectcacher readx has all buffers
2015-03-12 09:48:56.576633 7fbb296c0700 10 objectcacher readx adding buffer len 512 at 0
2015-03-12 09:48:56.576641 7fbb296c0700 10 objectcacher readx result is 512
2015-03-12 09:48:56.576649 7fbb296c0700 20 objectcacher readx done 0x7fbad0035580 512
2015-03-12 09:48:56.576667 7fbb296c0700 10 objectcacher trim start: bytes: max 134217728 clean 2048, objects: max 138 current 1
2015-03-12 09:48:56.576677 7fbb296c0700 10 objectcacher trim finish: max 134217728 clean 2048, objects: max 138 current 1
2015-03-12 09:48:56.576689 7fbb296c0700 20 librbd::AioRequest: should_complete 0x7fbad0035440 rb.0.dff3.2ae8944a.000000000000 0~512 r = 512
2015-03-12 09:48:56.576699 7fbb296c0700 10 librbd::AioCompletion: C_AioRead::finish() 0x7fbad001b3e0 r = 512
2015-03-12 09:48:56.576707 7fbb296c0700 10 librbd::AioCompletion: got {} for [0,512] bl 512
2015-03-12 09:48:56.576725 7fbb296c0700 20 librbd::AioCompletion: AioCompletion::complete_request() 0x7fbad001b280 complete_cb=0x7fbb43c94c50 pending 1
2015-03-12 09:48:56.576738 7fbb296c0700 20 librbd::AioCompletion: AioCompletion::finish_adding_requests 0x7fbad001b280 pending 0
2015-03-12 09:48:56.576748 7fbb296c0700 20 librbd::AioCompletion: AioCompletion::finalize() 0x7fbad001b280 rval 512 read_buf 0x7fbad005f400 read_bl 0
2015-03-12 09:48:56.576762 7fbb296c0700 20 librbd::AioCompletion: AioCompletion::finalize() copied resulting 512 bytes to 0x7fbad005f400
2015-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日志如何配置”这篇文章对大家有帮助,同时也希望大家多多支持亿速云,关注亿速云行业资讯频道,更多相关知识等着你来学习!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI