您好,登錄后才能下訂單哦!
這篇文章主要介紹了ceph中rbd-cache日志如何配置,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。
#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 默認打開。
<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數據丟失。
# virsh attach-device ubuntu device.xml –persistent
在/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日志如何配置”這篇文章對大家有幫助,同時也希望大家多多支持億速云,關注億速云行業資訊頻道,更多相關知識等著你來學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。