2014-09-20 32 views
1

在使用NodeJS之前,我已经使用Mongo GridFS和WeedFS存储媒体文件,现在我想评估GlusterFS。我发现模块的NodeJS在https://github.com/qrpike/GlusterFS-NodeJS但如下图所示的例子是混乱使用NodeJS的GlusterFS的任何示例

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)); 
}); 

在上面的例子中,因为我使用gridfsstream在https://github.com/aheckmann/gridfs-stream我没有得到直接的方式来存储媒体文件或作为https://github.com/cruzrr/node-weedfs weedfs节点包装。

我对GlusterFS的理解错了吗?我想要有关于如何通过NodeJS API存储和从GlusterFS检索文件的基本示例。请帮助我。谢谢。

回答

2

那个模块qrpike/GlusterFS-NodeJS不能做文件操作。它只做管理控制。从代码中,下面列出了它支持的命令:

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']; 

您需要一个不同的模块。

+1

感谢您的澄清,任何建议。 – Exception 2014-09-21 08:04:26

相关问题