ProxyServerLoadBalancer

所属分类:云原生工具
开发工具:JavaScript
文件大小:674KB
下载次数:0
上传日期:2012-05-04 18:08:38
上 传 者sh-1993
说明:  代理服务器负载平衡器,,
(ProxyServerLoadBalancer,,)

文件列表:
General (0, 2012-05-04)
add_test_server (179, 2012-05-04)
add_test_server_d (181, 2012-05-04)
balance (1318, 2012-05-04)
balance~ (1319, 2012-05-04)
certificate.cer (1058, 2012-05-04)
loadbalancer.conf (635, 2012-05-04)
loadbalancer.js (12850, 2012-05-04)
monitrc (277, 2012-05-04)
node_modules (0, 2012-05-04)
node_modules\.bin (0, 2012-05-04)
node_modules\.bin\express (22, 2012-05-04)
node_modules\cluster (0, 2012-05-04)
node_modules\cluster\.npmignore (62, 2012-05-04)
node_modules\cluster\History.md (8237, 2012-05-04)
node_modules\cluster\LICENSE (1093, 2012-05-04)
node_modules\cluster\Makefile (76, 2012-05-04)
node_modules\cluster\docs (0, 2012-05-04)
node_modules\cluster\docs\api.md (6628, 2012-05-04)
node_modules\cluster\docs\cli.md (1497, 2012-05-04)
node_modules\cluster\docs\debug.md (706, 2012-05-04)
node_modules\cluster\docs\logger.md (723, 2012-05-04)
node_modules\cluster\docs\pidfiles.md (682, 2012-05-04)
node_modules\cluster\docs\reload.md (1340, 2012-05-04)
node_modules\cluster\docs\repl.md (3982, 2012-05-04)
node_modules\cluster\docs\stats.md (2480, 2012-05-04)
node_modules\cluster\index.js (43, 2012-05-04)
node_modules\cluster\lib (0, 2012-05-04)
node_modules\cluster\lib\cluster.js (813, 2012-05-04)
node_modules\cluster\lib\master.js (19495, 2012-05-04)
node_modules\cluster\lib\mixins (0, 2012-05-04)
node_modules\cluster\lib\mixins\receiver.js (1219, 2012-05-04)
node_modules\cluster\lib\plugins (0, 2012-05-04)
node_modules\cluster\lib\plugins\cli.js (4741, 2012-05-04)
node_modules\cluster\lib\plugins\debug.js (2995, 2012-05-04)
... ...

# Cluster [Cluster](http://learnboost.github.com/cluster) is an extensible multi-core server manager for [node.js](http://nodejs.org). ## Installation ```bash $ npm install cluster ``` ## Features - zero-downtime restart - hard shutdown support - graceful shutdown support - resuscitates workers - maintains worker count, even if worker was _SIGKILL_ed. - workers commit suicide when master dies - spawns one worker per cpu (by default) - extensible via plugins - bundled plugins - [cli](http://learnboost.github.com/cluster/docs/cli.html): provides a command-line interface for your cluster - [debug](http://learnboost.github.com/cluster/docs/debug.html): verbose debugging information - [logger](http://learnboost.github.com/cluster/docs/logger.html): master / worker logs - [pidfiles](http://learnboost.github.com/cluster/docs/pidfiles.html): writes master / worker pidfiles - [reload](http://learnboost.github.com/cluster/docs/reload.html): reloads workers when files change - [repl](http://learnboost.github.com/cluster/docs/repl.html): perform real-time administration - [stats](http://learnboost.github.com/cluster/docs/stats.html): adds real-time statistics to the `repl` plugin - supports node 0.2.x - supports node 0.4.x - supports TCP servers ## Example app.js: ```javascript var http = require('http'); module.exports = http.createServer(function(req, res){ console.log('%s %s', req.method, req.url); var body = 'Hello World'; res.writeHead(200, { 'Content-Length': body.length }); res.end(body); }); ``` server.js: ```javascript var cluster = require('cluster') , app = require('./app'); cluster(app) .use(cluster.logger('logs')) .use(cluster.stats()) .use(cluster.pidfiles('pids')) .use(cluster.cli()) .use(cluster.repl(8888)) .listen(3000); ``` Note that cluster does _not_ create these directories for you, so you may want to: $ mkdir {logs,pids} recommended usage: passing the path to prevent unnecessary database connections in the master process, as `./app` is only `require()`ed within the workers. ```javascript var cluster = require('cluster'); cluster('./app') .use(cluster.logger('logs')) .use(cluster.stats()) .use(cluster.pidfiles('pids')) .use(cluster.cli()) .use(cluster.repl(8888)) .listen(3000); ``` ## Plugins Below are the known 3rd-party plugins for cluster: - [cluster-log](https://github.com/LearnBoost/cluster-log) remote logger powered by redis - [cluster-mail](https://github.com/LearnBoost/cluster-mail) email exception notifications - [cluster-exception](https://github.com/3rd-eden/cluster.exception) extensive exception notifications - [cluster-responsetimes](https://github.com/mnutt/cluster-responsetimes) response time statistics for cluster's REPL ## Screencasts - Cluster [Introduction](http://screenr.com/X8v) ## Running Tests Install development dependencies: ```bash $ npm install ``` Then: ```bash $ make test ``` Actively tested with node: - 0.4.9 ## Authors * TJ Holowaychuk ## License (The MIT License) Copyright (c) 2011 LearnBoost <dev@learnboost.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

近期下载者

相关文件


收藏者