Using load balance for thrift servers
Software load balance .
Nginx(http://nginx.org)
1.Install nginx
download source code from http://nginx.org/en/download.html
./auto/configure
make & make install
2.Install tcp module patch
developed by Yao Weibin http://yaoweibin.github.io/nginx_tcp_proxy_module/
download from GitHub http://github.com/yaoweibin/nginx_tcp_proxy_module/zipball/master
$ patch -p1 < /path/nginx_tcp_proxy_module/tcp.patch
$ ./configure --add-module=/path/nginx_tcp_proxy_module/tcp.patch
$ make & make install
3. config load balance
#check status at http://localhost:8080/status
http {
server{
listen 8080;
location /status {
tcp_check_status;
}
}
}
#load balance to other server
tcp {
upstream cluster {
# simple round-robin
server 192.168.0.111:11213;
server 192.168.0.110:11213; check interval=3000 rise=2 fall=5 timeout=1000; #check interval=3000 rise=2 fall=5 timeout=1000 type=ssl_hello; #check interval=3000 rise=2 fall=5 timeout=1000 type=http;
#check_http_send "GET / HTTP/1.0\r\n\r\n";
#check_http_expect_alive http_2xx http_3xx;
} server {
listen 11113; proxy_pass cluster;
}
}
4. Start Nginx
#start
$sudo /usr/local/nginx/sbin/nginx
#reopen
$sudo /usr/local/nginx/sbin/nginx -s reopen
#quit
$sudo /usr/local/nginx/sbin/nginx -s quit
5. note
1. each connection can be relocated to different servers with round-robin or weight.
2. one connection will not be relocated unless released.
3. other options for the optimize of nginx see the website. This is the basic usage only.
Using load balance for thrift servers的更多相关文章
- Neutron: Load Balance as a Service(LBaaS)负载均衡
load balancer 负责监听外部的连接,并将连接分发到 pool member. LBaaS 有三个主要的概念: Pool Member,Pool 和 Virtual IP Pool M ...
- hue的load balance
参考: hue的load balance官网: https://www.cloudera.com/documentation/enterprise/6/6.2/topics/hue_use_add_l ...
- 【mq】从零开始实现 mq-07-负载均衡 load balance
前景回顾 [mq]从零开始实现 mq-01-生产者.消费者启动 [mq]从零开始实现 mq-02-如何实现生产者调用消费者? [mq]从零开始实现 mq-03-引入 broker 中间人 [mq]从零 ...
- LB(Load balance)负载均衡集群--{LVS-[NAT+DR]单实例实验+LVS+keeplived实验} 菜鸟入门级
LB(Load balance)负载均衡集群 LVS-[NAT+DR]单实例实验 LVS+keeplived实验 LVS是Linux Virtual Server的简写,意即Linux虚拟服务器,是一 ...
- Server Data Synchronization Via Linux rsync、rsync+inotify Between Load Balance Server
目录 . 远程文件同步的应用场景 . rsync+crontab . rsync+inotify 1. 远程文件同步的应用场景 在负载均衡集群的应用场景中,往往在多台web server的前端有一个提 ...
- Oracle RAC 服务器端连接负载均衡(Load Balance)
Oracle RAC服务器端的负载均衡是根据RAC中各节点的连接负荷数情况,将新的连接请求分配到负荷最小的节点上去.当数据库处于运行时,RAC中各节点的PMON进程每3秒会将各自节点的连接负荷数更新到 ...
- Oracle RAC 客户端连接负载均衡(Load Balance)
实现负载均衡(Load Balance)是Oracle RAC最重要的特性之一,主要是把负载平均分配到集群中的各个节点,以提高系统的整体吞吐能力.通常情况下有两种方式来实现负载均衡,一个是基于客户端连 ...
- 亲密接触Redis-第三天(Redis的Load Balance)
前言 上两天讲述了Redis的基本搭建和基于HA的集群布署方式以及相关的策略和注意点.今天开始讲述Redis的Cluster功能,而这块目前来说网上资料不是太全,就算有1,2篇也只是单讲服务端的搭建也 ...
- NGINX Docs | Load Balancing Apache Tomcat Servers with NGINX Open Source and NGINX Plus
NGINX Docs | Load Balancing Apache Tomcat Servers with NGINX Open Source and NGINX Plushttps://docs. ...
随机推荐
- ICMP 实现
以下代码取自 kernel- . [数据结构] struct icmp_control { void (*handler)(struct sk_buff *skb); //icmp处理函数,根据icm ...
- ASP.NET MVC 解决LINQ表达式中的SqlMethods 未找到命名空间问题
右键项目属性下的引用: 添加引用: 搜索寻找——System.Data.Linq,然后添加成功,即可解决LINQ表达式中的SqlMethods 未找到命名空间问题
- android Button 颜色的变化(点击,放开,点击不放)
参考: http://endual.iteye.com/blog/1534258 总结: 定义res/drawable/button_style.xml文件 <?xml version=&quo ...
- jdk jre jvm 关系
很多朋友可能跟我一样,已经使用JAVA开发很久了,可是对JDK,JRE,JVM这三者的联系与区别,一直都是模模糊糊的. 今天特写此文,来整理下三者的关系. JDK : Java Development ...
- bzoj1458
题做多的话不难想到可能是以行列作为二分图两个点集,然后网络流相关 具体怎么弄呢 我们可以用求补集的思想,假设有解 我们先把棋盘能放的地方放满士兵,然后我们尽量的把士兵拿走 并且要满足行和列的要求, 说 ...
- Hash Killer I II
题意大概: 1.字符串hash不取模,自动溢出 构造数据卡这种hash 2.字符串hash取模1000000007,构造数据卡这种hash 题解传送门:VFleaKing http://vfleak ...
- 文本编辑器 CKEditor 用法
最新文本编辑器,FCK升级版:CKEditor.NET CKEditor.NET.dll 版本:3.6.4.0 官方网址:http://ckeditor.com/ 效果图: 配置web.c ...
- C#中类的默认访问是私有的
如果类前面没有访问修饰符的话,那里面的成员默认是私有private. 下面的代码是从MSDN上拷的,那个d它说明了私有:class Employee{private int i;double d; / ...
- 《C语言程序设计现代方法》第4章 表达式
C语言的一个特点就是它更多地强调表达式而不是语句,表达式是表示如何计算值的公式. 当表达式包含两个或更多个相同优先级的运算符时,运算符的结合性(associativity)开始发挥作用.如果运算符是从 ...
- DevExpress的JavaScript脚本智能提示
http://www.cnblogs.com/zhaozhan/archive/2011/06/08/2075767.html ASPxScriptIntelliSense.js在安装目录下的Comp ...