Code Monkey home page Code Monkey logo

fdfs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fdfs's Issues

README.md demo cache error

fdfs.upload('e:/shou.jpg').then(function(fileId) {
// fileId 为 group + '/' + filename
console.log(fileId);
}).catch(function(err) {
console.error(err);
); //cache function error, no }

allow_hosts 不支持阿里云SLB健康检查地址网段 100.64.0.0/10

要用阿里云SLB对tracker做负载均衡和健康检查,但tracker allow_hosts不支持阿里云SLB健康检查地址网段 100.64.0.0/10
参考: 7. HTTP监听向后端ECS实例执行健康检查的IP地址是什么?
配置:

allow_hosts=10.2.14.0/23
allow_hosts=100.64.0.0/10 
[2019-05-22 21:52:25] ERROR - file: shared_func.c, line: 1620, ip address: 100.64.0.0/10, invalid network bits: 10, it should >= 16 and < 32
[2019-05-22 21:52:25] CRIT - exit abnormally!

调用append模式时出错

当我在调用upload append模式时首次添加数据后再调研append追加
反回的storage与首次上传的文件storage不是同一个,导致出现错误
如下
receive server packet headerBuffer: {"type":"Buffer","data":[0,0,0,0,0,0,0,0,100,2]}
{ Error: receive packet errno is: 2
at _parseHeader (server\node_modules\fdfs\lib\protocol.js:334:19)
at Socket.listener (node_modules\fdfs\lib\protocol.js:183:34)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:551:20) errno: 2, code: 2 }
就目前观察是由于storage在每次追加时返回的不是源storage导致的,帮忙看看是不是?谢谢

使用busboy的ReadableStream上传图片时会卡死

环境
node v6.10.2
os: ubuntu 16

出错代码

let config= {
	fdfs: {
		upload: {
			host: 'xxx',
			port: 'xxx'
		},
		download: {
			host: 'xxx'
		},
		size: 1024000
	}
};

let getFdfs = (fdfs)=> {

  return new FdfsClient({
  // tracker servers
  trackers: [
    {
      // host: process.env.FDFS_UPLOAD,
      host: fdfs.upload.host,
      port: fdfs.upload.port
    }
  ],
  // 默认超时时间10s
  timeout: 1000000,

  // 默认后缀
  // 当获取不到文件后缀时使用
  defaultExt: 'png',
  // charset默认utf8
  charset: 'utf8'
  });
};

//busboy.......
busboy.on('file', function (fieldname, file, filename, encoding, mimetype) {

  let fdfs = getFdfs(config.fdfs);
  console.log('hei.......................................how are you')
  fdfs.upload(file, {size: config.fdfs.size}).then(function(fileId) {
    console.log('how ok ...........................')
    console.log(fileId);
  })
})

[输出]
一直卡在 start upload file to storage server 这一个步不动了

hei.......................................how are you
connect to tracker server [192.168.0.40:22122]
tracker server [192.168.0.40:22122] is connected
get a upload storage server from tracker server: [192.168.0.40:22122]
send header to tracker server [192.168.0.40:22122]
receive server packet header: {"status":0,"bodyLength":40}
get store storage server info: {"group":"group1","host":"192.168.0.41","port":23000,"storePathIndex":0,"timeout":10000,"charset":"utf8"} 
connect to storage server [192.168.0.41:23000].
storage server [192.168.0.41:23000] is connected
start upload file to storage server [192.168.0.41:23000]

报错ReferenceError: FdfsClient is not defined

我就按照你的README一字不差写的,报错:
ReferenceError: FdfsClient is not defined
at Object. (E:\程序设计\nodejs\test_upload\test_upload.js:3:16)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:968:3

关于从文件的上传问题

没有发现可以支持从文件的上传方法。有STORAGE_PROTO_CMD_UPLOAD_SLAVE_FILE这个命令声明却没有对应的方法?或者有没有相应的思路?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.