· ☕ 2 分钟
· ✍️ starifly
依赖 # centos yum install librados2-devel 源程序 #include <iostream> #include <string> #include <rados/librados.hpp> int main(int argc, const char **argv) { int ret = 0; /* Declare the cluster handle and required variables. */ librados::Rados cluster; char cluster_name[] = "ceph"; char user_name[] = "client.admin"; uint64_t flags = 0; /* Initialize the cluster handle with the "ceph" cluster name and "client.admin" user */ { ret = cluster.init2(user_name, cluster_name, flags);