Ceph::Rados - Perl wrapper to librados.
use Ceph::Rados; my $cluster = Ceph::Rados->new('admin'); $cluster->set_config_file; $cluster->set_config_option( keyring => '/etc/ceph/ceph.client.admin.keyring'); $cluster->connect; my $io = $cluster->io('testing_pool'); $io->write('greeting', 'hello'); my $stored_data = $io->read('greeting',10); my ($len, $mtime) = $io->stat('greeting'); $io->delete('greeting'); my $list = $io->list; while (my $entry = $list->next) { print "Found $entry\n"; }
This module provides a very limited subset of the librados API, currently just read/write/stat and lists.
If no length is passed to the read() call, the object is first stat'd to determine the correct read length.
Wraps rados_conf_read_file(). If not passed a path, the following locations are tried, in order:
rados_conf_read_file()
$ENV{CEPH_CONF}
Wraps rados_conf_set(). Typically used to set the keyring.
rados_conf_set()
Wraps rados_connect(). Connects to the rados cluster, using the config provided.
rados_connect()
Wraps rados_ioctx_create(). Opens an IO context to the specified pool. Returns a Ceph::Rados::IO object.
rados_ioctx_create()
librados documentation - http://docs.ceph.com/docs/master/rados/api/librados/
Alex Bowley, <alex@openimp.com>
Copyright (C) 2014-2017 by Alex Bowley.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.
To install Ceph::Rados, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Ceph::Rados
CPAN shell
perl -MCPAN -e shell install Ceph::Rados
For more information on module installation, please visit the detailed CPAN module installation guide.