我正在使用Node.js v0.10.26,并尝试使用新的stream2 apis http://blog.nodejs.org/2012/12/20/streams2/,特别是Readable api,http:// nodejs.组织/ API/stream.html#stream_class_stream_readable
但'结束'事件永远不会被调用,我无法弄清楚为什么.我认为为什么我的下游Transform流组件没有调用他们的_flush,完成,关闭事件,
var rqt = fs.createReadStream('some.csv.gz');
//readable
rqt.on('readable', function () { console.log('readable!'); })
.on('data', function (data) { console.log('Data!', data); })
.on('error', function (err) { console.error('Error', err);/* READ if there was an error receiving data. */ })
.on('end', function () { console.log('All done!'); /* READ fires when no more data will be provided. */ })
.on('finish', function () { console.log('All Finished!'); /*WRITEABLE */ })
.on('close', function () { console.log('close!'); /*WRITEABLE not all streams …Run Code Online (Sandbox Code Playgroud) 我在VirtualBox VM(Boot2docker)中使用Haproxy 1.5.14,其中间歇性加载的资产显示503没有任何真正的押韵或原因,在群集启动时尤其如此.
集群看起来像这样,1个前端有端口80,443到2个后端分别为静态资源和websocket东西提供服务.
HAProxy的
例如,前端服务的静态资产可能是
https://local.dev.myproject.com/assets/images/back.png
尽管前端服务器正在运行,并且没有任何变化,但是点击刷新并查看chrome调试器,我将看到许多状态503或OK 200 304,但它不是确定的.任何资产都可以从503到OK再到503.当直接连接到网络服务器时,资产返回正常,所以它看起来像haproxy.
我能想到的最好的是健康检查工作不正常,并且正在从haproxy的内部名册暂时删除FE/BE服务器,但这没有意义,它每隔半秒检查一次,我可以看到haproxy的调用是发送由FE/BE终端输出窗口返回,按预期每半秒发送一次.
如果我查看haproxy统计报告,我可以看到服务器定期来来去去,闪烁,尽管在终端窗口中haproxy仍然无间隙地调用运行状况检查,服务器按预期返回它们.
附件是我正在使用的当前haproxy配置,任何帮助表示赞赏.
#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
# to have these messages end up in /var/log/haproxy.log you will
# need to:
#
# 1) configure syslog to accept network log events. This is done
# by adding the '-r' option to the SYSLOGD_OPTIONS in
# …Run Code Online (Sandbox Code Playgroud)