This repository store fibjs-for-ceph binary file and document. It offer rados object store api and rbd block device manage api. Refer to document for detail.
This project use all rados & rbd async io apis to write and read with ceph osds, it will not block the thread which act as a powerful engine to dispatch fibers which actually carry on the logical calculation. Thus, you can write high performance http server using fibjs natural high concurrency feature, to offer radosgw with high availability.
git clone https://github.com/asionius/fibjs-ceph.git
cd fibjs-ceph
chmod +x fibjs-for-ceph-linux-x64-v0.27
cp ./fibjs-for-ceph-linux-x64-v0.27 /usr/local/bin/fibjs
fibjs rados_test.js
https://github.com/asionius/fibjs/tree/librados
- rados
var rados = require('rados');
var cluster = rados.create('clusterName', 'userName', '/path/to/myceph.conf');
cluster.connect();
var io = cluster.createIoCtx('poolName');
var s = io.open('key');
s.write('hello key');
s.rewind();
console.log(s.readAll().toString());
- rbd
var rados = require('rados');
var cluster = rados.create('clusterName', 'userName', '/path/to/myceph.conf');
cluster.connect();
var io = cluster.createIoCtx('poolName');
var img = io.openImage('imgName');
img.write('hello image');
img.rewind();
console.log(img.read(11).toString());
- refer to docs/module/ifs/rados.md