FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

添加基于fabio的负载均衡 by xavieryang007 · Pull Request #43 · SwooleDistributed/SwooleDistributed · GitHub

Repository navigation

添加基于fabio的负载均衡 - #43

Open
xavieryang007 wants to merge 23 commits into
SwooleDistributed:v2from
xavieryang007:v2
Open

xavieryang007 wants to merge 23 commits into
SwooleDistributed:v2from
xavieryang007:v2

Conversation

Copy link
Copy Markdown

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;

tmtbe commented Feb 22, 2018

Copy link
Copy Markdown
Collaborator

暂时不合并代码。

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL