Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize Ceph librados programming access

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to achieve Ceph librdos programming access, has a certain reference value, interested friends can refer to, I hope you have a lot of gains after reading this article, the following let Xiaobian take you to understand.

introduction

I need to do direct programmatic access to Ceph's object store to see the performance difference with and without a gateway. The gate-way-based access example has gone through. What we're testing now is not going to go through the gateway, but using librados to deal directly with Ceph clusters.

environment configuration

1. Ceph cluster: You need to have a configured Ceph cluster, and you can see the state of the cluster through ceph -s.

2. Installation of development libraries My system is CentOS 6.5 Use the following command to install the relevant development package (C/C++ development package)

sudo yum install librados2-devel

After successful installation, you can see the corresponding header file under the/usr/include/rados path

sample program

The example program comes from the official website, can refer to the official website example

http://docs.ceph.com/docs/master/rados/api/librados-intro/

#include #include #include int main(int argc, const char **argv){int ret = 0 ;// Get cluster handle and connect to clusterstd::cout

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report