标签:des style http color os io for art
This part of the tutorial describes how to setup a simple Ceph client using librados (for C++).
The only information that the client requires for the cephx authentication is
On Ubuntu, the library is available on the repositories
$ sudo apt-get install librados-dev
This is the file from which librados will read the client configuration.
The content of the file is structured according to this template:
[global] mon host= <IP address of one of the monitors> keyring = <path/to/client.admin.keyring>
for example:
[global] mon host = 192.168.252.10:6789 keyring = ./ceph.client.admin.keyring
The public endpoint of the monitor node can be retrieved with
$ ceph mon stat
The keyring file can be copied from the admin node. No change is needed to this file. The same information that is contained in the file can be retrieved with this command that will also list the client capabilities:
$ ceph auth get client.admin
The following simple client will perform the following operations:
Find the pastebin here.
This example can be compiled and executed with
$ g++ client.cpp -lrados -o cephclient $ ./cephclient
To quickly verify if an object was written or to remove it, use the following commands (e.g., from the monitor node).
List objects in pool data
$ rados -p data ls
Check the location of an object in pool data
$ ceph osd map data <object name>
Remove object from pool data
$ rados rm <object name> --pool=data
Deploy Ceph and start using it:simple librados cli,布布扣,bubuko.com
Deploy Ceph and start using it:simple librados cli
标签:des style http color os io for art
原文地址:http://my.oschina.net/renguijiayi/blog/296911