任何关于从NodeJS使用GlusterFS的例子

在使用NodeJS之前,我已经使用了Mongo GridFS和WeedFS来存储媒体文件,现在我想评估一下GlusterFS。 我在https://github.com/qrpike/GlusterFS-NodeJSfind了NodeJS模块,但下面显示的例子令人困惑

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或weedfs节点包装在https://github.com/cruzrr/node – weedfs 。

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

那个模块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']; 

你需要一个不同的模块。

Interesting Posts