一个支持负载均衡,健康检查的 TcpProxy - Go语言中文网 - Golang中文社区
2023-3-19 13:15:9 Author: studygolang.com(查看原文) 阅读量:8 收藏

这是一个创建于 的主题,其中的信息可能已经有所发展或是发生改变。


## goTcpProxy GitHub:https://github.com/zheng-ji/goTcpProxy [![Go Report Card](https://goreportcard.com/badge/github.com/zheng-ji/goTcpProxy)](https://goreportcard.com/report/github.com/zheng-ji/goTcpProxy) 一个支持负载均衡,健康检查的 TcpProxy ![smailltcp](https://cloud.githubusercontent.com/assets/1414745/19109474/2eea5e56-8b28-11e6-80ba-be5ed9117f9e.jpg) ### Description #### English * A tcp proxy service * Supprot multi backend severs * Consistent Hash Load Balance * Auto detect down server, and remove it. * Monitor backend health status #### 中文 * TCP 代理服务 * 后端支持多个服务器 * 支持一致性哈希的负载均衡 * 自动检测失败的后端服务器,并移除 * 后端服务的健康检查接口 ### How To Compile ``` cd $GOPATH; git clone http://github.com/zheng-ji/goTcpProxy; make ``` ### How To Use 配置文件详解 ``` bind: 0.0.0.0:9999 // 代理服务监听端口 wait_queue_len: 100 // 等待队列长度 max_conn: 10000 // 并发最大连接 timeout: 5 // 请求超时时间 failover: 3 // 后端服务允许失败次数 stats: 0.0.0.0:19999 // 健康检查接口 backend: // 后端服务列表 - 127.0.0.1:80 - 127.0.0.1:81 log: level: "info" path: "/Users/zj/proxy.log" ``` ``` // 运行服务 ./goTcpProxy -c=etc/conf.yaml ``` ![gotcp](https://cloud.githubusercontent.com/assets/1414745/19108922/68eeab00-8b25-11e6-903a-864a19e2d9c5.png) License ------- Copyright (c) 2015 released under a MIT style license.


有疑问加站长微信联系(非本文作者)

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889


文章来源: https://studygolang.com/topics/2034
如有侵权请联系:admin#unsafe.sh