【问题标题】:Any example on using GlusterFS from NodeJS从 NodeJS 使用 GlusterFS 的任何示例
【发布时间】:2014-09-20 22:37:35
【问题描述】:

在使用 NodeJS 之前,我使用 Mongo GridFS 和 WeedFS 来存储媒体文件,现在我想评估 GlusterFS。我在https://github.com/qrpike/GlusterFS-NodeJS 找到了 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));
});

在上面的示例中,我没有像使用 https://github.com/aheckmann/gridfs-stream 的 gridfsstream 或 https://github.com/cruzrr/node-weedfs 的 weedfs 节点包装器那样直接存储媒体文件。

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

【问题讨论】:

    标签: node.js glusterfs weed-fs


    【解决方案1】:

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

    你需要一个不同的模块。

    【讨论】:

    • 感谢您的澄清,任何建议。
    猜你喜欢
    • 2017-05-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-02
    相关资源
    最近更新 更多