1. 在使用librbd的过程当中,发现一个若是ceph集群异常librbd函数不返回的问题,对librbd的源码进行跟踪,发现了rados接口中的rados_mon_op_timeout(how many seconds to wait for a response from the monitor before returning an error from a rados operation. 0 means no limit.)和rados_osd_op_timeout(how many seconds to wait for a response from osds before returning an error from a rados operation. 0 means no limit.)两个参数,两个参数默认为0。因而乎,在使用rados接口的时候,设置参数rados.Rados.conf_set("rados_osd_op_timeout", 10),接口后续就能够抛Timeout异常,就能够正常处理了。若是但愿整个集群生效就把参数写在ceph.conf里。函数
2. 想起来再说接口