This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fabio
已经实现
1.基于fabio的HTTP负载均衡
未来实现
1.基于fabio的TCP负载均衡
2.基于fabio的websocket负载均衡
使用方法和基于consul的restful接口使用方法类似,见testcontroller中http_testfabio
配置方法
//是否开启fabio $config['fabio']['enable'] = false; //发布服务 /* 发布fabio服务后 访问本地地址http://127.0.0.1:2345/MathService/add 就可以访问到对应的服务,如果是多台服务器就会自动分配其中一台 目前仅支持HTTP服务 */ $config['fabio']['services'] =[ 'MathService'=>['/MathService/add','/MathService/sum'], ]; //fabio地址 默认为回路地址 由于fabio和consul一样都需要每台服务器都安装,因此设置回路地址就好,可以不填 $fabio['address']='127.0.0.1'; //fabio http负载均衡端口 $fabio['http_port']=2345; //fabio TCP负载均衡默认端口,TCP尚未开发完善 $fabio['tcp_port']=1234;