場景描述:
在大概10臺機器上面起了50個consumer實例運行,在這10臺中選了1臺運行一個producer實例。其中每個實例都會掛載cephfs中的同一個目錄/online/import到本機。
其中producer 會刪除目錄下的文件
其他節點約50多個實例只會讀取目錄下的文件
問題描述:
CephFs會產生偶發性warning
在Mgr dashboard界面可以看到如下信息
cephfs/ceph-fuse: mds0: Client XXX:XXX failing to respond to capability release
暫時性解決辦法
方法一:通過ceph health detail命令查看到具體出問題的client,將該client加入blacklist,然後再移除
方法二:將出問題的實例,重新掛載fs
方法三:如果是多活MDS的話,ceph health detail命令也顯示出來是哪個MDS將Client標記爲warning,重啓該MDS。(有風險哦,自行評估)
問題查找
1. 參考了一些博客:
https://blog.51cto.com/michaelkang/1950506
我們集羣MDS配置的mds_cache_memory_limit大小爲30GB,排除了內存不足的原因
2. 參考了下官網對此的解釋:
https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/ceph_file_system_guide_technology_preview/troubleshooting
出現上述錯誤是因爲
capabilities就像一把鎖,如果一個client佔有了,但是當client需要訪問的時候,MDS會通知client來釋放,如果超時就出現上述錯誤。
比如這種情況下會需要caps release:
https://www.spinics.net/lists/ceph-devel/msg39777.html
如果釋放失敗,或者超時就會報錯。
對於我上面服務的場景來說,情況就是consumer讀取到了文件,處理成功之後,producer需要刪除該文件,此時就涉及到了capabilities的釋放。
3. 根據ceph官網記錄,可能這個4.9 kernel 存在的bug
https://tracker.ceph.com/issues/18798
https://ceph-users.ceph.narkive.com/8cpL6ibq/cephfs-ceph-fuse-mds0-client-xxx-xxx-failing-to-respond-to-capability-release
根據上面帖子中的討論,4.9和4.4的內核都有這個問題存在。Ceph開發人員也建議升級到高於4.9的版本。
其他討論:
https://tracker.ceph.com/issues/11482
https://tracker.ceph.com/issues/11482
官網的介紹中也指出可能出現問題的地方:
https://docs.ceph.com/docs/master/cephfs/troubleshooting/
If operations are stuck on a specific inode, you probably have a client holding caps which prevent others from using it, either because the client is trying to flush out dirty data or because you have encountered a bug in CephFS’ distributed file lock code (the file “capabilities” [“caps”] system).
最終
將服務全部部署在4.11的內核的機器上之後,確實沒再出現過問題了。