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.

时间: 2024-08-08 14:15:55

Using load balance for thrift servers的相关文章

Neutron: Load Balance as a Service(LBaaS)负载均衡

load balancer 负责监听外部的连接,并将连接分发到 pool member. LBaaS 有三个主要的概念: Pool Member,Pool 和 Virtual IP Pool Member Pool Member 是 layer 4 的实体,拥有 IP 地址并通过监听端口对外提供服务. 例如 Pool Member 可以是一个 web server,IP 为 172.16.100.9 并通过 80 端口提供 HTTP 服务. Pool Pool 由一组 Pool Member 组

hue的load balance

参考: hue的load balance官网: https://www.cloudera.com/documentation/enterprise/6/6.2/topics/hue_use_add_lb.html HA: https://www.cloudera.com/documentation/enterprise/6/6.2/topics/hue_sec_ha.html CDH启用hue的load balance: Hue-->添加角色 选择一台做为load balance的主机 Hue服

LB(Load balance)负载均衡集群--{LVS-[NAT+DR]单实例实验+LVS+keeplived实验} 菜鸟入门级

LB(Load balance)负载均衡集群 LVS-[NAT+DR]单实例实验 LVS+keeplived实验 LVS是Linux Virtual Server的简写,意即Linux虚拟服务器,是一个虚拟的服务器集群系统. 逻辑可分为: 1调度层 (Director):它是整个集群对外面的前端机,负责将客户的请求发送到一组服务器上执行,而客户认为服务是来自一个IP地址(我们可称之为虚拟IP地址)上的. 2[服务器池(server pool)/集群层(Real server)]:是一组真正执行客

Oracle RAC 服务器端连接负载均衡(Load Balance)

Oracle RAC服务器端的负载均衡是根据RAC中各节点的连接负荷数情况,将新的连接请求分配到负荷最小的节点上去.当数据库处于运行时,RAC中各节点的PMON进程每3秒会将各自节点的连接负荷数更新到service_register.而对于节点中任意监听器故障或监听器意外失败时,PMON进程会每1秒钟检查当前节点上的监听是否重启,以获得最新的负载信息来及时调整负载均衡.本文主要演示suse 10 + oracle 10g rac下的服务器端的负载均衡. 有关客户端的负载均衡可参考      Or

Oracle RAC 客户端连接负载均衡(Load Balance)

实现负载均衡(Load Balance)是Oracle RAC最重要的特性之一,主要是把负载平均分配到集群中的各个节点,以提高系统的整体吞吐能力.通常情况下有两种方式来实现负载均衡,一个是基于客户端连接的负载均衡,一个是基于服务器端监听器(Listener)收集到的信息来将新的连接请求分配到连接数较少实例上的实现方式.本文主要讨论的是基于客户端连接的负载均衡,并给出演示. 与负载均衡配置之前的监听配置请参考              ORACLE RAC 监听配置 (listener.ora t

Vertica7 Native Connection Load Balance

原文链接:Vertica7 Native Connection Load Balance 在Vertica7以前的版本中,Vertica是通过Linux的Virtual IP来实现连接的负载均衡的,但是在Vertica7x中,Vertica本身提供了连接的负载均衡功能,这个功能用起来也是非常方便的,下面就来看看怎么使用这个功能. 1. 首先安装N个Vertica7的节点,然后用数据库管理员的身份运行下面的命令来让Vertica使用这个功能 SELECT SET_LOAD_BALANCE_POLI

亲密接触Redis-第三天(Redis的Load Balance)

前言 上两天讲述了Redis的基本搭建和基于HA的集群布署方式以及相关的策略和注意点.今天开始讲述Redis的Cluster功能,而这块目前来说网上资料不是太全,就算有1,2篇也只是单讲服务端的搭建也并未提及相关的客户端怎么和Redis Cluster间的调用问题. 我们今天要讲述的Redis Cluster是真正的Load Balance,它和Sentinel不一样,Sentinel虽然也叫集群,可是它是一种HA策略即High Available或者又通俗的被称为"灾难转移"策略.

LB(load balance)负载均衡集群之LVS

LB(load balance)负载均衡集群 原理:当用户的请求过来,会直接发送到分发器上(Director Server),然后它把用户的请求根据预先设置好的算法,智能均衡的分发到后端真是的服务器上(real server).如果不同的机器,可能请求的数据不一样,为了避免这样的情况发生,使用共享存储,保证所有的用户请求的数据是一样的. 常用的负载均衡开源软件有: lvs,keepalived,haproxy,nginx,apache,heartbeat 商业的硬件负载设备: F5,Netsca

&quot;高可用方案工具包&quot; high availability toolkit 1.2 发布了。version 1.2 新增了 负载均衡 load balance 的技术实现

"高可用方案工具包"  high availability toolkit 1.2 发布了.version 1.2 新增了 负载均衡 load balance 的技术实现. 项目地址:     https://github.com/yfwangpeng/HighAvailabilityToolkit 实时微博:     http://weibo.com/58wp58       介平