Any example on using GlusterFS from NodeJS

814 views Asked by At

I have used Mongo GridFS and WeedFS to store media files before using NodeJS and now I would like to evaluate GlusterFS. I have found NodeJS module at https://github.com/qrpike/GlusterFS-NodeJS but examples shown below are confusing

var GlusterFS, gfs;

GlusterFS = require('glusterfs');

gfs = new GlusterFS;

gfs.peer('status', null, function(res) {
   return console.log('Peer Status:', JSON.stringify(res));
});

gfs.volume('info', 'all', function(res) {
   return console.log('Volume Info (All Volumes)', JSON.stringify(res));
});

In above example I do not get straight forward way to store media files as I do using gridfsstream at https://github.com/aheckmann/gridfs-stream or as weedfs node wrapper at https://github.com/cruzrr/node-weedfs.

Am I understanding GlusterFS wrong? I would like to have basic examples on how to store and retrieve files from GlusterFS through NodeJS API. Please help me on this. Thanks.

1

There are 1 answers

1
Dan D. On

That module qrpike/GlusterFS-NodeJS can't do file operations. It only does administrative control. From the code the following lists the commands it supports:

this.volumeCommands = ['info', 'create', 'delete', 'start', 'stop', 'rename', 'add-brick', 'remove-brick', 'rebalance', 'replace-brick', 'set-transport', 'log filename', 'log locate', 'log rotate'];
this.peerCommands = ['probe', 'detach', 'status'];

You need a different module.