Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望加入负载均衡功能,以及提供外部接口 #605

Closed
kasuganosoras opened this issue Jan 17, 2018 · 5 comments
Closed

希望加入负载均衡功能,以及提供外部接口 #605

kasuganosoras opened this issue Jan 17, 2018 · 5 comments
Labels
Milestone

Comments

@kasuganosoras
Copy link

一、希望FRP能加入负载均衡的功能、

例如可以在客户端配置文件内将多条相同类型的转发隧道归类到一个group里
当有请求的时候,均匀地将请求分配到每个隧道,就可以实现负载均衡的效果了。

(脑洞:frpc将系统负载情况定时上报给frps服务器,frps服务器根据每个frpc的负载情况选择性地转发,当然,这只是个设想,如果能实现那就太好了)

二、希望增加外部通讯接口

希望能够增加外部通讯接口,通过 Socket 或 http 控制 frps/frpc 的启动、关闭、重载配置等,这样在应用起来会方便很多。

感谢~

@fatedier
Copy link
Owner

  • 第一条是在规划中的,至于复杂性应该不会太高,你的想法就有些复杂了,做到这个项目里不是很合适,会考虑提供一些常见的负载均衡算法。
  • 启动关闭,涉及到进程管理,这个不会有接口来做。重载配置在 frpc 里已经支持。

@fatedier fatedier added the todo label Jan 17, 2018
@fatedier fatedier added this to the v0.20 milestone May 20, 2018
@fatedier
Copy link
Owner

负载均衡目前基本完成了对 tcp proxy 的支持,将在下个版本 v0.20.0 中发布。

# frpc.ini
[test1]
type = tcp
local_port = 8080
remote_port = 80
group = web
group_key = 123

[test2]
type = tcp
local_port = 8081
remote_port = 80
group = web
group_key = 123

对于同一个 group 中的 proxy,frps 接收到连接后会随机分发给其中一个存活的 proxy。
要求 group_key 相同,做权限验证,且 remote_port 相同。

这里存活的定义是 frpc 启动正常。以后会考虑添加健康检查的配置,主动探测后端服务是否能够正常连接,不能连接就从负载均衡中去除。

@xiaoyell
Copy link

@fatedier 每个用户连接时是不是固定一个服务器?

@wxyzh
Copy link

wxyzh commented May 27, 2018

一,haproxy就是专门做高可用的。二,Linux可以用supervisor,有简单的http管理功能

@fatedier
Copy link
Owner

Support in v0.20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
@xiaoyell @fatedier @wxyzh @kasuganosoras and others